Fix Cycles AO pass not working for shadow catcher objects.
This commit is contained in:
@@ -320,7 +320,13 @@ ccl_device_inline void path_radiance_accum_ao(PathRadiance *L,
|
|||||||
float3 bsdf,
|
float3 bsdf,
|
||||||
float3 ao)
|
float3 ao)
|
||||||
{
|
{
|
||||||
|
/* Store AO pass. */
|
||||||
|
if(L->use_light_pass && state->bounce == 0) {
|
||||||
|
L->ao += alpha*throughput*ao;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef __SHADOW_TRICKS__
|
#ifdef __SHADOW_TRICKS__
|
||||||
|
/* For shadow catcher, accumulate ratio. */
|
||||||
if(state->flag & PATH_RAY_STORE_SHADOW_INFO) {
|
if(state->flag & PATH_RAY_STORE_SHADOW_INFO) {
|
||||||
float3 light = throughput * bsdf;
|
float3 light = throughput * bsdf;
|
||||||
L->path_total += light;
|
L->path_total += light;
|
||||||
@@ -335,12 +341,11 @@ ccl_device_inline void path_radiance_accum_ao(PathRadiance *L,
|
|||||||
#ifdef __PASSES__
|
#ifdef __PASSES__
|
||||||
if(L->use_light_pass) {
|
if(L->use_light_pass) {
|
||||||
if(state->bounce == 0) {
|
if(state->bounce == 0) {
|
||||||
/* directly visible lighting */
|
/* Directly visible lighting. */
|
||||||
L->direct_diffuse += throughput*bsdf*ao;
|
L->direct_diffuse += throughput*bsdf*ao;
|
||||||
L->ao += alpha*throughput*ao;
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* indirectly visible lighting after BSDF bounce */
|
/* Indirectly visible lighting after BSDF bounce. */
|
||||||
L->indirect += throughput*bsdf*ao;
|
L->indirect += throughput*bsdf*ao;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user