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

Method Diffuse

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

Source from the content-addressed store, hash-verified

101template <int trans>
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;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected