Fix T101065: wrong denoising depth after ray precision improvements

This commit is contained in:
Brecht Van Lommel 2022-09-15 15:30:11 +02:00
parent cab2ca7a24
commit 5fddc4a3b1
Notes: blender-bot 2023-02-13 14:30:12 +01:00
Referenced by issue #100749, Blender LTS: Maintenance Task 3.3
Referenced by issue #101065, Regression: Denoising depth pass: different result from 3.2.2 (ok) to 3.3
1 changed files with 2 additions and 2 deletions

View File

@ -42,8 +42,8 @@ ccl_device_forceinline void kernel_write_denoising_features_surface(
if (kernel_data.film.pass_denoising_depth != PASS_UNUSED) {
const float3 denoising_feature_throughput = INTEGRATOR_STATE(
state, path, denoising_feature_throughput);
const float denoising_depth = ensure_finite(average(denoising_feature_throughput) *
sd->ray_length);
const float depth = sd->ray_length - INTEGRATOR_STATE(state, ray, tmin);
const float denoising_depth = ensure_finite(average(denoising_feature_throughput) * depth);
kernel_write_pass_float(buffer + kernel_data.film.pass_denoising_depth, denoising_depth);
}