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

Function uniformSampleCone

tutorials/common/math/sampling.h:103–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101////////////////////////////////////////////////////////////////////////////////
102
103inline Vec3fa uniformSampleCone(const float cosAngle, const Vec2f &s)
104{
105 const float phi =float(two_pi) * s.x;
106 const float cosTheta = 1.0f - s.y * (1.0f - cosAngle);
107 return cartesian(phi, cosTheta);
108}
109
110inline float uniformSampleConePDF(const float cosAngle)
111{

Calls 1

cartesianFunction · 0.85

Tested by

no test coverage detected