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

Function CosineWeightedMonteCarloFactor

BakingLab/MeshBaker.cpp:44–50  ·  view source on GitHub ↗

Returns the final monte-carlo weighting factor using the PDF of a cosine-weighted hemisphere

Source from the content-addressed store, hash-verified

42
43// Returns the final monte-carlo weighting factor using the PDF of a cosine-weighted hemisphere
44static float CosineWeightedMonteCarloFactor(uint64 numSamples)
45{
46 // Integrating cosine factor about the hemisphere gives you Pi, and the PDF
47 // of a cosine-weighted hemisphere function is 1 / Pi.
48 // So the final monte-carlo weighting factor is 1 / NumSamples
49 return (1.0f / numSamples);
50}
51
52static float HemisphereMonteCarloFactor(uint64 numSamples)
53{

Callers 2

FinalResultMethod · 0.85
ProgressiveResultMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected