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

Function UniformSampleSphere

src/luxrays/utils/mc.cpp:83–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81}
82
83Vector UniformSampleSphere(const float u1, const float u2) {
84 const float z = 1.f - 2.f * u1;
85 const float r = sqrtf(Max(0.f, 1.f - z * z));
86 const float phi = 2.f * M_PI * u2;
87 const float x = r * cosf(phi);
88 const float y = r * sinf(phi);
89 return Vector(x, y, z);
90}
91
92float UniformSpherePdf() {
93 return 1.f / (4.f * M_PI);

Callers 8

PreprocessMethod · 0.85
GetPowerMethod · 0.85
UpdateVisibilityMapMethod · 0.85
EmitMethod · 0.85
EmitMethod · 0.85
IlluminateMethod · 0.85
EmitMethod · 0.85
BuildCacheEntryMethod · 0.85

Calls 2

MaxFunction · 0.85
VectorClass · 0.50

Tested by

no test coverage detected