2D Toolkit Forum

2D Toolkit => Support => Topic started by: ExCx on September 19, 2013, 02:12:50 pm

Title: How to Whiten a Sprite Gradually
Post by: ExCx on September 19, 2013, 02:12:50 pm
Hi, I need to make a sprite go completely white. I mean like a white silhouette of itself. I can change the shader to do it instantly, but how can I do it gradually?
Title: Re: How to Whiten a Sprite Gradually
Post by: marcosramos on September 19, 2013, 09:57:17 pm
This is somehow what i want to know as well.
Title: Re: How to Whiten a Sprite Gradually
Post by: profanicus on September 19, 2013, 11:37:57 pm
I think you would need to make a custom shader.

You could copy and change an existing tk2d shader so that the vertex colour is added instead of multiplied. Your sprite colours would then need to be black instead of white by default to be in their 'normal' state. Then when you lerp the tk2d sprite colour to white, the sprite pixels should move towards a solid white instead of being tinted. That's my theory anyway. :)
Title: Re: How to Whiten a Sprite Gradually
Post by: unikronsoftware on September 19, 2013, 11:53:20 pm
You could try this shader:
http://unikronsoftware.com/2dtoolkit/forum/index.php/topic,391.msg1708.html#msg1708