Transparent materials render during skybox pass instead of deferred #42

Closed
opened 2026-03-19 15:23:06 +00:00 by kit · 1 comment
Owner

Problem

Transparent materials (e.g. models/effects/vol_light001, Refract materials with $refracttinttexture) render during the skybox render pass and show only the skybox behind them. They should be deferred to a final transparent object render pass after all opaque world geometry has been drawn, so they composite correctly over the scene.

Current behavior

The multi-pass rendering order is:

  1. 2D skybox (layer 1)
  2. 3D skybox (layer 0, sky camera)
  3. Clear depth
  4. Main world + entities (layer 0)

Transparent materials on entities and BSP surfaces render during pass 4 but don't see geometry behind them correctly — they appear to only show the skybox.

Expected behavior

Transparent objects should be sorted back-to-front and rendered after all opaque geometry, so they blend over the correct background.

  • #8 — VMT shader types (Refract transparency)
## Problem Transparent materials (e.g. `models/effects/vol_light001`, Refract materials with `$refracttinttexture`) render during the skybox render pass and show only the skybox behind them. They should be deferred to a final transparent object render pass after all opaque world geometry has been drawn, so they composite correctly over the scene. ## Current behavior The multi-pass rendering order is: 1. 2D skybox (layer 1) 2. 3D skybox (layer 0, sky camera) 3. Clear depth 4. Main world + entities (layer 0) Transparent materials on entities and BSP surfaces render during pass 4 but don't see geometry behind them correctly — they appear to only show the skybox. ## Expected behavior Transparent objects should be sorted back-to-front and rendered after all opaque geometry, so they blend over the correct background. ## Related - #8 — VMT shader types (Refract transparency)
Author
Owner

Fixed in a27c9ef. Transparent materials now render on layer 2 in a separate pass after all opaque geometry:

  1. BSP meshes assigned to layer 2 when material.transparent is true (after VMT resolution)
  2. Entity meshes assigned to layer 2 when entity color alpha < 1
  3. Render loop adds pass 5: camera.layers.set(2) after the opaque world pass

This ensures transparent surfaces composite against the full scene depth buffer instead of just the skybox.

Fixed in `a27c9ef`. Transparent materials now render on layer 2 in a separate pass after all opaque geometry: 1. BSP meshes assigned to layer 2 when `material.transparent` is true (after VMT resolution) 2. Entity meshes assigned to layer 2 when entity color alpha < 1 3. Render loop adds pass 5: `camera.layers.set(2)` after the opaque world pass This ensures transparent surfaces composite against the full scene depth buffer instead of just the skybox.
kit closed this issue 2026-03-20 05:38:34 +00:00
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kit/gmod-web-stream#42
No description provided.