- Home /
How do I cull water in my boat without setting render queue to transparent?
I have a boat whose insides go below the water line. I can hide the water by using a depth mask shader, and setting the water's render queue to above 2500, but when I do this, it causes tonemapping to fail. Additionally, if the render queue of the ocean is above 2500, it no longer receives shadows.
I would like to hide the water inside the boat without bringing the ocean's render queue above 2500 to avoid those two problems.
I don't think I have a good understanding of how the render queue and depth buffer actually work. I would have thought that it would work if I:
Leave the boat's queue to normal geometry (2000)
Set the boat cover geometry (with the depth mask shader) to 2010. This would write to the depth buffer, but not actually change the pixels that had already gotten written with the boat geometry.
Set the queue of the ocean to 2020. This would cause any pixels of water that were sticking through the bottom of the boat not to be drawn because it would check the depth buffer that was written by the cover geomety, and think something was in front of it.
However, when I try the above, the water still shows through the bottom of the boat.
Does anyone know how to accomplish what I am trying to do, or have an explanation as to why my theorized solution doesn't work in practice?
Thanks a bunch!
Your answer
Follow this Question
Related Questions
Floating boat 1 Answer
SailBoatGame-SailSystemScript 1 Answer
How to change terrain shader 0 Answers
Depth mask shader and Unity shadows 0 Answers
Transparency under depth mask 0 Answers