diff options
author | MarianoGNU <marianognu.easyrpg@gmail.com> | 2015-12-25 18:49:14 -0300 |
---|---|---|
committer | MarianoGNU <marianognu.easyrpg@gmail.com> | 2015-12-26 10:44:54 -0300 |
commit | df5c92c66eeed0d5b36c40d0ade0d6c5d42e7df7 (patch) | |
tree | 4280d8145e01529148900314c33514c758e42e8a | |
parent | 754908844ae52c04ed68ef27c02481479f1e2ab4 (diff) |
Fix RGBA Uniform autogeneration in ShaderGraph (fixes #2606)
-rw-r--r-- | scene/resources/shader_graph.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/scene/resources/shader_graph.cpp b/scene/resources/shader_graph.cpp index 49a1bdccb1..3ff859a995 100644 --- a/scene/resources/shader_graph.cpp +++ b/scene/resources/shader_graph.cpp @@ -1532,7 +1532,7 @@ const ShaderGraph::NodeSlotInfo ShaderGraph::node_slot_info[]= { {NODE_CURVE_MAP,{SLOT_TYPE_SCALAR,SLOT_MAX},{SLOT_TYPE_SCALAR,SLOT_MAX}}, // vec3 interpolation (with optional curve) {NODE_SCALAR_INPUT,{SLOT_MAX},{SLOT_TYPE_SCALAR,SLOT_MAX}}, // scalar uniform (assignable in material) {NODE_VEC_INPUT,{SLOT_MAX},{SLOT_TYPE_VEC,SLOT_MAX}}, // vec3 uniform (assignable in material) - {NODE_RGB_INPUT,{SLOT_MAX},{SLOT_TYPE_VEC,SLOT_MAX}}, // color uniform (assignable in material) + {NODE_RGB_INPUT,{SLOT_MAX},{SLOT_TYPE_VEC,SLOT_TYPE_SCALAR,SLOT_MAX}}, // color uniform (assignable in material) {NODE_XFORM_INPUT,{SLOT_MAX},{SLOT_TYPE_XFORM,SLOT_MAX}}, // mat4 uniform (assignable in material) {NODE_TEXTURE_INPUT,{SLOT_TYPE_VEC,SLOT_MAX},{SLOT_TYPE_VEC,SLOT_TYPE_SCALAR,SLOT_MAX}}, // texture input (assignable in material) {NODE_CUBEMAP_INPUT,{SLOT_TYPE_VEC,SLOT_MAX},{SLOT_TYPE_VEC,SLOT_TYPE_SCALAR,SLOT_MAX}}, // cubemap input (assignable in material) @@ -2561,8 +2561,9 @@ void ShaderGraph::_add_node_code(ShaderType p_type,Node *p_node,const Vector<Str String name = p_node->param1; Color dv= p_node->param2; - code +="uniform color "+name+"=vec4("+rtos(dv.r)+","+rtos(dv.g)+","+rtos(dv.g)+","+rtos(dv.a)+");\n"; + code +="uniform color "+name+"=vec4("+rtos(dv.r)+","+rtos(dv.g)+","+rtos(dv.b)+","+rtos(dv.a)+");\n"; code += OUTNAME(p_node->id,0)+"="+name+".rgb;\n"; + code += OUTNAME(p_node->id,1)+"="+name+".a;\n"; }break; case NODE_XFORM_INPUT: { |