Returns the final monte-carlo weighting factor using the PDF of a cosine-weighted hemisphere
| 42 | |
| 43 | // Returns the final monte-carlo weighting factor using the PDF of a cosine-weighted hemisphere |
| 44 | static 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 | |
| 52 | static float HemisphereMonteCarloFactor(uint64 numSamples) |
| 53 | { |
no outgoing calls
no test coverage detected