Cycles: change perspective depth pass to be more standard

Now it matches Eevee, OpenGL and other renderers. Panoramic camera depth passes
are unchanged, and are still distance from the camera center.
This commit is contained in:
Brecht Van Lommel
2020-05-10 16:12:46 +02:00
parent 98c301d25e
commit 18cda8be87
2 changed files with 16 additions and 2 deletions

View File

@@ -194,7 +194,7 @@ ccl_device_inline void kernel_write_data_passes(KernelGlobals *kg,
average(shader_bsdf_alpha(kg, sd)) >= kernel_data.film.pass_alpha_threshold) {
if (state->sample == 0) {
if (flag & PASSMASK(DEPTH)) {
float depth = camera_distance(kg, sd->P);
float depth = camera_z_depth(kg, sd->P);
kernel_write_pass_float(buffer + kernel_data.film.pass_depth, depth);
}
if (flag & PASSMASK(OBJECT_ID)) {