GLSL Fractional Odd Spacing Visual Transitions

This article provides an overview of the visual transitions that occur when using the fractional_odd_spacing layout qualifier in GLSL tessellation shaders. It explains how dynamic tessellation levels smoothly interpolate geometry, how new vertices emerge without popping artifacts, and how the rendered mesh behaves visually across continuous Level of Detail (LOD) changes.

The Problem of Geometry Popping

In dynamic level-of-detail systems, tessellation factors change continuously based on camera distance or screen-space metrics. When using standard equal_spacing, the tessellation level is rounded to the nearest whole integer. This causes abrupt visual "pops" where entire rows or loops of triangles suddenly appear or disappear in a single frame.

Continuous Segment Scaling

The fractional_odd_spacing qualifier eliminates popping by enabling smooth, continuous transitions between odd numbers of segments (\(1, 3, 5, 7, \dots\)).

When a tessellation factor is non-integer:

  1. The hardware rounds the factor up to the nearest odd integer, \(n\).
  2. The edge is divided into \(n\) segments.
  3. The \(n - 2\) inner segments share an equal, fixed relative length.
  4. The remaining two segments (located at the boundaries of the edge) start with a length of zero when the tessellation factor is at \(n - 2\).
  5. As the factor increases continuously toward \(n\), these two boundary segments smoothly expand from zero length until they match the length of all other segments.

Visual Manifestation During Camera Movement

As an observer moves closer to an object using fractional_odd_spacing, the mesh transitions through distinct visual phases:

  • Zero-Length Introduction: New vertices emerge directly on top of existing corner vertices rather than suddenly appearing in the middle of an edge. Because these new triangles initially have an area of zero, they are completely invisible.
  • Smooth Expansion: As the distance decreases and the tessellation level rises, the zero-area triangles gradually widen. Vertices migrate smoothly along the edge toward their final positions. Visually, this appears as a seamless morphing or stretching of surface detail rather than an instantaneous swap of meshes.
  • Symmetry Preservation: Because the fractional segments expand symmetrically at both ends of an edge, the mesh maintains structural balance without visibly sliding to one side.
  • Preservation of the Base Mesh: Unlike fractional_even_spacing (which clamps to a minimum of 2 segments), fractional_odd_spacing supports a tessellation level of 1.0. At the lowest level of detail, edges consist of a single segment, allowing the mesh to revert exactly to its original, un-tessellated base state without unnecessary subdivisions.

By continuously growing new triangles from zero area at the mesh boundaries, fractional_odd_spacing creates a fluid visual transition where geometric density adapts imperceptibly across varying view distances.