Legacy (Blinn-Phong) specular is barely visible compared with Firestorm and other viewers #470

Closed
opened 2026-10-05 22:48:40 +00:00 by sky_line · 0 comments
Owner

Symptom: specular on legacy Blinn-Phong materials (a specular map, glossiness and environment settings on non-PBR faces) is barely visible in Slipstream. In Firestorm and other viewers, the same objects show clear highlights and shine. Applies to user-made content using legacy materials: shiny metal, wet surfaces, skins and clothing with specular maps.

To reproduce: pick an object with a legacy specular map and high glossiness, for example a full-bright-off metal panel with spec colour white, glossiness 51+ and environment 0. Look at it in sunlight from a few angles in Slipstream and in Firestorm at the same time of day (same environment settings). Compare a screenshot from each.

Where to look

The legacy path is indra/vkclean/shaders/clean_surface_light.glsl, the SURF_LEGACY branch, around lines 269–386. The sun term is an analytic port of LL's lightFunc LUT (n = gloss² × 368, plus fresnel and a geometry term). Suspects, roughly in order:

  1. Local lights add no legacy specular. clean_light_eval.glsl has no specular term for legacy faces, while LL's multiPointLight / pointLightF add Blinn-Phong spec from point and spot lights. Indoor and night scenes would then lose almost all highlights.

  2. Gloss input scale. gloss = "specular exponent × normal-map alpha". Check that it matches LL's packing:

    • specular-map alpha × glossiness / 255;
    • the default when there is no normal map or the map has no alpha.

    A double /255 or a missing default gives n ≈ 0, which makes a broad, very dim lobe.

  3. Specular colour linearisation. Check that spec_lin isn't converted from sRGB twice, or scaled by the base colour (color *= base_lin runs before the spec adds — check the order against LL's softenLightF).

  4. Exposure and tonemap. Our exposure or tone mapping may compress highlights more than LL's. Compare the same face with tonemapping off, or with a debug view of the specular term only.

  5. The env and gloss-env terms (ge * 0.5, then * 0.5 again) — compare the constants against LL's applyGlossEnv / applyLegacyEnv.

  6. The deferred path: clean_deferred_light.comp reads legacy spec from G-buffer target G3 (emissive | legacy spec). Check its packing precision and that it matches the forward path.

Done when

A side-by-side with Firestorm or LL's viewer shows comparable legacy highlights from the sun and from local lights, with a debug view to verify the specular term on its own.

**Symptom:** specular on legacy Blinn-Phong materials (a specular map, glossiness and environment settings on non-PBR faces) is barely visible in Slipstream. In Firestorm and other viewers, the same objects show clear highlights and shine. Applies to user-made content using legacy materials: shiny metal, wet surfaces, skins and clothing with specular maps. **To reproduce:** pick an object with a legacy specular map and high glossiness, for example a full-bright-off metal panel with spec colour white, glossiness 51+ and environment 0. Look at it in sunlight from a few angles in Slipstream and in Firestorm at the same time of day (same environment settings). Compare a screenshot from each. ## Where to look The legacy path is `indra/vkclean/shaders/clean_surface_light.glsl`, the `SURF_LEGACY` branch, around lines 269–386. The sun term is an analytic port of LL's `lightFunc` LUT (n = gloss² × 368, plus fresnel and a geometry term). Suspects, roughly in order: 1. **Local lights add no legacy specular.** `clean_light_eval.glsl` has no specular term for legacy faces, while LL's `multiPointLight` / `pointLightF` add Blinn-Phong spec from point and spot lights. Indoor and night scenes would then lose almost all highlights. 2. **Gloss input scale.** `gloss` = "specular exponent × normal-map alpha". Check that it matches LL's packing: - specular-map alpha × glossiness / 255; - the default when there is no normal map or the map has no alpha. A double `/255` or a missing default gives n ≈ 0, which makes a broad, very dim lobe. 3. **Specular colour linearisation.** Check that `spec_lin` isn't converted from sRGB twice, or scaled by the base colour (`color *= base_lin` runs before the spec adds — check the order against LL's `softenLightF`). 4. **Exposure and tonemap.** Our exposure or tone mapping may compress highlights more than LL's. Compare the same face with tonemapping off, or with a debug view of the specular term only. 5. **The env and gloss-env terms** (`ge * 0.5`, then `* 0.5` again) — compare the constants against LL's `applyGlossEnv` / `applyLegacyEnv`. 6. **The deferred path:** `clean_deferred_light.comp` reads legacy spec from G-buffer target G3 (`emissive | legacy spec`). Check its packing precision and that it matches the forward path. ## Done when A side-by-side with Firestorm or LL's viewer shows comparable legacy highlights from the sun and from local lights, with a debug view to verify the specular term on its own.
sky_line added this to the Slipstream project 2026-10-06 15:04:14 +00:00
Sign in to join this conversation.
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
sky_line/Slipstream#470
No description provided.