[Bf-blender-cvs] [0b05e0b97e4] master: Fix T97159: AOV Pass in Cycles always gets Alpha Value of 1 for whole image

Lukas Stockner noreply at git.blender.org
Sun Apr 10 19:25:16 CEST 2022


Commit: 0b05e0b97e4b556ce87dd659a3786be53f89e4e5
Author: Lukas Stockner
Date:   Fri Apr 8 01:14:01 2022 +0200
Branches: master
https://developer.blender.org/rB0b05e0b97e4b556ce87dd659a3786be53f89e4e5

Fix T97159: AOV Pass in Cycles always gets Alpha Value of 1 for whole image

As far as I can see, it makes a lot of sense to have the alpha channel here, it matches the 2.x behavior and also matches what Eevee is doing.

Differential Revision: https://developer.blender.org/D14595

===================================================================

M	intern/cycles/blender/addon/engine.py
M	intern/cycles/kernel/svm/aov.h
M	intern/cycles/scene/pass.cpp

===================================================================

diff --git a/intern/cycles/blender/addon/engine.py b/intern/cycles/blender/addon/engine.py
index b7713dc7110..1b03581ae03 100644
--- a/intern/cycles/blender/addon/engine.py
+++ b/intern/cycles/blender/addon/engine.py
@@ -226,7 +226,7 @@ def list_render_passes(scene, srl):
         if aov.type == 'VALUE':
             yield (aov.name, "X", 'VALUE')
         else:
-            yield (aov.name, "RGB", 'COLOR')
+            yield (aov.name, "RGBA", 'COLOR')
 
     # Light groups.
     for lightgroup in srl.lightgroups:
diff --git a/intern/cycles/kernel/svm/aov.h b/intern/cycles/kernel/svm/aov.h
index 334fb79cb75..9b818f0e6f8 100644
--- a/intern/cycles/kernel/svm/aov.h
+++ b/intern/cycles/kernel/svm/aov.h
@@ -32,7 +32,7 @@ ccl_device void svm_node_aov_color(KernelGlobals kg,
                                           kernel_data.film.pass_stride;
     ccl_global float *buffer = render_buffer + render_buffer_offset +
                                (kernel_data.film.pass_aov_color + node.z);
-    kernel_write_pass_float3(buffer, make_float3(val.x, val.y, val.z));
+    kernel_write_pass_float4(buffer, make_float4(val.x, val.y, val.z, 1.0f));
   }
 }
 
diff --git a/intern/cycles/scene/pass.cpp b/intern/cycles/scene/pass.cpp
index 5f5b19e710d..c2f12355ac7 100644
--- a/intern/cycles/scene/pass.cpp
+++ b/intern/cycles/scene/pass.cpp
@@ -321,7 +321,7 @@ PassInfo Pass::get_info(const PassType type, const bool include_albedo, const bo
       break;
 
     case PASS_AOV_COLOR:
-      pass_info.num_components = 3;
+      pass_info.num_components = 4;
       break;
     case PASS_AOV_VALUE:
       pass_info.num_components = 1;



More information about the Bf-blender-cvs mailing list