glTF Transparency: Why Choose MASK Over BLEND

When authoring 3D assets in glTF, selecting the correct alpha mode directly determines an asset's visual fidelity and rendering performance across real-time engines. While BLEND mode allows for smooth semi-transparency, it frequently introduces severe depth-sorting bugs, breaks shadows, and degrades frame rates. In contrast, MASK mode evaluates transparency as a binary state based on a defined cutoff threshold, which writes cleanly to the depth buffer, eliminates visual sorting errors, and dramatically optimizes GPU efficiency. Unless an object strictly requires varying levels of translucency, 3D artists should consistently default to MASK for any cutout transparency.

The Mechanics: MASK vs. BLEND

The glTF specification defines three primary alpha modes: OPAQUE, MASK, and BLEND.

  • MASK (Alpha Test/Cutout): Pixels are either 100% visible or 100% transparent based on a scalar value called alphaCutoff. Because every pixel is either rendered fully or discarded entirely, the GPU treats visible pixels as opaque geometry.
  • BLEND (Alpha Blending): Pixels can possess partial opacity, allowing foreground and background colors to blend together. Because pixels need to read what is behind them, objects using BLEND generally disable depth writing to prevent invisible geometry from occluding background objects.

Eliminating Depth-Sorting Artifacts

The primary reason to prefer MASK is avoiding depth-sorting artifacts. Real-time rendering engines draw opaque objects first using the depth buffer (Z-buffer) to ensure objects closer to the camera correctly obscure objects behind them.

Because BLEND objects cannot reliably write to the depth buffer without causing clipping errors, the engine must sort transparent triangles from back to front relative to the camera before drawing them. This sorting process frequently fails with complex geometry:

  • Self-Sorting Errors: Intersecting surfaces or multi-layered meshes (such as foliage, hair cards, or chain-link fences) often render inside-out, with back surfaces displaying in front of forward surfaces.
  • Inter-Object Clipping: Adjacent semi-transparent assets regularly flicker or pop as camera angles change, since engines typically sort transparency per-mesh rather than per-triangle.

Because MASK mode writes directly to the depth buffer, the GPU resolves depth at the individual pixel level. Triangles render in the correct visual order regardless of camera orientation or mesh complexity.

Performance and Overdraw Reduction

Alpha blending incurs a significant performance penalty compared to alpha masking:

  • Depth Pre-Pass and Early-Z: Modern GPUs utilize an early depth test to discard hidden pixels before executing expensive fragment (pixel) shaders. MASK assets can take advantage of depth pre-passes, discarding occluded geometry early in the pipeline.
  • Overdraw Costs: In dense scenes, such as forests or character hair, BLEND forces the GPU to calculate shading for multiple overlapping transparent layers on a single screen pixel. This excessive overdraw strains mobile and web-based platforms running WebGL or WebGPU.
  • CPU Sorting Overhead: Dynamic sorting of transparent meshes back-to-front creates unnecessary CPU overhead on every frame.

Accurate Shadow Casting and Reception

Shadow mapping algorithms rely on rendering the scene from the light’s perspective into a depth texture:

  • MASK Assets: The depth pass respects the cutout shape, allowing objects like tree leaves or perforated metals to cast clean, accurate, hard-edged shadows into the scene.
  • BLEND Assets: Real-time engines typically do not compute partial shadows from blended materials due to memory and performance limitations. Consequently, objects set to BLEND either cast solid, opaque rectangular shadows from their polygon boundaries or fail to cast shadows entirely.

Engine and Deferred Rendering Compatibility

Most modern high-fidelity rendering engines (including Unreal Engine, Unity, and three.js pipelines) employ deferred rendering or hybrid forward/deferred shading. Deferred renderers record geometric properties (normals, roughness, base color) into a series of screen-space buffers (G-buffers) before calculating lighting.

Because G-buffers store only one layer of surface data per pixel, semi-transparent materials cannot be rendered natively in the deferred pass and must be delayed to an expensive forward pass. MASK materials integrate cleanly into deferred G-buffers, ensuring they receive the full suite of scene lighting, screen-space ambient occlusion (SSAO), and post-processing effects without extra draw calls.

When BLEND Is Actually Necessary

BLEND should be reserved strictly for materials where true partial transparency is physical and unavoidable:

  • Stained or tinted glass
  • Smoke, fire, and particle effects
  • Water surfaces and liquids
  • Thin plastic or sheer fabric (such as pantyhose or light curtains)
  • Holograms and UI overlays

For hair, eyelashes, foliage, cloth cutouts, chains, decals, and grates, always author the glTF using MASK mode with a calibrated alphaCutoff (typically defaulting to 0.5) to ensure optimal visual stability and universal performance.