You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Shadow map is bound to texture slot 3: the roughness slot: on both DX11 and OpenGL #145
But every shader declares the shadow map at 11/12, not 3:
default_shader.hlsl:101: Texture2D roughnessTexture : register(t3); shadow map is t11/s1/s2 at :216-218
default_shader_gl.frag:89: roughnessTexture at binding 3; shadow bindings 11/12 at :170-171
And TEXTURE_SLOT_ROUGHNESS is 3 (Material.hpp:18), bound per draw at Material.cpp:37/:113.
Two consequences, both live:
Nothing ever binds t11/t12 on either backend, yet ShadowMapEnabled is set to 1
(DirectX11Renderer.cpp:1225, OpenGLRenderer.cpp:679): so CalcShadow runs against an unbound
resource. Shadows are broken on DX11 and GL forward.
Slot 3 is fought over per draw. A material with no roughness map samples the shadow depth texture as
PBR roughness: wrong shading, varying with the light's view.
Corroborating evidence this is a known-but-unfixed issue: the GL renderer already carries a workaround
comment plus an unbind for exactly this collision at OpenGLRenderer.cpp:1005-1009: but it only covers the
GBuffer pass, not the forward pass.
Severity: corruption (wrong texture sampled as a material parameter) + visual (no shadows).
Found by a full audit of the graphics layer. Assessed severity: corruption + visual.
Activity