Hi I’m just throwing out a wildshot question here regarding a problem I encountered.
I have created shaders using stencil buffer to mask a hole in a mesh. It works kinda in that it works at certain camera distances. Basically it goes like this:
Everything works fine
I move the camera back a bit and it stops working (no masking is done)
I move the camera back a bit further and now it works again.
This behavior is the same both in the scene editor and the game view. The scene only contains the mask mesh and the mesh that should be effected by the mask.
Any idea in which area I should start investigating cause i’m kinda stumped here.
Hm… I would check if the the render queue is correct (Make sure the mask is rendered first by setting its queue target to one below geometry: “Queue”=“Geometry-1”). Or are you using something like Offset in your shader?
Otherwise… Are you using forward or deferred rendering? I heard that there can be problems with deferred rendering. Maybe post the mask shader here so we can have a look. A simple mask shader would look like this: