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

Keep existing VectorCompose input values when setting vector type #97365

Merged

Conversation

aaronp64
Copy link
Contributor

VisualShaderNodeVectorCompose::set_op_type would zero out input port default values for z and w when using vector 3D/4D, updated to keep values for all ports.

Zeroing out z and w would cause values for 4D vectors to be lost when loading the visual shader - 3D vectors were not affected by this, since 3D is the default op type, which caused this step to be skipped during loading. However, both 3D and 4D were affected when changing the op type from the drop down in editor. For example, changing from 3D (1, 2, 3) to 4D would result in (1, 2, 0, 0), and changing from 4D (1, 2, 3, 4) to 3D would result in (1, 2, 0), losing previously set values.

Fixes #97359

VisualShaderNodeVectorCompose::set_op_type would zero out input port default values for z and w when using vector 3D/4D, updated to keep values for all ports.

Zeroing out z and w would cause values for 4D vectors to be lost when loading the visual shader - 3D vectors were not affected by this, since 3D is the default op type, which caused this step to be skipped during loading.  However, both 3D and 4D were affected when changing the op type from the drop down in editor.  For example, changing from 3D (1, 2, 3) to 4D would result in (1, 2, 0, 0), and changing from 4D (1, 2, 3, 4) to 3D would result in (1, 2, 0), losing previously set values.
@aaronp64 aaronp64 requested a review from a team as a code owner September 23, 2024 14:56
@AThousandShips AThousandShips added this to the 4.4 milestone Sep 23, 2024
@akien-mga akien-mga merged commit 5d9ffb7 into godotengine:master Nov 29, 2024
19 checks passed
@akien-mga
Copy link
Member

Thanks!

@aaronp64 aaronp64 deleted the vector_compose_input_defaults branch December 3, 2024 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Visual Shader Editor wrongly parses VectorCompose of type Vector4 resetting z and w values to 0
4 participants