Commit 12e6fd2
committed
Fix deferred lighting one-frame stale InvViewProj shadow flicker
SceneBase::Update called m_lightManager->UpdateAndBind() before object
updates. LightManager::UpdateDeferredCB builds InvViewProj from the
static Camera matrices, but the Camera object's Update() (which
refreshes those matrices) ran afterward, so the deferred CB was one
frame stale. The lighting pass reconstructed world positions from this
stale InvViewProj while the depth buffer had been written with the
fresh matrices, producing a coherent world-space shear on any camera
rotation. That shear projected every visible fragment into the wrong
shadow-map texels simultaneously, causing full-terrain shadow flashes
on vertical mouselook, jumping, and fast movement.
Fix: update objects first so Camera::View/Projection reflect the
current frame, then call UpdateAndBind so the deferred CB, shadow UBO,
and geometry/lighting passes all see the same matrices.1 parent 741027f commit 12e6fd2
1 file changed
Lines changed: 10 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
139 | | - | |
140 | | - | |
141 | | - | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
142 | 146 | | |
143 | 147 | | |
144 | 148 | | |
145 | 149 | | |
146 | 150 | | |
147 | 151 | | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
148 | 155 | | |
149 | 156 | | |
150 | 157 | | |
| |||
0 commit comments