Code refactor: remove emission and background closures, sum directly.
This commit is contained in:
@@ -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(). */
|
||||
|
Reference in New Issue
Block a user