I am varying the color of a smoke (display object) by making it darker according to some game conditions. I have two methods of doing it but I need to know which method runs faster. Note that i generate a puff every frame so every bit of speed gain is welcome.
Method 1:
obj.fill = paint (where paint is a previously loaded darker version image of the smoke)
Method 2:
obj.fill.effect = “filter.sepia”; obj.fill.effect.intensity = .7
I like Method 2 because I can vary the intensity of the effect (how light or dark) depending on the conditions whereas method one only has one variation of the a darker smoke (unless i have more versions of the image with varying darkness) but I am concerned if using filters (method 2) might be more taxing on the cpu/gpu. I don’t notice any performance difference because 1) the smoke image is only 25x25 and 2) my test devices are decently modern with much faster CPUs and large RAMs. However, if there is a big processing difference I’d probably pick the faster solution so older devices can benefit.
Thanks!
Santi
