Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brecht@blender.org>2021-11-09 15:04:37 +0300
committerBrecht Van Lommel <brecht@blender.org>2021-11-09 15:13:56 +0300
commit6c24cafecc9e8353781080ebdc81ae67f9292d3b (patch)
treeea43a296e3a12a5e59e7dd059c9fcc2eb86c9ff8
parentcb487b650772cf50e63965f31cd40010cfab4bec (diff)
Fix T92876: Cycles incorrect volume emission + absorption handling
-rw-r--r--intern/cycles/kernel/film/accumulate.h3
-rw-r--r--intern/cycles/kernel/integrator/shade_background.h2
-rw-r--r--intern/cycles/kernel/integrator/shade_light.h2
-rw-r--r--intern/cycles/kernel/integrator/shade_surface.h2
-rw-r--r--intern/cycles/kernel/integrator/shade_volume.h4
5 files changed, 6 insertions, 7 deletions
diff --git a/intern/cycles/kernel/film/accumulate.h b/intern/cycles/kernel/film/accumulate.h
index 30e1afea751..33f913a6746 100644
--- a/intern/cycles/kernel/film/accumulate.h
+++ b/intern/cycles/kernel/film/accumulate.h
@@ -540,11 +540,10 @@ ccl_device_inline void kernel_accum_background(KernelGlobals kg,
/* Write emission to render buffer. */
ccl_device_inline void kernel_accum_emission(KernelGlobals kg,
ConstIntegratorState state,
- const float3 throughput,
const float3 L,
ccl_global float *ccl_restrict render_buffer)
{
- float3 contribution = throughput * L;
+ float3 contribution = L;
kernel_accum_clamp(kg, &contribution, INTEGRATOR_STATE(state, path, bounce) - 1);
ccl_global float *buffer = kernel_accum_pixel_render_buffer(kg, state, render_buffer);
diff --git a/intern/cycles/kernel/integrator/shade_background.h b/intern/cycles/kernel/integrator/shade_background.h
index 24482e85b05..31452de1ca4 100644
--- a/intern/cycles/kernel/integrator/shade_background.h
+++ b/intern/cycles/kernel/integrator/shade_background.h
@@ -175,7 +175,7 @@ ccl_device_inline void integrate_distant_lights(KernelGlobals kg,
/* Write to render buffer. */
const float3 throughput = INTEGRATOR_STATE(state, path, throughput);
- kernel_accum_emission(kg, state, throughput, light_eval, render_buffer);
+ kernel_accum_emission(kg, state, throughput * light_eval, render_buffer);
}
}
}
diff --git a/intern/cycles/kernel/integrator/shade_light.h b/intern/cycles/kernel/integrator/shade_light.h
index 7dad3b4e49d..5abe9e98abc 100644
--- a/intern/cycles/kernel/integrator/shade_light.h
+++ b/intern/cycles/kernel/integrator/shade_light.h
@@ -90,7 +90,7 @@ ccl_device_inline void integrate_light(KernelGlobals kg,
/* Write to render buffer. */
const float3 throughput = INTEGRATOR_STATE(state, path, throughput);
- kernel_accum_emission(kg, state, throughput, light_eval, render_buffer);
+ kernel_accum_emission(kg, state, throughput * light_eval, render_buffer);
}
ccl_device void integrator_shade_light(KernelGlobals kg,
diff --git a/intern/cycles/kernel/integrator/shade_surface.h b/intern/cycles/kernel/integrator/shade_surface.h
index d9006e71ce0..e6fe5a87120 100644
--- a/intern/cycles/kernel/integrator/shade_surface.h
+++ b/intern/cycles/kernel/integrator/shade_surface.h
@@ -101,7 +101,7 @@ ccl_device_forceinline void integrate_surface_emission(KernelGlobals kg,
}
const float3 throughput = INTEGRATOR_STATE(state, path, throughput);
- kernel_accum_emission(kg, state, throughput, L, render_buffer);
+ kernel_accum_emission(kg, state, throughput * L, render_buffer);
}
#endif /* __EMISSION__ */
diff --git a/intern/cycles/kernel/integrator/shade_volume.h b/intern/cycles/kernel/integrator/shade_volume.h
index 412be289ebe..86d712cdf32 100644
--- a/intern/cycles/kernel/integrator/shade_volume.h
+++ b/intern/cycles/kernel/integrator/shade_volume.h
@@ -608,7 +608,7 @@ ccl_device_forceinline void volume_integrate_heterogeneous(
if (!result.indirect_scatter) {
const float3 emission = volume_emission_integrate(
&coeff, closure_flag, transmittance, dt);
- accum_emission += emission;
+ accum_emission += result.indirect_throughput * emission;
}
}
@@ -661,7 +661,7 @@ ccl_device_forceinline void volume_integrate_heterogeneous(
/* Write accumulated emission. */
if (!is_zero(accum_emission)) {
- kernel_accum_emission(kg, state, result.indirect_throughput, accum_emission, render_buffer);
+ kernel_accum_emission(kg, state, accum_emission, render_buffer);
}
# ifdef __DENOISING_FEATURES__