Commit 27eeb6a
committed
WebGPURenderer: Optimize VSM shadow code
Port optimizations from PR #32181 to the WebGPU renderer:
- Extract mean variable for clarity
- Add early return optimization for fully lit pixels
- Improve variable naming (d, p_max)
- Correct variance epsilon from 0 to 0.0000001
- Pre-compute constant (0.65 instead of 0.95 - 0.3)
- Remove redundant outer clamp
- Add clarifying comments
These changes improve performance by reducing operations per pixel
while maintaining identical visual output.1 parent a8418f3 commit 27eeb6a
1 file changed
+17
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
188 | | - | |
189 | | - | |
190 | 188 | | |
191 | 189 | | |
192 | 190 | | |
| |||
197 | 195 | | |
198 | 196 | | |
199 | 197 | | |
200 | | - | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
201 | 202 | | |
202 | | - | |
| 203 | + | |
| 204 | + | |
203 | 205 | | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
| 206 | + | |
209 | 207 | | |
210 | 208 | | |
211 | 209 | | |
212 | | - | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
213 | 220 | | |
214 | 221 | | |
215 | 222 | | |
| |||
0 commit comments