godotengine / tps-demo

Godot Third Person Shooter with high quality assets and lighting
Other
955 stars 166 forks source link

The shaders need optimization #147

Closed Kreyren closed 1 year ago

Kreyren commented 1 year ago

OS/device including version:

system-stuff

kreyren@dreamon /home/kreyren$ guix describe
Generation 32   lis 18 2022 14:41:28    (current)
  nonguix f3227e3
    repository URL: https://gitlab.com/nonguix/nonguix
    branch: master
    commit: f3227e33d1782508bbf530de61fa3a8bda253423
  guix 1bea5d3
    repository URL: https://git.savannah.gnu.org/git/guix.git
    branch: master
    commit: 1bea5d38a26755b84437623c0f48915a77899b57

Issue description:

The game launched from the engine loads without pre-loading or any kind of optimization for shaders so when you e.g. make the first shot it will cause a huge spike in system resource utilization and has a potential to halts low-end systems and/or systems with low amount of VRAM/RAM thus proposing some form of handling.

Screenshots of issue:

Not relevant

Relevants:

  1. Was given https://godotengine.org/article/godot-3-5-cant-stop-wont-stop#:~:text=Asynchronous%20shader%20compilation%20%2B%20caching%20(ubershader) claiming that this issue is solved in godot-3.5
aaronfranke commented 1 year ago

This is not a bug with the TPS demo, this is a limitation of the engine. Work on fixing this in Godot 3 is not a priority since there will be many rendering improvements that help large projects in Godot 4, so I would not worry about it for now.

Kreyren commented 1 year ago

This is not a bug with the TPS demo, this is a limitation of the engine. Work on fixing this in Godot 3 is not a priority since there will be many rendering improvements that help large projects in Godot 4, so I would not worry about it for now. -- @aaronfranke (https://github.com/godotengine/tps-demo/issues/147#issuecomment-1322601021)

My quote from matrix:

e.g. the ubisoft's anvil and alike are managing this through:

  1. hiding the shader compilation behind a live-rendered scenes like https://www.youtube.com/watch?v=rktLqWGgXWo
  2. https://www.youtube.com/watch?v=7bXexNtrkSg (9:21) where the player is put in the tutorial environment with limited assets for the engine to maintain set FPS and use the spare power for the shaders
  3. using a pre-scene where the shaders get compiled in a limited asset environment and slowly increasing into the shader heavy full scene https://www.youtube.com/watch?v=7bXexNtrkSg 11:23
  4. Hiding the shader compilation behind resource-friendly animation until it's finished https://www.youtube.com/watch?v=TY9AC3E5JVI (1:17:56)
  5. Hiding the shader compilation behind an animation https://www.youtube.com/watch?v=TY9AC3E5JVI (1:59:04) -- https://matrix.to/#/!UxMKwxAxANEzAyYPfC:feneas.org/$oJ6m1_ROJ8Fp8bK0Mb5LLJEyvWuuOsmjIP2hNwHI1A4?via=matrix.org&via=privacytools.io&via=tchncs.de

Should i design the game with this kind of management for the shaders? It's kinda the decision that has to be taken early in development..

(using anvil as an example as the shader management is the most evident there the management is used industry-wide just usually more hidden behind e.g. loading screens)