-
ClipPlane
allows you to define custom clipping planes.See our documentation of nodes, X3D documentation of ClipPlane, and a simple demo or very complicated demo.
Remember that this node can be specified in an X3D file (which you can open using e.g. view3dscene or load to TCastleScene), or it can be added and changed using Pascal code (use
TClipPlaneNode
class).While we already had this feature in the past, it was broken in the modern shader pipeline. It is fixed now, and will work both in modern OpenGL and on mobile OpenGLES 🙂
-
in OpenGL >= 3: use built-in gl_ClipDistance
-
in OpenGL < 3, keep using gl_ClipVertex,
-
in OpenGLES: use own castle_ClipDistance, discard in fragment shader.
-
-
We also have a new example showing how to use TInputShortcut and save it to a config file.
User-defined clipping planes, TInputShortcut example