| 278 | } |
| 279 | |
| 280 | void ProgressiveResult(Float4 bakeOutput[BasisCount], uint64 passIdx) |
| 281 | { |
| 282 | SH9Color shResult = ResultSum; |
| 283 | shResult.ConvolveWithCosineKernel(); |
| 284 | H4Color result = ConvertToH4(shResult) * HemisphereMonteCarloFactor(1); |
| 285 | |
| 286 | const float lerpFactor = passIdx / (passIdx + 1.0f); |
| 287 | for(uint64 i = 0; i < BasisCount; ++i) |
| 288 | { |
| 289 | Float3 newSample = result.Coefficients[i]; |
| 290 | Float3 currValue = bakeOutput[i].To3D(); |
| 291 | currValue = Lerp<Float3>(newSample, currValue, lerpFactor); |
| 292 | bakeOutput[i] = Float4(Float3::Clamp(currValue, -FP16Max, FP16Max), 1.0f); |
| 293 | } |
| 294 | } |
| 295 | }; |
| 296 | |
| 297 | // Bakes irradiance projected onto L2 H-basis, with 18 floats per texel |
no test coverage detected