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

Missing feature in ShaderGraph: boolean uniform. #4362

Closed
Megalomaniak opened this issue Apr 17, 2016 · 7 comments · Fixed by #26164
Closed

Missing feature in ShaderGraph: boolean uniform. #4362

Megalomaniak opened this issue Apr 17, 2016 · 7 comments · Fixed by #26164

Comments

@Megalomaniak
Copy link

Megalomaniak commented Apr 17, 2016

Operating system or device:
All supported?

Issue description:
Shader Language supports booleans but no boolean uniforms can be added in shaderGraph.
IMO, it would be nice if shaderGraph could do anything the shaderLang can & vice versa.
The main reason I request for this however is simply because it would allow me to create better shader/material UI's for the shaders I intend to share with the community:

booluniforms
NB: I have moved the Flip Bump V in the image for shaderGraph, but it was actually placed entirely randomly in between 'Metallicness' and 'Specular Exponent'.

While I can clamp the scalar uniform's values in shader to 0...1 range(min/max) - in the UI the user will still be able to input greater or negative values and that could lead to confusion. Using a boolean Uniform in place of the scalar uniforms would however make everything much clearer.

As a node the boolean uniform should take a name variable similar to other uniforms, and output either a 0 or a 1 depending on it's state. 0 for false, 1 for true. Or alternatively the values for false and true could be over-writable, i.e. be usable for any switches.

@Megalomaniak Megalomaniak changed the title 'missing' feature in ShaderGraph. 'missing' feature in ShaderGraph: boolean uniform. Apr 17, 2016
@Calinou
Copy link
Member

Calinou commented Apr 4, 2018

First of all thank you for your report and sorry for the delay.

We released Godot 3.0 in January 2018 after 18 months of work, fixing many old issues either directly, or by obsoleting/replacing the features they were referring to.

We still have hundreds of issues whose relevance/reproducibility needs to be checked against the current stable version, and that's where you can help us.
Could you check if the issue that you described initially is still relevant/reproducible in Godot 3.0 or any newer version, and comment about it here?

For bug reports, please also make sure that the issue contains detailed steps to reproduce the bug and, if possible, a zipped project that can be used to reproduce it right away. This greatly speeds up debugging and bugfixing tasks for our contributors.

Our Bugsquad will review this issue more in-depth in 15 days, and potentially close it if its relevance could not be confirmed.

Thanks in advance.

Note: This message is being copy-pasted to many "stale" issues (90+ days without activity). It might happen that it is not meaningful for this specific issue or appears oblivious of the issue's context, if so please comment to notify the Bugsquad about it.

@Megalomaniak
Copy link
Author

Megalomaniak commented Apr 5, 2018

Since shaderGraph was removed from 3.0 and slated for reintroduction in 3.1 This issue currently applies only to versions previous to 3.0. As the shaderGraph gets reintroduced to 3.1 however it would be nice to see shaderGraph do everything the shader language can and vice versa.

@akien-mga akien-mga added this to the 2.1 milestone Apr 5, 2018
@akien-mga
Copy link
Member

akien-mga commented Sep 17, 2018

The 2.1 branch is no longer actively worked on by engine developers, unless critical fixes are needed for current games in production. As such we are now closing non-critical bug reports affecting only the 2.1 branch.

Please comment if this was incorrectly triaged and is still relevant in 3.x versions.

@Megalomaniak
Copy link
Author

Megalomaniak commented Sep 22, 2018

@akien-mga Looking at the Alpha release it seems to still be an issue though now it's worse(afaict) since I can't even see where the uniforms should be showing up?

Edit: never mind. For some reason I had to create a new visual shader again and the second time around the shader parameters did show up. Still, shader language has boolean uniforms and visual shaders don't. So still the same issue.

@akien-mga akien-mga removed this from the 2.1 milestone Sep 23, 2018
@akien-mga akien-mga reopened this Sep 23, 2018
@aaronfranke
Copy link
Member

If this issue is still relevant in master, can you please provide updated screenshots of the issue?

@Megalomaniak
Copy link
Author

Err, sure. Other than the way godot interface is drawn theres really nothing else new to see.
Mind you the godot 3.1 build I just downloaded from hugo.pro seems to have an issue with mix() in shaderlang.

Images incoming in an edit.

@Megalomaniak
Copy link
Author

Megalomaniak commented Nov 19, 2018

Apparently I can't edit message on github anymore, oh well. Preview didn't work either, maybe the stylus dark theme override for github I use is breaking something...

Here are the images:

shader_type spatial;

uniform bool BoolForBool = false;

void fragment() {
	vec3 color1 = vec3(1.0, 1.0, 1.0);
	vec3 color2 = vec3(0.0, 0.0, 0.0);
	ALBEDO = mix(color1, color2, BoolForBool);
	}

results in:
ShaderLang bool

While there is no uniform node for boolean operation/input in visual shaders resulting in me having to do the following:
ShaderGraph no bool

for the following result:
ShaderGraph result

Which is just a number that doesn't immediately tell the end user of the material what to exactly do with it. Plus having a boolean uniform node would cut out a good few nodes from that chain above.

@akien-mga akien-mga changed the title 'missing' feature in ShaderGraph: boolean uniform. Missing feature in ShaderGraph: boolean uniform. Nov 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants