v131 ยท graphics
WebGPU: Clip Distances
Adds the optional GPU feature "clip-distances" that allows setting user-defined clip distances in vertex shader outputs. This technique is particularly useful for the applications that need to clip all vertices in a scene that are beyond a user-defined plane, such as many CAD applications.
concepts
-
Clip Distances
WebGPU exposes user-defined clip distances for vertex shaders. Enables custom clipping planes without compositor tricks.
-
CAD section plane
The motivating CAD use case: section-plane cutaway through a rotating model โ drag offset and angle.
-
Feature + adapter limits
Enumerate the optional features your adapter actually exposes. Try requesting a device with clip-distances enabled.
-
WGSL
clip_distancesexplorerThe shader code on one side, a live preview of the half-space clip on the other. Drag the plane normal and offset.
why it shipped
Adds the optional GPU feature "clip-distances" that allows setting user-defined clip distances in vertex shader outputs. This technique is particularly useful for the applications that need to clip all vertices in a scene that are beyond a user-defined plane, such as many CAD applications.