MCPcopy Create free account
hub / github.com/LuxCoreRender/LuxCore / UniformSampleHemisphere

Function UniformSampleHemisphere

src/luxrays/utils/mc.cpp:70–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68}
69
70Vector UniformSampleHemisphere(const float u1, const float u2) {
71 const float z = u1;
72 const float r = sqrtf(Max(0.f, 1.f - z * z));
73 const float phi = 2.f * M_PI * u2;
74 const float x = r * cosf(phi);
75 const float y = r * sinf(phi);
76 return Vector(x, y, z);
77}
78
79float UniformHemispherePdf(float theta, float phi) {
80 return INV_TWOPI;

Callers 2

BuildCacheEntryMethod · 0.85
EvaluateTotalMethod · 0.85

Calls 2

MaxFunction · 0.85
VectorClass · 0.50

Tested by

no test coverage detected