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

Add shader time scaling (3.2) #38995

Merged
merged 1 commit into from
Jun 7, 2020

Conversation

RandomShaper
Copy link
Member

@RandomShaper RandomShaper commented May 24, 2020

Shaders' TIME will be affected by the new shader time scale, that is set via the new VisualServer::set_time_scale() method.

Another builtin TIME_UNSCALED is added, that contains the accumulated time unaffected by the scale.
UPDATE: This part has been removed at @reduz's request, the rationale being that the it's such a big change for a small benefit: there are other means (like uniforms) to alter the passage of time for the few cases of shaders that need not to be affected by the scale. And I agree.

Closes #27127. (See it for discussion.)

No version of this branch for 4.0 is needed, since it introduces global shader variables, with which one can easily implement their own version of this.

@reduz
Copy link
Member

reduz commented Jun 3, 2020

Please dont do TIME_UNSCALED, if user really wants this, let him/her pass a uniform with whathever is desired.

@akien-mga
Copy link
Member

I had misunderstood reduz's comment so here's a clarification:

23:30 <Akien> reduz: ah I see, so you mean TIME can be affected by the scale, and for the few shaders that need it unscaled (like pause menu effects) users can use uniforms?
23:30 <reduz> yeah

@RandomShaper RandomShaper force-pushed the shader_time_scale_3.2 branch from 243745b to d8cbbca Compare June 6, 2020 16:56
Shaders' `TIME` will be affected by the new shader time scale, that is set via the also new `VisualServer::set_time_scale()`.
@RandomShaper RandomShaper force-pushed the shader_time_scale_3.2 branch from d8cbbca to 1ff7b0a Compare June 6, 2020 22:00
@akien-mga akien-mga merged commit 776eb76 into godotengine:3.2 Jun 7, 2020
@akien-mga
Copy link
Member

Thanks!

@RandomShaper RandomShaper deleted the shader_time_scale_3.2 branch June 7, 2020 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants