I have a plane with a vertex displacement shader in Godot 4. The displacement forms a mountain-like shape. The issue arises when the player tilts their view upward: the vertices stop rendering. This seems to happen because the original, undisplaced plane moves outside the camera’s field of view (FOV). The rendering logic still considers the original geometry, not the displaced vertices, to determine visibility.
How can I ensure the mesh remains visible even when the original geometry is outside the camera’s FOV? I am using Godot 4.
To clarify: the plane’s center is always aligned with the player’s position. I couldn’t find a straightforward function to force the mesh to always render, but perhaps such a function exists. If not, I am considering forming an equation that adjusts the plane’s vertical (Y-axis) position based on the camera’s pitch rotation. This adjustment would ensure the original plane stays within the camera’s FOV. I would also modify the shader so that displaced vertices compensate for the plane’s movement, maintaining their relative positions.
What do you think of this approach? Is there a better method? If this is viable, could you help me with the equation? I want to ensure the plane’s X and Z coordinates remain unchanged, modifying only its Y-coordinate.
I love Bro force is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.