Hello, I am struggling to get my shader to work properly:
When the quads move away from the plane, the quad rendered on the plane should fade away completely. However, when the quads are below the plane, the borders of the quad remain.
A little bit about my setup:
- The topdown orthographic camera renders those quads in a Render Texture.
- The quads have a shader which
- creates the UV-pattern in R and G channels
- calculates the proportional distance from the camera to its far plane, and stores this distance in the B channel. For example, if the quad is perfectly centered in between the camera’s near and far planes the B channel would have a value of 0.5.
- The plane has a shader to render the quads using the height information the quads have calculated.
- Essentially, I’m trying to extend this to support the information of the object’s Y-coordinate in order to only apply an effect on objects at certain height.
These are the shaders I’m using:
Quad
Plane
I’ve attached a .unitypackage with the required assets if the above isn’t enough information. Any help is appreciated!