Code refactor: remove emission and background closures, sum directly.

This commit is contained in:
Brecht Van Lommel
2017-11-01 19:00:42 +01:00
parent cac3d4d166
commit 2c02a04c46
13 changed files with 72 additions and 63 deletions

View File

@@ -32,8 +32,32 @@
CCL_NAMESPACE_BEGIN
/* BACKGROUND CLOSURE */
ccl_device void background_setup(ShaderData *sd, const float3 weight)
{
if(sd->flag & SD_EMISSION) {
sd->closure_emission_background += weight;
}
else {
sd->flag |= SD_EMISSION;
sd->closure_emission_background = weight;
}
}
/* EMISSION CLOSURE */
ccl_device void emission_setup(ShaderData *sd, const float3 weight)
{
if(sd->flag & SD_EMISSION) {
sd->closure_emission_background += weight;
}
else {
sd->flag |= SD_EMISSION;
sd->closure_emission_background = weight;
}
}
/* return the probability distribution function in the direction I,
* given the parameters and the light's surface normal. This MUST match
* the PDF computed by sample(). */