How to preload shaders in Godot 4 (to prevent slowdowns)?
Asked Answered
B

2

0

I tried making a scene with all the shaders used as materials, then load it into the scene, then free it...

func do_shader_preload():
	game.shaders_preloaded = true
	var shaders = load("res://scenes/shader-preloads.tscn").instantiate()
	add_child(shaders)
	shaders.call_deferred("queue_free")

But it doesn't help. And the game stutter is worse in latest 4.1 dev, than in 4.0.X...

Barbel answered 10/5, 2023 at 1:54 Comment(0)
B
0

Just noticed this:

https://github.com/godotengine/godot/pull/76092

Maybe that'll help

Barbel answered 11/5, 2023 at 15:11 Comment(0)
B
0

Turns out it is working now in 4.1-dev2!

Not 100% sure thats why, but whatever

Barbel answered 11/5, 2023 at 16:52 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.