Godot version:
3.0.3
OS/device including version:
Fedora 26
Issue description:
I created a fragment shader and a function where I use the built-in variable TIME. I get the error "Unknown identifier in expression: TIME". However I can use TIME in the fragment()-function but not in my own functions.
Working example:
shader_type spatial;
render_mode unshaded;
void fragment()
{
vec3 col = 0.5 + 0.5*cos(vec3(0.0, TIME, 0.0));
ALBEDO = col;
}
Not working example:
shader_type spatial;
render_mode unshaded;
vec3 getColor()
{
vec3 col = 0.5 + 0.5*cos(vec3(0.0, TIME, 0.0));
return col;
}
void fragment()
{
vec3 col = getColor();
ALBEDO = col;
}
Steps to reproduce:
Create a fragment shader and write a function that uses TIME.
Minimal reproduction project:
shader_TIME.zip
Duplicate of #18315 , which covers all built-in variables but is not labeled as bug, for some reason.
Most helpful comment
Duplicate of #18315 , which covers all built-in variables but is not labeled as bug, for some reason.