Cut geometry. Keep the volume.
A rotating torus knot makes the difference between global clipping, material-local clipping, shadow clipping, and a stencil-generated cap visible in one WebGL2 scene.
Preparing local and global clip planes, shadow clipping, and stencil caps...
- renderer
- -
- local
- -
- global
- -
- mode
- -
- stencil
- -
- calls
- -
- triangles
- -
- frame ms
- -
Local planes live on the clipped material; the global plane is owned by the renderer and applies to every draw.
renderer.localClippingEnabledenable material planesmaterial.clippingPlanesobject-local world planesrenderer.clippingPlanesglobal plane setclipIntersection / clipShadowsboolean material policystencilWrite + renderOrdersolid cap compositionThe cap is not a second solid. It is a stencil pass: back faces increment, front faces decrement, and a material plane is rendered where the stencil is non-zero.
Toggle one policy at a time and watch the silhouette, shadow, and cap respond independently.
Derived from the official clipping planes and clipping stencil examples and the current Material / WebGLRenderer docs.