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

Shader Error "Unknown identifier in expression: TIME" #19684

Closed
metinc opened this issue Jun 20, 2018 · 1 comment
Closed

Shader Error "Unknown identifier in expression: TIME" #19684

metinc opened this issue Jun 20, 2018 · 1 comment

Comments

@metinc
Copy link
Contributor

metinc commented Jun 20, 2018

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

@eon-s
Copy link
Contributor

eon-s commented Jun 21, 2018

Duplicate of #18315 , which covers all built-in variables but is not labeled as bug, for some reason.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants