Newbie - TIME Performance (Intel)

BimbamBimbam Posts: 20Member
edited April 28 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 ^^.

Thanks

Comments

  • MegalomaniakMegalomaniak Posts: 2,649Admin
    edited April 28

    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: 20Member
    edited April 28

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

    Edit:
    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: 927Moderator

    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: 417Admin 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

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file