Legacy (Blinn-Phong) specular is barely visible compared with Firestorm and other viewers #470
Labels
No labels
amd
avatars
bug
builder
cannot-reproduce
crash
epic
feature
from-viewer
gl-removal
known-limitation
monitoring
parity
perf
platform
priority
critical
priority
high
priority
low
priority
medium
provenance
rendering
rt
status
in-progress
status
testing
status
up-next
triage
ui
upstream
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
sky_line/Slipstream#470
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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, theSURF_LEGACYbranch, around lines 269–386. The sun term is an analytic port of LL'slightFuncLUT (n = gloss² × 368, plus fresnel and a geometry term). Suspects, roughly in order:Local lights add no legacy specular.
clean_light_eval.glslhas no specular term for legacy faces, while LL'smultiPointLight/pointLightFadd Blinn-Phong spec from point and spot lights. Indoor and night scenes would then lose almost all highlights.Gloss input scale.
gloss= "specular exponent × normal-map alpha". Check that it matches LL's packing:A double
/255or a missing default gives n ≈ 0, which makes a broad, very dim lobe.Specular colour linearisation. Check that
spec_linisn't converted from sRGB twice, or scaled by the base colour (color *= base_linruns before the spec adds — check the order against LL'ssoftenLightF).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.
The env and gloss-env terms (
ge * 0.5, then* 0.5again) — compare the constants against LL'sapplyGlossEnv/applyLegacyEnv.The deferred path:
clean_deferred_light.compreads 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.