MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/OpenShadingLanguage / eval

Method eval

src/testrender/shading.cpp:104–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102struct Diffuse : public BSDF, DiffuseParams {
103 Diffuse(const DiffuseParams& params) : BSDF(), DiffuseParams(params) { if (trans) N = -N; }
104 virtual float eval (const OSL::ShaderGlobals& sg, const OSL::Vec3& wi, float& pdf) const {
105 pdf = std::max(N.dot(wi), 0.0f) * float(M_1_PI);
106 return 1.0f;
107 }
108 virtual float sample(const OSL::ShaderGlobals& sg, float rx, float ry, float rz, OSL::Dual2<OSL::Vec3>& wi, float& pdf) const {
109 Vec3 out_dir;
110 Sampling::sample_cosine_hemisphere(N, rx, ry, out_dir, pdf);

Callers

nothing calls this directly

Calls 1

maxFunction · 0.50

Tested by

no test coverage detected