- Home /
Shader for mesh to project onto sprite?
I have a 2D project where I have a sprite game object with an irregular shape, and a square mesh sitting on top of it with a simple shader to use the color and alpha of the mesh. It's easiest to think of the mesh as applying a highlight/gray out to the sprite, however the actual use case is a bit more complex than that.
I'm completely new to shader programming, is there some way to make the mesh only be applied where there is no alpha on the underlying sprite, instead of showing the entire square?
Edit: If there is any further information I should provide to make my question clearer then please let me know.
you can do tests in the pixel/fragment-shader and NOT draw a pixel, so this might well be easy. Are the square mesh and the sprite two seperate objects? If you can post your current shader code this might help and we might be able to suggest a simple change