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

Visual Shader: Add vector operations to Remap node #97314

Merged
merged 1 commit into from
Sep 23, 2024

Conversation

tetrapod00
Copy link
Contributor

Implements and closes godotengine/godot-proposals#10800.

Add vector operators to the Remap node, following the example of the Mix node.

Remap operators after this PR:
godot windows editor dev x86_64_zfvApXwFXI

Remap ranges can be set with either scalars or vectors:
godot windows editor dev x86_64_DZVB1f4W6F

Move existing default scalar Remap to the scalar functions section.
godot windows editor dev x86_64_h1wifyFCOt

Implementation:

  • Follow the example of Mix for the operator types.
  • Copy the operator code from Mix.
  • Add Remap to VisualShaderEditor::_setup_node(), so that it can be added with either float or vector values.
  • The old scalar mode is still the default, so backward compatibility should work. I don't think changing the category should break anything?

@tetrapod00 tetrapod00 requested review from a team as code owners September 22, 2024 05:39
@Chaosus Chaosus added this to the 4.4 milestone Sep 22, 2024
@tetrapod00
Copy link
Contributor Author

Corrected an error where OP_TYPE_VECTOR_2D_SCALAR, OP_TYPE_VECTOR_3D_SCALAR, and OP_TYPE_VECTOR_4D_SCALAR were mixing float and vector values in the remap calculation.

@akien-mga akien-mga merged commit 2017006 into godotengine:master Sep 23, 2024
19 checks passed
@akien-mga
Copy link
Member

Thanks!

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: Add vector operator modes to the Remap node
4 participants