From 9bc177d8ded4ba498762813a0d5106005fef0e67 Mon Sep 17 00:00:00 2001 From: Alexander Gavrilov Date: Tue, 4 Aug 2020 17:56:39 +0300 Subject: Materials: support true float4 attributes in the Attribute node. Add a new Alpha socket to the Attribute node that outputs the fourth component of the attribute. Currently the only such attribute is vertex color, but there may be more in the future. If the attribute has no alpha channel, the expected value is 1. The Cycles code is already refactored and committed by Brecht. Ref D2057 --- source/blender/gpu/intern/gpu_codegen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/gpu/intern/gpu_codegen.c') diff --git a/source/blender/gpu/intern/gpu_codegen.c b/source/blender/gpu/intern/gpu_codegen.c index 2d76e793fc0..39c3119cc39 100644 --- a/source/blender/gpu/intern/gpu_codegen.c +++ b/source/blender/gpu/intern/gpu_codegen.c @@ -478,7 +478,7 @@ static void codegen_call_functions(DynStr *ds, GPUNodeGraph *graph, GPUOutput *f BLI_dynstr_appendf(ds, "cons%d", input->id); } else if (input->source == GPU_SOURCE_ATTR) { - BLI_dynstr_appendf(ds, "var%d", input->attr->id); + codegen_convert_datatype(ds, input->attr->gputype, input->type, "var", input->attr->id); } BLI_dynstr_append(ds, ", "); -- cgit v1.2.3