MCPcopy Create free account
hub / github.com/TheRealMJP/BakingLab / ProgressiveResult

Method ProgressiveResult

BakingLab/MeshBaker.cpp:280–294  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

BakeDriverFunction · 0.45

Calls 6

ConvertToH4Function · 0.85
ClampFunction · 0.85
To3DMethod · 0.80
Float4Class · 0.50

Tested by

no test coverage detected