summaryrefslogtreecommitdiff
path: root/scene/resources/visual_shader.h
diff options
context:
space:
mode:
Diffstat (limited to 'scene/resources/visual_shader.h')
-rw-r--r--scene/resources/visual_shader.h53
1 files changed, 47 insertions, 6 deletions
diff --git a/scene/resources/visual_shader.h b/scene/resources/visual_shader.h
index 841672294e..b3efac02aa 100644
--- a/scene/resources/visual_shader.h
+++ b/scene/resources/visual_shader.h
@@ -44,16 +44,18 @@ class VisualShader : public Shader {
friend class VisualShaderNodeVersionChecker;
- String version = "";
+ Dictionary engine_version;
public:
enum Type {
TYPE_VERTEX,
TYPE_FRAGMENT,
TYPE_LIGHT,
- TYPE_EMIT,
+ TYPE_START,
TYPE_PROCESS,
- TYPE_END,
+ TYPE_COLLIDE,
+ TYPE_START_CUSTOM,
+ TYPE_PROCESS_CUSTOM,
TYPE_SKY,
TYPE_MAX
};
@@ -135,10 +137,12 @@ public: // internal methods
Type get_shader_type() const;
public:
- void set_version(const String &p_version);
- String get_version() const;
+ void set_engine_version(const Dictionary &p_version);
+ Dictionary get_engine_version() const;
- void update_version(const String &p_new_version);
+#ifndef DISABLE_DEPRECATED
+ void update_engine_version(const Dictionary &p_new_version);
+#endif /* DISABLE_DEPRECATED */
enum {
NODE_ID_INVALID = -1,
@@ -199,9 +203,12 @@ class VisualShaderNode : public Resource {
Map<int, Variant> default_input_values;
Map<int, bool> connected_input_ports;
Map<int, int> connected_output_ports;
+ Map<int, bool> expanded_output_ports;
protected:
bool simple_decl = true;
+ bool disabled = false;
+
static void _bind_methods();
public:
@@ -227,6 +234,8 @@ public:
Variant get_input_port_default_value(int p_port) const; // if NIL (default if node does not set anything) is returned, it means no default value is wanted if disconnected, thus no input var must be supplied (empty string will be supplied)
Array get_default_input_values() const;
virtual void set_default_input_values(const Array &p_values);
+ virtual void remove_input_port_default_value(int p_port);
+ virtual void clear_default_input_values();
virtual int get_output_port_count() const = 0;
virtual PortType get_output_port_type(int p_port) const = 0;
@@ -245,10 +254,20 @@ public:
void set_input_port_connected(int p_port, bool p_connected);
virtual bool is_generate_input_var(int p_port) const;
+ virtual bool is_output_port_expandable(int p_port) const;
+ void _set_output_ports_expanded(const Array &p_data);
+ Array _get_output_ports_expanded() const;
+ void _set_output_port_expanded(int p_port, bool p_expanded);
+ bool _is_output_port_expanded(int p_port) const;
+ int get_expanded_output_port_count() const;
+
virtual bool is_code_generated() const;
virtual bool is_show_prop_names() const;
virtual bool is_use_prop_slots() const;
+ bool is_disabled() const;
+ void set_disabled(bool p_disabled = true);
+
virtual Vector<StringName> get_editable_properties() const;
virtual Vector<VisualShader::DefaultTextureParam> get_default_texture_parameters(VisualShader::Type p_type, int p_id) const;
@@ -292,6 +311,22 @@ protected:
virtual void set_input_port_default_value(int p_port, const Variant &p_value) override;
virtual void set_default_input_values(const Array &p_values) override;
+ virtual void remove_input_port_default_value(int p_port) override;
+ virtual void clear_default_input_values() override;
+
+ GDVIRTUAL0RC(String, _get_name)
+ GDVIRTUAL0RC(String, _get_description)
+ GDVIRTUAL0RC(String, _get_category)
+ GDVIRTUAL0RC(int, _get_return_icon_type)
+ GDVIRTUAL0RC(int, _get_input_port_count)
+ GDVIRTUAL1RC(int, _get_input_port_type, int)
+ GDVIRTUAL1RC(String, _get_input_port_name, int)
+ GDVIRTUAL0RC(int, _get_output_port_count)
+ GDVIRTUAL1RC(int, _get_output_port_type, int)
+ GDVIRTUAL1RC(String, _get_output_port_name, int)
+ GDVIRTUAL4RC(String, _get_code, Vector<String>, TypedArray<String>, int, int)
+ GDVIRTUAL1RC(String, _get_global_code, int)
+ GDVIRTUAL0RC(bool, _is_highend)
protected:
void _set_input_port_default_value(int p_port, const Variant &p_value);
@@ -331,6 +366,10 @@ class VisualShaderNodeInput : public VisualShaderNode {
String input_name = "[None]";
+public:
+ void set_shader_type(VisualShader::Type p_shader_type);
+ void set_shader_mode(Shader::Mode p_shader_mode);
+
protected:
static void _bind_methods();
void _validate_property(PropertyInfo &property) const override;
@@ -410,6 +449,7 @@ public:
QUAL_NONE,
QUAL_GLOBAL,
QUAL_INSTANCE,
+ QUAL_MAX,
};
private:
@@ -494,6 +534,7 @@ public:
String get_uniform_name_by_index(int p_idx) const;
UniformType get_uniform_type_by_name(const String &p_name) const;
UniformType get_uniform_type_by_index(int p_idx) const;
+ PortType get_port_type_by_index(int p_idx) const;
virtual Vector<StringName> get_editable_properties() const override;