Hey guys,
I'm trying to figure out a solution to properly render decals applied to a surface while avoiding any overhang (see attachment)
Basically a simple plane is grabbed from a pool, moved to the proper position in world space, then the blood splat material is applied. This works well enough but if the decal is applied on the edge of any geometry you get this super noticeable overhang.
I had an idea to create a shader that would only render at locations where another surface is behind the decal, but i'm not quite sure how to go about something like this.
I would just use projectors but they're a huge hit on performance so i'm after something shader based ideally.
Any ideas?
Replies
If you use ShaderForge or Strumpy's I think they both have it (maybe). Basically, you want to check that the depth of the decal and the scene depth (of solid objects only) are within a small range (indicating they are close).
If you can't find the node (or it isn't there) or if you want to write it by hand, look for the Soft Edge Particle shader. It blends alpha when the particle intersects with things - you basically want to do the opposite!