OpenGL Water Tutorial 3: Clipping Planes
Why Stack Overflow recommends it
Stack Overflow users link it when they are implementing water reflection and refraction and need to understand or debug clip planes and clip distance.
Recommended by 0 people across 0 different months, 2017 to 2024.
What it is
Part 3 of ThinMatrix's OpenGL water tutorial series, covering how to use clipping planes to cull geometry above or below the water surface so reflection and refraction textures can be rendered. It is a narrated coding walkthrough with links to plane-equation background reading.
What people said
Cites Haplue · 2017-08 · Stack Overflow · on “OpenGL Enable Clip Distance”
I'm trying to render a proper refraction/reflection in my OpenGL project and I need to use clip distance. I'm following the tutorial by Thin Matrix [this video] . I enable the clip distance with glEnable(GL_CLIP_DISTANCE0); in my game loop and then I try to use it in the vertex shader like this gl_ClipDistance[0] = -1; I've tried to change around the -1 value but nothing happens no matter what I do. Is there something more I need to do to enable it properly?
Cites Coma · 2021-12 · Stack Overflow · on “How to implement water clipping plane in Unity”
[this video] I am using a camera for water reflection. Is there a way to not render as height below the water level? like the youtube video above. Sorry for my bad english.
Cites karlphillip · 2024-05 · Stack Overflow · on “Example program which uses QClipPlane from Qt3D”
This is probably overkill but I wrote a QML/Qt3D application called qml3DWater [LINK] some time ago that renders a small lake using clipping planes to create the reflection and refraction effects. You can find more information about the use of clipping planes for this purpose here: OpenGL Water Tutorials by ThinMatrix [LINK] Basically, clipping planes are defined as part of this custom PhongShadingMaterial [LINK] so that objects that use this material can be rendered using a two render-pass approach: on the first pass, a clipping plane vector allows us to render the bottom part of the mesh; on the second pass, another clipping plane vector allows us to render the top part of the mesh; The ve