MCPcopy Create free account
hub / github.com/RenderKit/embree / powerCosineSampleHemisphere

Function powerCosineSampleHemisphere

tutorials/common/math/sampling.h:83–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81////////////////////////////////////////////////////////////////////////////////
82
83inline Vec3fa powerCosineSampleHemisphere(const float n, const Vec2f &s)
84{
85 const float phi =float(two_pi) * s.x;
86 const float cosTheta = pow(s.y, 1.0f / (n + 1.0f));
87 return cartesian(phi, cosTheta);
88}
89
90inline float powerCosineSampleHemispherePDF(const float cosTheta, const float n) // TODO: order of arguments
91{

Callers 2

OBJMaterial__sampleFunction · 0.85
sampleFunction · 0.85

Calls 2

cartesianFunction · 0.85
powFunction · 0.50

Tested by

no test coverage detected