MCPcopy Create free account
hub / github.com/TheRealMJP/BakingLab / SampleAreaLight

Function SampleAreaLight

BakingLab/PathTracer.cpp:165–174  ·  view source on GitHub ↗

Calculates diffuse and specular contribution from the area light, given a 2D random sample point representing a location on the surface of the light

Source from the content-addressed store, hash-verified

163// Calculates diffuse and specular contribution from the area light, given a 2D random sample point
164// representing a location on the surface of the light
165Float3 SampleAreaLight(const Float3& position, const Float3& normal, RTCScene scene,
166 const Float3& diffuseAlbedo, const Float3& cameraPos,
167 bool includeSpecular, Float3 specAlbedo, float roughness,
168 float u1, float u2, Float3& irradiance)
169{
170 Float3 lightPos = Float3(AppSettings::AreaLightX, AppSettings::AreaLightY, AppSettings::AreaLightZ);
171 return SampleSphericalAreaLight(position, normal, scene, diffuseAlbedo, cameraPos, includeSpecular,
172 specAlbedo, roughness, u1, u2, AppSettings::AreaLightSize,
173 lightPos, AppSettings::AreaLightColor.Value() * FP16Scale, irradiance);
174}
175
176// Checks to see if a ray intersects with the area light
177static float AreaLightIntersection(const Float3& rayStart, const Float3& rayDir, float tStart, float tEnd)

Callers 2

PathTraceFunction · 0.85
BakeDriverFunction · 0.85

Calls 3

Float3Class · 0.85
SampleSphericalAreaLightFunction · 0.85
ValueMethod · 0.80

Tested by

no test coverage detected