User-defined clipping planes, TInputShortcut example

Posted on

  1. 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.

  2. We also have a new example showing how to use TInputShortcut and save it to a config file.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.