Hi, I’m pretty new at understanding shaders. I’ve been following along with the shader examples and checking out other demos/tutorials. I’m trying to build a shader that does vertex displacement, and I have been able to get everything working how I like it in the editor, with one exception. When I rotate my camera in scene view above a certain angle, the shadows disappear and everything goes matte.
After intense debugging and failed attempts at making any progress, and massive amounts of googling, I think I found the answer to my problem, but I can’t tell for certain. Here is the post that gave me the “aha” moment and I’m hoping someone can confirm my suspicions:
The mesh that I am using for my shader while I work on it is just a plane, and if I understand this post, the shadows are disappearing because the mesh, being a plane, has a planar bounds, which means I am displacing the verticies outside the bounds of the shadowmap.
Does that sound right? And, if so, does that means that even if I applied this shader to a different mesh form, I could experience the same issue if the vertex gets displaced beyond the bounding box of the mesh?
Here is are some screen shots of what I’m seeing happen:
Hmm, I’m thinking that this might not be the issue after all. I tried changing the bounds of the mesh to be large enough to contain the whole displaced area and it is still doing this. My shader code is just the “Lit/Diffuse With Shadows” one from the examples with vertex displacement added to the vert function and to the shadowcaster following this post .
The vertex displacement in my vert function is done by sampling a noise texture.