forked from bartvdbraak/blender
Fix non-progressive lamps with multiple samples not giving correct intensity after
recent fix.
This commit is contained in:
parent
dd83387e0b
commit
7ecc9cfdf4
@ -220,7 +220,7 @@ __device_inline void path_radiance_accum_ao(PathRadiance *L, float3 throughput,
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
__device_inline void path_radiance_accum_light(PathRadiance *L, float3 throughput, BsdfEval *bsdf_eval, float3 shadow, int bounce, bool is_lamp)
|
__device_inline void path_radiance_accum_light(PathRadiance *L, float3 throughput, BsdfEval *bsdf_eval, float3 shadow, float shadow_fac, int bounce, bool is_lamp)
|
||||||
{
|
{
|
||||||
#ifdef __PASSES__
|
#ifdef __PASSES__
|
||||||
if(L->use_light_pass) {
|
if(L->use_light_pass) {
|
||||||
@ -233,9 +233,9 @@ __device_inline void path_radiance_accum_light(PathRadiance *L, float3 throughpu
|
|||||||
if(is_lamp) {
|
if(is_lamp) {
|
||||||
float3 sum = throughput*(bsdf_eval->diffuse + bsdf_eval->glossy + bsdf_eval->transmission);
|
float3 sum = throughput*(bsdf_eval->diffuse + bsdf_eval->glossy + bsdf_eval->transmission);
|
||||||
|
|
||||||
L->shadow.x += shadow.x;
|
L->shadow.x += shadow.x*shadow_fac;
|
||||||
L->shadow.y += shadow.y;
|
L->shadow.y += shadow.y*shadow_fac;
|
||||||
L->shadow.z += shadow.z;
|
L->shadow.z += shadow.z*shadow_fac;
|
||||||
L->shadow.w += average(sum);
|
L->shadow.w += average(sum);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -411,7 +411,7 @@ __device float4 kernel_path_progressive(KernelGlobals *kg, RNG *rng, int sample,
|
|||||||
|
|
||||||
if(!shadow_blocked(kg, &state, &light_ray, &shadow)) {
|
if(!shadow_blocked(kg, &state, &light_ray, &shadow)) {
|
||||||
/* accumulate */
|
/* accumulate */
|
||||||
path_radiance_accum_light(&L, throughput, &L_light, shadow, state.bounce, is_lamp);
|
path_radiance_accum_light(&L, throughput, &L_light, shadow, 1.0f, state.bounce, is_lamp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -624,7 +624,7 @@ __device void kernel_path_indirect(KernelGlobals *kg, RNG *rng, int sample, Ray
|
|||||||
|
|
||||||
if(!shadow_blocked(kg, &state, &light_ray, &shadow)) {
|
if(!shadow_blocked(kg, &state, &light_ray, &shadow)) {
|
||||||
/* accumulate */
|
/* accumulate */
|
||||||
path_radiance_accum_light(L, throughput, &L_light, shadow, state.bounce, is_lamp);
|
path_radiance_accum_light(L, throughput, &L_light, shadow, 1.0f, state.bounce, is_lamp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -841,7 +841,7 @@ __device float4 kernel_path_non_progressive(KernelGlobals *kg, RNG *rng, int sam
|
|||||||
|
|
||||||
if(!shadow_blocked(kg, &state, &light_ray, &shadow)) {
|
if(!shadow_blocked(kg, &state, &light_ray, &shadow)) {
|
||||||
/* accumulate */
|
/* accumulate */
|
||||||
path_radiance_accum_light(&L, throughput*num_samples_inv, &L_light, shadow*num_samples_inv, state.bounce, is_lamp);
|
path_radiance_accum_light(&L, throughput*num_samples_inv, &L_light, shadow, num_samples_inv, state.bounce, is_lamp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -870,7 +870,7 @@ __device float4 kernel_path_non_progressive(KernelGlobals *kg, RNG *rng, int sam
|
|||||||
|
|
||||||
if(!shadow_blocked(kg, &state, &light_ray, &shadow)) {
|
if(!shadow_blocked(kg, &state, &light_ray, &shadow)) {
|
||||||
/* accumulate */
|
/* accumulate */
|
||||||
path_radiance_accum_light(&L, throughput*num_samples_inv, &L_light, shadow*num_samples_inv, state.bounce, is_lamp);
|
path_radiance_accum_light(&L, throughput*num_samples_inv, &L_light, shadow, num_samples_inv, state.bounce, is_lamp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user