Cycles: Separation of Indirect and Direct clamping.

Indirect and Direct samples can now be clamped individually. This way we can clamp the indirect samples (fireflies), while keeping the direct highlights.
Example render: http://www.pasteall.org/pic/show.php?id=66586

WARNING: This breaks backwards compatibility. If you had Clamping enabled in an old file, you must re-enable either Direct/Indirect clamping or both again.

Reviewed by: brecht
Differential Revision: https://developer.blender.org/D303
This commit is contained in:
Thomas Dinges
2014-02-10 21:44:49 +01:00
parent e920206a90
commit e29a45b396
10 changed files with 77 additions and 43 deletions

View File

@@ -884,10 +884,10 @@ ccl_device float4 kernel_path_integrate(KernelGlobals *kg, RNG *rng, int sample,
ray.t = FLT_MAX;
}
float3 L_sum = path_radiance_sum(kg, &L);
float3 L_sum = path_radiance_clamp_and_sum(kg, &L);
#ifdef __CLAMP_SAMPLE__
path_radiance_clamp(&L, &L_sum, kernel_data.integrator.sample_clamp);
path_radiance_reject(&L, &L_sum);
#endif
kernel_write_light_passes(kg, buffer, &L, sample);
@@ -1320,10 +1320,10 @@ ccl_device float4 kernel_branched_path_integrate(KernelGlobals *kg, RNG *rng, in
#endif
}
float3 L_sum = path_radiance_sum(kg, &L);
float3 L_sum = path_radiance_clamp_and_sum(kg, &L);
#ifdef __CLAMP_SAMPLE__
path_radiance_clamp(&L, &L_sum, kernel_data.integrator.sample_clamp);
path_radiance_reject(&L, &L_sum);
#endif
kernel_write_light_passes(kg, buffer, &L, sample);