Replicate a script - How to start

Hi all,

I want to implement on Unity this:

http://minimal.be/lab/jQuery.eraser/

I don’t really know where to start… Do you have ideas about how can I manage this?

Thanks in advance :smile:

I would use a shader with 3 images. The over image, the under image, and the mask. Clicking or touching the screen would change the colors in the mask for a certain distance around that point to tell the shader to show the other image around that area.

Alternatively, you might do the same thing with a shader that changes images according to vertex colors, and use a very dense mesh. It would look a little blurry around the edges of the area they touched, but that could be considered a feature.

Or with default shaders,

  • 2 planes on top of each other
  • you paint to the top plane (setting texture alpha to 0 with mouse+raycast+SetPixels(), material/shader: unlit/transparent)

also similar thing,

Thank you very much, you’ve been very useful :smile: