- Home /
How to make a cleaning effect similar to the one in Dumb Ways to Die with C#?
We're trying to create an effect where you have a dirty screen and you clean it with a brush controlled by a mouse.
How can we mask out a dirt sprite bit by bit so it looks like the brush is wiping the dirt off?
Here's an example of the same kind of effect in Dumb Ways to Die: http://www.appslooking.com/wp-content/uploads/2013/06/Dumb_Ways_to_Die_2.jpg
This problem is probably best approached through a shader which includes a mask. You can script the ability to affect the mask texture at runtime. If it's low-res enough to remain performant, you can even do it with a virtual "brush" you operate inside a loop over the texture's pixels.
An alternative is a shader which uses vertex color for alpha masking, in which case your real-time edits would be to the vertex colors.
How would you go about modifying a mask texture at runtime?
Open up the extra comment section of the following answer for some starter code:
http://answers.unity3d.com/questions/614788/is-it-possible-to-make-2d-real-time-coloring-with.html
@Raichiu - Hi. I am working on the same thing that you said in this post. I created a texture and i successfully cleaned it but i dont know how to check that i finished cleaning everything??
Please help me on that. Thanks in advance.
Your answer