- Home /
Shader for ZTest Between Terrain and Objects
The eventual goal is a shader which always draws in front of the terrain, but is culled as usual behind everything else.
As a first step I'm trying to at least see if I can get it to always draw in front of everything, with the following Category{} settings:
Tags{"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
Blend SrcAlpha OneMinusSrcAlpha
Cull Off
Lighting Off
ZWrite Off
ZTest Always
Fog{Mode Off}
Oddly, this ends up doing the precise opposite of what I want: it's drawn on top of all regular objects, but still gets clipped by the terrain and only the terrain.
Since it's in the "transparent" queue, after the other objects it's correctly obscuring, I'd imagine this would surely be well after the terrain's queue (its splat shaders apparently render at "Geometry-100" and "Geometry-99" queues). Yet when I lay a mesh along its surface, parts of it get clipped off by convex contours of the terrain.
Know why this is, and how to get its rendering (and culling) to be drawn over the terrain?
Your answer
Follow this Question
Related Questions
How to make terrain partially transparent (lower opacity) 1 Answer
How to make trees in a terrain transparent in runtime? 0 Answers
Terrain Trees 3rd Party Software "Nature/Soft Occlusion" required? 0 Answers
Writing fragment shader data to RenderTexture 0 Answers
No Shadows on Tessellated Terrain 1 Answer