I'm using the RGBA channels of the vertex colors on geometry for various effects but I can't find a way to separate out the alpha channel in geometry nodes. Is there a way to access the Alpha channel of a vertex color attribute in a Geometry node?
-
$\begingroup$ Sounds like you will need to use an attribute created in the shading editor to be used by the Geometry Nodes editor. $\endgroup$– Hezi ShahmoonJan 31 at 11:13
-
$\begingroup$ +1 good question $\endgroup$– ChrisJan 31 at 11:15
1 Answer
Unfortunately, the answer is definitely: No, this is currently not possible.
A look at the source code reveals that, although an RGBA color value could in principle be processed due to the variable type, the alpha value is simply not used:
static void sh_node_seprgb_declare(NodeDeclarationBuilder &b)
{
b.is_function_node();
b.add_input<decl::Color>(N_("Image")).default_value({0.8f, 0.8f, 0.8f, 1.0f});
b.add_output<decl::Float>(N_("R"));
b.add_output<decl::Float>(N_("G"));
b.add_output<decl::Float>(N_("B"));
}
In contrast, in another part of the code (compositing), which allows the separation of a color into RGBA, the alpha value is very well processed:
static void cmp_node_seprgba_declare(NodeDeclarationBuilder &b)
{
b.add_input<decl::Color>(N_("Image")).default_value({1.0f, 1.0f, 1.0f, 1.0f});
b.add_output<decl::Float>(N_("R"));
b.add_output<decl::Float>(N_("G"));
b.add_output<decl::Float>(N_("B"));
b.add_output<decl::Float>(N_("A"));
}
From this we can conclude:
A modification of the source code seems possible and feasible, but currently this function is not implemented yet.