-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Accessing COLOR as input variable breaks shader unintuitively #5545
Comments
COLOR is intended to be Try EDIT: COLOR is actually the output of the vertex shader. Unless you use vertex colors this will be white. |
This is indeed expected as mentioned by @DavidSichma. Yet many users seem to be hit by this, so we should see if we can improve the UX, e.g. by getting a compilation error when trying to read |
@akien-mga In the fragment shader |
CC @Chaosus |
By default, vertex color is always white so comparison like |
@akien-mga I don't understand what |
As I said above, I don't think there should be an editor warning. I think this is just a documentation issue. |
Phew... Then I think so too. It's rather hard to implement such warn system anyways 😄 |
Transferred to godot-docs as this seems to be a documentation issue. From a quick look at https://docs.godotengine.org/en/stable/tutorials/shading/shading_reference/canvas_item_shader.html#vertex-built-ins, I'd say that it might still not be crystal clear that one can't read from |
Is this still relevant? I think after #10107 this has been thoroughly clarified in 4.x/master (and the behavior is different in 4.x, anyway). Does this issue still need to exist for a potential docs change to 3.x? |
Godot version:
3.1 Alpha 2
OS/device including version:
Windows 7 Professional Service Pack 1
Issue description:
Shader turns entire sprite white.
Tried both of the following shader coding:
And:
(Ignore the green pixel.)
Steps to reproduce:
Run app.
The text was updated successfully, but these errors were encountered: