- Home /
Procedural or Animated Textur in AirAttack Zeppelin Wreck (IphoneGame)?
Did someone noticed this very nice dismantling effect on the zeppelin, as the wreck "animation" in the game AIR ATTACK on the iphone? It looks like a paper is burning off.
how coulds this be made? its a bit to smooth for a animated png texture trick. and it would use to much texture space for an iphone game. could this be made procedural on a algorythm, or ist this really a animated texture and not more? And if it is a animated texture, with what tool could i generate such an png animation?
i am wondering cause some games are using this method to vanish their objects, instead of blending them simply with transparancy out.
i also ask myself about the naming of this effect. does anyone have a usefull link with an description to it? that would help me alot.
i really appreciate your help into this sorry for my complicated english xD
Answer by skovacs1 · Nov 29, 2010 at 06:04 PM
The problem with your question is that it is very general and a bit all over. I will answer it with the interpretation that you are asking, "how can you implement an effect to create a smooth 'burning away' of a texture as was done in the iPhone game Air Attack using Unity?"
As you suggest, they could have used a pre-built animated texture (simple yet sizeable) or they could have animated the texture in code (script or shader)(more complicated with lower size).
To create such an effect procedurally would be easily done in script by setting points on the texture to start burning away from (could be stored or random as you like) and then expand the burning of the pixels from there (maybe by writing to a greyscale texture on the material instance). If your UV mapping is done right, this can be guaranteed to look correct. The burning itself could be done fairly simply by using a texture lookup to some kind of burn ramp in the shader indexed using the burning information (greyscale texture mentioned above). In your script you would expand from your burning points and adjust the progressively surrounding values until they all indicated the 0 alpha index of the ramp at which point you would destroy the object. Modifying a texture at run-time can be costly, especially if it is hi-res, but since the textures do not seem overly complicated for this game, it should be feasible. To modify a texture, you would use SetPixels. Since you are getting the values to muck about with, you can actually do this in code without the overhead of calling GetPixels.
There are other approaches, but this is the one that I would take to achieve this effect if it needed to be done entirely procedurally. The shader is simple and the storage overhead is low, but you would have at minimum the run-time storage cost of storing an array of pixels the size of your texture for each object that is burning away and the cost of calling SetPixels and of calculating your burning away (which can actually be not too bad if your burning is fairly quick and well-written).
You could combine the two methods and use an animated (maybe lower-res?) greyscale texture that is used by the shader to index the burn ramp. This has the advantage of little to no real computation and the use of an animated texture, but an animated texture with much less cost. This way, you can also re-use this animated greyscale burning texture across multiple objects.
Your answer
Follow this Question
Related Questions
Water wave ripple effect for mobile - koi pond 2 Answers
create a building with the same texture 1 Answer
Muzzle Flash 1 Answer
Transparent gaseous/foggy sphere 0 Answers
Setting mipmaps 0 Answers