Java-Gaming.org Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (757)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (844)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  I had an idea involving .gifs!  (Read 1945 times)
0 Members and 1 Guest are viewing this topic.
Offline wessles
« Posted 2014-01-07 00:59:13 »

So, you know how if you want to store an animation, you can either store multiple frames on an image or create your own format? Well what if we took frames from .gifs? This obviously has some flaws (lack of color scale), but it would be a novel thing to be able to load an animation from a .gif.

Just a thought,
-wes
Offline davedes
« Reply #1 - Posted 2014-01-07 01:25:07 »

OpenGL doesn't know what a GIF is, it just understands textures. If you pack each frame into a single texture, you can utilize sprite batching to reduce draw calls and improve performance. Using a different texture for each frame is not as optimal.

Some desktops support "texture arrays" which could work with GIFs, but at that point you may as well just have an image sequence so you can take advantage of full 32-bit color.

Artists are pretty used to exporting image sequences; tools like Maya and After Effects have it built-in. New versions of AE do not even export to GIF anymore, since nobody is using it these days. Smiley

Plus, with texture atlases, you can pack multiple animation sequences into the same image, which should help with filesize and load time. Another thing... with texture atlases you can trim away white space for each frame, leaving you with a much smaller overall image.

Since Java2D uses OpenGL/DirectX under the hood; the more "hardware-friendly" your rendering is, the better it should perform, in theory.

Offline Opiop
« Reply #2 - Posted 2014-01-07 02:13:27 »

Well I'm sure you could produce a tool that would pull apart the .gif at intervals and then use pack the images into a spritesheet, and voila, you have your "GIF" in a format OpenGL can read. But really, isn't that way too much work when you can just make the spritesheet yourself?
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Abuse

JGO Ninja


Medals: 64


falling into the abyss of reality


« Reply #3 - Posted 2014-01-07 03:23:17 »

.mng would be a better choice.
Offline noblemaster

« JGO Spiffy Duke »


Medals: 35
Projects: 11


Age of Conquest makes your day!


« Reply #4 - Posted 2014-01-07 06:32:22 »

There are a couple standalone Java classes that allow encoding and decoding to/from GIFs! Shouldn't be hard to just replace java.awt.Image with OpenGL textures. I have done it before.

Anyhow, too lazy to look up GIF encoder/decoders for you. Just have a look what Google brings up.

Pages: [1]
  ignore  |  Print  
 
 

 
EgonOlsen (45 views)
2018-06-10 19:43:48

EgonOlsen (27 views)
2018-06-10 19:43:44

EgonOlsen (47 views)
2018-06-10 19:43:20

DesertCoockie (211 views)
2018-05-13 18:23:11

nelsongames (128 views)
2018-04-24 18:15:36

nelsongames (127 views)
2018-04-24 18:14:32

ivj94 (868 views)
2018-03-24 14:47:39

ivj94 (129 views)
2018-03-24 14:46:31

ivj94 (780 views)
2018-03-24 14:43:53

Solater (144 views)
2018-03-17 05:04:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!