|Topic was automatically imported from the old Question2Answer platform.
I am planning on creating a game that takes place mainly on the water and in 3D. I was hoping to add interiors below sea level to the boats in this game. The problem is that the water plane would be rendered inside the boat when viewed from above.
To solve this it would be really awesome to have the ability to set some transparent plane that stops the water from being rendered. Unity achieves this by using something called a depth mask.
Now that I’ve layed out my problem lets come to my question(s). I hope it’s ok to ask all of them in ne question as they’re basically all the same question.
- Is it possible to achieve something like this in godot
- If it’s not possible how would I achieve my goal (interior without water) in Godot
Here are some alternatives that might achieve the same effect
- Use a water-plane with a ship sized hole (not so good with multiple ships and ship sizes)
- Render the interior via render-to-texture everywhere it should be visible (expensive)
Thanks in advance
- Draw the boat
- Draw whatever is inside the boat (passengers…)
- Draw a mesh hull enclosing the boat, but only write it to the depth buffer, no color (not even transparency because that would break draw order)
- Draw the sea: due to 3), it won’t overlap with the inside of the boat’s hull.
Now I wonder if step 3) is possible to do in Godot… if not, it could be a feature request. We would need a
depth_only shader render mode.
Zylann | 2018-05-15 12:58
Yeah I was trying something like that the other day. Didn’t work out. But then I realized a project setting called
depth pre-pass. With that on, the depth buffer is written before any color is written. I wonder what happens if I disable that?
Well that didn’t work out either. I guess it’s not a feature yet. I second what Zylann said. If you really want it, make a feature request.
SIsilicon | 2018-05-15 15:04