Solved

Is clipping GIF's in code better than storing the GIF cuts in web-space?

Posted on 2014-12-30
5
114 Views
Last Modified: 2014-12-31
Hi

for my RTS, I have the GIF tiles ready for my map scenery.
I can chop them up from a big image at the beginning or load in each tile one by one.

Is the obvious improvement in loading a GIF once and chopping the sub-images out the best way to go, or is loading in the images pre-cut better?

Thanks
0
Comment
Question by:beavoid
  • 2
  • 2
5 Comments
 
LVL 26

Accepted Solution

by:
dpearson earned 500 total points
ID: 40525059
Generally it's better to load 1 large image and pull the image elements from within that.

This is generally known as "texture packing" and makes a big difference if you can load the entire image (a texture atlas) into video memory in one go.  You can read more about it here: http://en.wikipedia.org/wiki/Texture_atlas

I've not personally attempted to do this with a Java front end client, but it's a common technique used with many other rendering technologies.
0
 
LVL 61

Expert Comment

by:gheist
ID: 40525180
HTTP adds heap of latency when loading lots of sprites, so it is best to join them together.
It will kind of be solved with HTTP/2.0, currently known as SPDY or so.
0
 

Author Comment

by:beavoid
ID: 40525446
I am not using HTTP, no text, just extracting the GIF from my domain into memory.
But it's best to make one load of graphics and chop it up? Latency, how? Surely once it is in memory, it is solid?

Thanks
0
 
LVL 61

Expert Comment

by:gheist
ID: 40526273
You can have one huge png resource for all.
0
 

Author Closing Comment

by:beavoid
ID: 40526275
Great
Thanks
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Artificial Intelligence comes in many forms, and for game developers, Path-Finding is an important ability for making an NPC (Non-Playable Character) maneuver through terrain.  A* is a particularly easy way to approach it.  I’ll start with the algor…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now