-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
Builtin variables are not useable in shader functions #14904
Comments
Yes this is expected, as functions can be reused between vertex and
fragment shaders
…On Dec 21, 2017 12:58 PM, "Marc" ***@***.***> wrote:
Godot 3.0
Windows 10 64 bits
nVidia geforce 940M
I vaguely remember something about this, but I noticed that if you make a
function in a shader, that function cannot access builtin variables such as
TIME. Is this expected? If it is, I find it a bit annoying since such a
variable can be expected to work as a global (unlike some others like
output pixel color or output vertex).
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#14904>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AF-Z29Xe01dAygSASfAIOGlUpLlMMDtoks5tCoA3gaJpZM4RKAzx>
.
|
But does this make sense for |
there is no code in the shader compiler to check that built-ins are global everywhere, TIME is probably the only exception |
Yeah, TIME and VIEWPORT_SIZE should be accessed globally, at some point of development |
I just ran in this again, with |
Based on the discussion in #43150, it's not clear to me whether there's something left to implement for this, at least in the current state of the proposal. A more detailed proposal might be needed to review exactly which non-global builtins could make sense to expose as global, if any. |
Godot 3.0
Windows 10 64 bits
nVidia geforce 940M
I vaguely remember something about this, but I noticed that if you make a function in a shader, that function cannot access builtin variables such as
TIME
. Is this expected? If it is, I find it a bit annoying since such a variable can be expected to work as a global (unlike some others though, like output pixel color or output vertex).The text was updated successfully, but these errors were encountered: