Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some missing categories in visual shader nodes #89190

Merged
merged 1 commit into from
Mar 8, 2024

Conversation

AThousandShips
Copy link
Member

@AThousandShips AThousandShips commented Mar 5, 2024

Confirmed these with:

diff --git a/scene/resources/visual_shader.h b/scene/resources/visual_shader.h
index 09ea9a8890..3a7b3ea09c 100644
--- a/scene/resources/visual_shader.h
+++ b/scene/resources/visual_shader.h
@@ -366,7 +366,7 @@ public:

        virtual String get_warning(Shader::Mode p_mode, VisualShader::Type p_type) const;

-       virtual Category get_category() const;
+       virtual Category get_category() const = 0;

        VisualShaderNode();
 };
@@ -468,6 +468,8 @@ public:
        bool _is_highend() const;
        void _set_option_index(int p_op, int p_index);

+       virtual Category get_category() const override { return CATEGORY_SPECIAL; }
+
        int get_option_index(int p_op) const;
 };

@@ -75,8 +75,6 @@ class VisualShaderNodeParticleSphereEmitter : public VisualShaderNodeParticleEmi
virtual String generate_global_per_node(Shader::Mode p_mode, int p_id) const override;
virtual String generate_code(Shader::Mode p_mode, VisualShader::Type p_type, int p_id, const String *p_input_vars, const String *p_output_vars, bool p_for_preview = false) const override;

virtual Category get_category() const override { return CATEGORY_PARTICLE; }
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These were redundant as the parent type already does this

@@ -1990,8 +2010,6 @@ class VisualShaderNodeVectorDecompose : public VisualShaderNodeVectorBase {
virtual void set_op_type(OpType p_op_type) override;
virtual String generate_code(Shader::Mode p_mode, VisualShader::Type p_type, int p_id, const String *p_input_vars, const String *p_output_vars, bool p_for_preview = false) const override;

virtual Category get_category() const override { return CATEGORY_VECTOR; }
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was redundant

@@ -49,6 +49,8 @@ class VisualShaderNodeSDFToScreenUV : public VisualShaderNode {

virtual String generate_code(Shader::Mode p_mode, VisualShader::Type p_type, int p_id, const String *p_input_vars, const String *p_output_vars, bool p_for_preview = false) const override;

virtual Category get_category() const override { return CATEGORY_TEXTURES; }
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm unsure exactly what category to assign these to

Copy link
Member

@Geometror Geometror Mar 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might want to add a new category for SDF nodes in the future. Or we just use CATEGORY_TEXTURES or CATEGORY_SPECIAL, at least that's what I would do for now.

@akien-mga akien-mga merged commit d195346 into godotengine:master Mar 8, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks!

@AThousandShips AThousandShips deleted the vis_cat branch March 8, 2024 12:26
@AThousandShips
Copy link
Member Author

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants