Animated Sprite textures vs Alpha
Blitz3D Forums/Blitz3D Programming/Animated Sprite textures vs Alpha
| ||
I was just having a think about optimising some code and I was woondering about what the advantages/disadvantages would be for a particular case: When dealing with light decal sprites on a spaceship that blink on and off, there's two ways I thought of to approach this, both easy to implement. ((Bear in mind, the sprites in question are recorded as Types)) One way (and the current way Im using) Is to alter the alpha level of the sprites at regular intervals. aAnotherr possiblity is just to have Animated textures that show the blinking. Any ideas on what's quicker/memory-efficient? |
| ||
Obvioulsy an animtexture would take up more memory. Using alpha also has it's disadvantages ... you may get filrate issues ( slowdown ) if the decals are close to the camera and alot of alpha going on. Also, z-order will be disabled so you may get some unwanted clipping. It would not be difficult to test both methods though. Stevie |
| ||
Thanks Stevie... Im thinking that the clipping and sprites being close to the camera shouldnt be a problem, as generally, they'd be quite distant. I think it's a toss up between saving memory or speed, and Il see how it goes for now until more of the engine's in place, but I'm betting it will most likely be sllowdown issues that make the choice! |
| ||
With modern PC's having quite large amounts of RAM, as they do, I pretty much always try and trade in memory usage for speed. BTW, can't you just have regular light decal sprites and then show/hide them to make them blink? Or are you going for a fade on/off effect? |