Does your #godot game startup slowly? Do you use NoiseTexture2D by chance as textures in some materials?
Check this thread to find out how you can unknowingly ruin your game startup time + level load times either instantly,
or slowly over time by using unbaked noise textures. π§΅
#techart #Gamedev
Check this thread to find out how you can unknowingly ruin your game startup time + level load times either instantly,
or slowly over time by using unbaked noise textures. π§΅
#techart #Gamedev
1 / 2
Comments
1 for each unique noise texture is an incorrect assumption.
Testing shows adding more unique noise textures adds more startup time linearly. Very not good.
"But the editor caches the noise texture. I see it right there on my objects!" - yes but that is not used when you run the game. Its regenerated at runtime.
"Just use lower res noise textures lmao." - the texture is still regenerated every time you run the game.
- Bake your noise textures out to static images.
- The NoiseTexture2D and FastNoiseLite while being a wonderful feature in isolation for lookdev, is not production friendly and can severly hurt your workflow and iteration time when you 'just wanna run the game'
-Save your noise as a grayscale image with a bit depth of 8. It takes up less disk space and is faster to load than an RGBA image
-Scale the image's resolution relative to how much of the screen it will occupy (ie: 1024px->256px for small/distant objects)
Also a good idea to channel pack multiple noise textures into a single image, so 1 texture fetch in the shader, can get you multiple noise variations.
Texture compression quality on packed channels can vary though.
I had a good talk with one of the WebP/JpegXL co-authors a while back, and I'd honestly love to see developers test how using the formats would affect install size and load times.
They can slowly 'frog boil' themselves into increasingly longer startup+load times,unaware of the cause.
- they want to use a noise texture, for detail and variance
- a common desire is for tileable noise without seams
- they probably want it to be high resolution
- they probably want to generate multiple unique noise textures
(now our cost is 0.13 seconds)
"I also need it to be seamless"
( now it costs 0.315 seconds )
"That looks so much nicer if we just max out the seamless blending, and the noise is tiled"
(it now costs 1second)
This records the time between the start of the 'game' , up until the 1st _process() is called on the node - this gives us a decent approximation of our startup time until we see the first rendered frame, measured in seconds.
By default, a default NoiseTexture2D with a FastNoiseLite noise takes 0.053227 sec
on my laptop. okay 1/20th of a second, not too painful sounding at first glance right?
For an artist using the editor, the texture is created in another thread and after a short delay will appear in the inspector.
I made a little class to speed up baking those textures, everyone feel free to check it out here.
You will probably have to adapt it to your project, but it can be a kind of quickstart for you :)
https://gist.github.com/nan0m/c280761802c6dfc86533d1de89d27dae