Hi, what I’m trying to do is simple in theory, but in practice I do not know how to go about it.
I wrote a nice steep parallax mapping shader that allows me to make materials that make a basic Unity cylinder look like this:
My issue is that the parallax mapping is so steep that when I try to place things next to the surface (especially if I am using this shader for the ground and need to place, say, chairs or other objects “on the ground”), the things start to intersect the surface’s base geometry instead of my displaced surface.
The standard pipeline for shaders is, as far as I know:
Vertex Shader → Depth Write/Test → Fragment Shader
Is there any way, short of disabling all depth test and making my own depth buffer out of a render texture (with blackjack and hookers) that I can write to the depth buffer per-fragment in the second stage so that my bumpy wall can properly intersect other objects in the scene? I’m using a Surface Shader but I do not mind going back to the old shader model to do this.
Here is the intersection problem I am facing (for which I am trying to find a way to draw to the depth buffer):