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

Function Lights_sample

tutorials/pathtracer/pathtracer_device.cpp:50–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48////////////////////////////////////////////////////////////////////////////////
49
50Light_SampleRes Lights_sample(const Light* self,
51 const DifferentialGeometry& dg, /*! point to generate the sample for >*/
52 const Vec2f s) /*! random numbers to generate the sample >*/
53{
54 TutorialLightType ty = self->type;
55 switch (ty) {
56 case LIGHT_AMBIENT : return AmbientLight_sample(self,dg,s);
57 case LIGHT_POINT : return PointLight_sample(self,dg,s);
58 case LIGHT_DIRECTIONAL: return DirectionalLight_sample(self,dg,s);
59 case LIGHT_SPOT : return SpotLight_sample(self,dg,s);
60 case LIGHT_QUAD : return QuadLight_sample(self,dg,s);
61 default: {
62 Light_SampleRes res;
63 res.weight = Vec3fa(0,0,0);
64 res.dir = Vec3fa(0,0,0);
65 res.dist = 0;
66 res.pdf = inf;
67 return res;
68 }
69 }
70}
71
72Light_EvalRes Lights_eval(const Light* self,
73 const DifferentialGeometry& dg,

Callers 1

renderPixelFunctionFunction · 0.85

Calls 1

Vec3faClass · 0.50

Tested by

no test coverage detected