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

Added conditional nodes to visual shaders #27980

Merged
merged 1 commit into from
Apr 13, 2019

Conversation

Chaosus
Copy link
Member

@Chaosus Chaosus commented Apr 13, 2019

Added If and Switch nodes similar to UE4, however, I've changed the order of parameters a bit. Also renamed "Boolean" category to "Conditional", and fixed conversion between vector and boolean.

image

@Darkinggq
Copy link

glad to see added If and Switch :)

@Chaosus Chaosus force-pushed the vs_conditional branch 4 times, most recently from 36e85b0 to c7583c9 Compare April 13, 2019 15:15
@Chaosus
Copy link
Member Author

Chaosus commented Apr 13, 2019

Well, I think it fine and @reduz said it's nice at IRC, so let's merge...

@Chaosus Chaosus merged commit 89efaf5 into godotengine:master Apr 13, 2019
@Chaosus Chaosus deleted the vs_conditional branch April 13, 2019 16:00
@@ -782,7 +782,7 @@ Error VisualShader::_write_node(Type type, StringBuilder &global_code, StringBui
} else if (in_type == VisualShaderNode::PORT_TYPE_VECTOR && out_type == VisualShaderNode::PORT_TYPE_SCALAR) {
inputs[i] = "vec3(" + src_var + ")";
} else if (in_type == VisualShaderNode::PORT_TYPE_BOOLEAN && out_type == VisualShaderNode::PORT_TYPE_VECTOR) {
inputs[i] = "all(" + src_var + ")";
inputs[i] = "all(bvec3(" + src_var + "))";
Copy link
Member

Choose a reason for hiding this comment

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

Is this an unrelated bugfix? I want to pull this into 3.1.x but I'm not sure about this.

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed conversion between vector and boolean.

It's safe to merge because it's not used anywhere before this PR

@hpvb
Copy link
Member

hpvb commented Apr 20, 2019

Consider for 3.1.2

@Chaosus
Copy link
Member Author

Chaosus commented Apr 21, 2019

@hpvb Ah, This PR contains boolean nodes - they were introduced in #26164

@hpvb
Copy link
Member

hpvb commented Apr 22, 2019

@Chaosus we will look into taking just those from that PR then maybe.

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.

4 participants