This is the testing Godot forums! All forum posts unique to this forum will be deleted! Please use the main forums here for any posts you want to keep. All forum rules still apply.

Newbie - TIME Performance (Intel)

BimbamBimbam Posts: 16Member
edited April 2020 in Shaders

Howdy all,

tldr; is using 'TIME' in a shader pointless when passing your own time from a GDscript's _process() seems to do a better job?

Very new and only recently started tinkering with some of the shader based freebies on the asset store. In particular, Water and Grass. The issue is I notice a huge performance dip when including such shaders (from ~145fps to 45fps kinda dip which compounds the more assets involved).

I've read about the lack of Integrated GPU performance in general and how 4.0 will likely improve this, however after tinkering I noticed that if I pass my own 'process_time' variable from the parent GDscript's _process(delta) function to the shader, all of the performance comes back.

I guess my question is, is this normal? and, is my solution viable/scalable for my shader performance woes or likely to bite me in the ass down the line?

I am not sure of the reason behind the difference, but am guessing that a shader's 'TIME' is running as fast as possible, or for some other reason has a high overhead; while the GDscript _process(delta) is running at 1/60th of a second and so causes less strain?

Any clues or links to documentation I have missed would be great ^^.



  • MegalomaniakMegalomaniak Posts: 2,580Admin
    edited April 2020

    One way to test your hypothesis is to go to the project settings and turn vsync off. Then see if passing your own time variable starts causing a similar issue?

  • BimbamBimbam Posts: 16Member
    edited April 2020

    Vsync was off from the start as being on a Surface Go meant I had bumped into performance problems early on.

    Eyeballing it, turning Vsync On has a negligible impact using my _process(delta) generated 'time' (somewhat surprising) so will leave it on now until I have performance issues again.

    Still no idea why using shader language 'TIME' causes such a performance cliff though. Not complaining, just wanted to know if my workaround was likely to have unforeseen drawbacks.

  • cyberealitycybereality Posts: 928Moderator

    I think both methods can work. I have tried them and did not notice a big difference in performance, but I'm also running on a beefy desktop GPU.

  • CalinouCalinou Posts: 376Admin Godot Developer

    Can you reproduce this with a more minimal shader? If so, please report an issue with GitHub and attach a minimal reproduction project.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.