summaryrefslogtreecommitdiff
path: root/scene/resources
diff options
context:
space:
mode:
authorYuri Roubinsky <chaosus89@gmail.com>2020-09-07 12:29:44 +0300
committerYuri Roubinsky <chaosus89@gmail.com>2020-09-07 12:39:20 +0300
commite2aca7e04734da91f511a61250f09ae967f20503 (patch)
treef2c9dcb0f666e413b95cba0a79eb269ca7129254 /scene/resources
parent753b2bd01082ea6de89c58e73518326383441201 (diff)
Fix some broken visual shader nodes
Diffstat (limited to 'scene/resources')
-rw-r--r--scene/resources/visual_shader.cpp3
-rw-r--r--scene/resources/visual_shader.h4
-rw-r--r--scene/resources/visual_shader_nodes.cpp6
3 files changed, 9 insertions, 4 deletions
diff --git a/scene/resources/visual_shader.cpp b/scene/resources/visual_shader.cpp
index 1d5e4124d2..b43a80c3d3 100644
--- a/scene/resources/visual_shader.cpp
+++ b/scene/resources/visual_shader.cpp
@@ -172,8 +172,6 @@ void VisualShaderNode::_bind_methods() {
}
VisualShaderNode::VisualShaderNode() {
- port_preview = -1;
- simple_decl = true;
}
/////////////////////////////////////////////////////////
@@ -2951,6 +2949,7 @@ String VisualShaderNodeGroupBase::generate_code(Shader::Mode p_mode, VisualShade
}
VisualShaderNodeGroupBase::VisualShaderNodeGroupBase() {
+ simple_decl = false;
}
////////////// Expression
diff --git a/scene/resources/visual_shader.h b/scene/resources/visual_shader.h
index c51f09ba36..8f22cb0a84 100644
--- a/scene/resources/visual_shader.h
+++ b/scene/resources/visual_shader.h
@@ -180,7 +180,7 @@ VARIANT_ENUM_CAST(VisualShader::Type)
class VisualShaderNode : public Resource {
GDCLASS(VisualShaderNode, Resource);
- int port_preview;
+ int port_preview = -1;
Map<int, Variant> default_input_values;
Map<int, bool> connected_input_ports;
@@ -188,7 +188,7 @@ class VisualShaderNode : public Resource {
int connected_output_count = 0;
protected:
- bool simple_decl = false;
+ bool simple_decl = true;
static void _bind_methods();
public:
diff --git a/scene/resources/visual_shader_nodes.cpp b/scene/resources/visual_shader_nodes.cpp
index 5c63201991..182aeae5d4 100644
--- a/scene/resources/visual_shader_nodes.cpp
+++ b/scene/resources/visual_shader_nodes.cpp
@@ -892,6 +892,7 @@ String VisualShaderNodeSample3D::get_warning(Shader::Mode p_mode, VisualShader::
}
VisualShaderNodeSample3D::VisualShaderNodeSample3D() {
+ simple_decl = false;
}
////////////// Texture2DArray
@@ -1135,6 +1136,7 @@ void VisualShaderNodeCubemap::_bind_methods() {
}
VisualShaderNodeCubemap::VisualShaderNodeCubemap() {
+ simple_decl = false;
}
////////////// Float Op
@@ -2236,6 +2238,7 @@ void VisualShaderNodeColorFunc::_bind_methods() {
}
VisualShaderNodeColorFunc::VisualShaderNodeColorFunc() {
+ simple_decl = false;
set_input_port_default_value(0, Vector3());
}
@@ -4226,6 +4229,7 @@ bool VisualShaderNodeTextureUniform::is_qualifier_supported(Qualifier p_qual) co
}
VisualShaderNodeTextureUniform::VisualShaderNodeTextureUniform() {
+ simple_decl = false;
}
////////////// Texture Uniform (Triplanar)
@@ -4529,6 +4533,7 @@ String VisualShaderNodeIf::generate_code(Shader::Mode p_mode, VisualShader::Type
}
VisualShaderNodeIf::VisualShaderNodeIf() {
+ simple_decl = false;
set_input_port_default_value(0, 0.0);
set_input_port_default_value(1, 0.0);
set_input_port_default_value(2, CMP_EPSILON);
@@ -4593,6 +4598,7 @@ String VisualShaderNodeSwitch::generate_code(Shader::Mode p_mode, VisualShader::
}
VisualShaderNodeSwitch::VisualShaderNodeSwitch() {
+ simple_decl = false;
set_input_port_default_value(0, false);
set_input_port_default_value(1, Vector3(1.0, 1.0, 1.0));
set_input_port_default_value(2, Vector3(0.0, 0.0, 0.0));