#Dynamically colored sprites

5 messages · Page 1 of 1 (latest)

spare axle
#

I'd like to have sprites with program-defined colors. One way I could do this is import the sprite and generate variant textures on the CPU, then swap out the texture on the sprite as needed. However, as I understand it, then I won't benefit from batched rendering, which seems like an unnecessary de-optimization. If I could just stick some of my own uniforms and a fragment shader onto the sprite pipeline I'd be set, but I can't see a way to do that. Am I msising something?

brisk egret
#

then you would need to sample the pixel data of your texture and draw stuff depending on that (that part might be the hardest, I think people have already made shaders for sprite)