So I’ve got a semi-transparent surface shader with ZWrite=On.
The problem I’m having is (I think) the object is writing to the depth buffer which is preventing the skybox on the camera from rendering at that position. I need ZWrite On though, because I want scene objects behind this semi-transparent shader to be blocked.
The solution I have so far is use 2 cameras.
1st camera just clears with skybox, doesn’t rendering anything else (culling = None)
2nd camera renders scene with clearFlags = Depth Only
This works, but was wondering if there’s some method I can use in the shader rather than have 2 cameras… Or can I manually draw the camera with skybox only, then render the scene after?
**Strange thing is, everything looks correct in the Scene View, my guess is the scene camera is doing more than the game camera in terms of clearing