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

Function MetalMaterial__sample

tutorials/pathtracer/pathtracer_device.cpp:661–669  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

659}
660
661Vec3fa MetalMaterial__sample(ISPCMetalMaterial* This, const BRDF& brdf, const Vec3fa& Lw, const Vec3fa& wo, const DifferentialGeometry& dg, Sample3f& wi_o, Medium& medium, const Vec2f& s)
662{
663 const PowerCosineDistribution distribution = make_PowerCosineDistribution(rcp(This->roughness));
664
665 if (dot(wo,dg.Ns) <= 0.0f) { wi_o = make_Sample3f(Vec3fa(0.0f),0.0f); return Vec3fa(0.f); }
666 sample(distribution,wo,dg.Ns,wi_o,s);
667 if (dot(wi_o.v,dg.Ns) <= 0.0f) { wi_o = make_Sample3f(Vec3fa(0.0f),0.0f); return Vec3fa(0.f); }
668 return MetalMaterial__eval(This,brdf,wo,dg,wi_o.v);
669}
670
671////////////////////////////////////////////////////////////////////////////////
672// ReflectiveMetal Material //

Callers 1

Material__sampleFunction · 0.85

Calls 7

make_Sample3fFunction · 0.85
sampleFunction · 0.85
MetalMaterial__evalFunction · 0.85
rcpFunction · 0.50
dotFunction · 0.50
Vec3faClass · 0.50

Tested by

no test coverage detected