diff options
author | Franklin Sobrinho <franklin_gs@hotmail.com> | 2016-03-14 15:24:12 -0300 |
---|---|---|
committer | Franklin Sobrinho <franklin_gs@hotmail.com> | 2016-03-14 15:24:12 -0300 |
commit | 5ee67ba498f7c556f92ed7d4d33afdda18f92ee8 (patch) | |
tree | 880c464b6380a1430f0b8a66983036cbbf80763c /scene/resources | |
parent | be4d58e1203ae35dab97b14f08098f50998d4201 (diff) |
Automatically create input node when creating a ShaderGraph
Diffstat (limited to 'scene/resources')
-rw-r--r-- | scene/resources/shader_graph.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/scene/resources/shader_graph.cpp b/scene/resources/shader_graph.cpp index eabc84c41e..40ae26ba5d 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); } } |