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

Function AnisotropicBlinn__eval

tutorials/pathtracer/pathtracer_device.cpp:427–436  ·  view source on GitHub ↗

! Evaluates the power cosine distribution. \param wh is the half * vector */

Source from the content-addressed store, hash-verified

425/*! Evaluates the power cosine distribution. \param wh is the half
426 * vector */
427inline float AnisotropicBlinn__eval(const AnisotropicBlinn* This, const Vec3fa& wh)
428{
429 const float cosPhiH = dot(wh, This->dx);
430 const float sinPhiH = dot(wh, This->dy);
431 const float cosThetaH = dot(wh, This->dz);
432 const float R = sqr(cosPhiH)+sqr(sinPhiH);
433 if (R == 0.0f) return This->norm2;
434 const float n = (This->nx*sqr(cosPhiH)+This->ny*sqr(sinPhiH))*rcp(R);
435 return This->norm2 * powf(abs(cosThetaH), n);
436}
437
438/*! Samples the distribution. \param s is the sample location
439 * provided by the caller. */

Callers 2

AnisotropicBlinn__sampleFunction · 0.70
HairMaterial__evalFunction · 0.70

Calls 6

reflectFunction · 0.85
dotFunction · 0.50
sqrFunction · 0.50
rcpFunction · 0.50
absFunction · 0.50
normalizeFunction · 0.50

Tested by

no test coverage detected