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

  1. Clip Distances

    WebGPU exposes user-defined clip distances for vertex shaders. Enables custom clipping planes without compositor tricks.

  2. CAD section plane

    The motivating CAD use case: section-plane cutaway through a rotating model โ€” drag offset and angle.

  3. Feature + adapter limits

    Enumerate the optional features your adapter actually exposes. Try requesting a device with clip-distances enabled.

  4. WGSL clip_distances explorer

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

references