How would I achieve a staining effect like the game people playground has?

I want items to get stained with burn marks, blood marks, etc. I know I could use a sprite mask, but that would not change the separate pixels on a sprite and instead puts an overlay on them. Because my game is in pixel art, I would like to stain the separate pixels touched by something. I honestly have no idea how to do this, so I’ve come to the more experienced people (you all) to ask. How would I do this? Example image of the stains in people playground:

use texture2d.setpixels to draw blood on sprites in runtime

1 Like

Write a shader. Pass data about where the blood stain is on the object from a class in your project so your custom shader knows where to draw it.

I doubt this would be a desired solution but maybe a turn based game it could work; but I imagine it would always cause a lag spike.

1 Like