From 8de04050320ef9daabc179160c3680bfe7eb61af Mon Sep 17 00:00:00 2001 From: Franklin Sobrinho Date: Mon, 14 Mar 2016 15:24:12 -0300 Subject: [PATCH] Automatically create input node when creating a ShaderGraph (cherry picked from commit 5ee67ba498f7c556f92ed7d4d33afdda18f92ee8) --- scene/resources/shader_graph.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/scene/resources/shader_graph.cpp b/scene/resources/shader_graph.cpp index eabc84c41e2..40ae26ba5d5 100644 --- a/scene/resources/shader_graph.cpp +++ b/scene/resources/shader_graph.cpp @@ -1351,13 +1351,21 @@ ShaderGraph::ShaderGraph(Mode p_mode) : Shader(p_mode) { //shader = VisualServer::get_singleton()->shader_create(); _pending_update_shader=false; - Node out; - out.id=0; - out.pos=Vector2(250,20); - out.type=NODE_OUTPUT; + + Node input; + input.id=1; + input.pos=Vector2(50,40); + input.type=NODE_INPUT; + + Node output; + output.id=0; + output.pos=Vector2(350,40); + output.type=NODE_OUTPUT; + for(int i=0;i<3;i++) { - shader[i].node_map.insert(0,out); + shader[i].node_map.insert(0,output); + shader[i].node_map.insert(1,input); } }