#Fast Asset Loading

24 messages · Page 1 of 1 (latest)

verbal rover
#

I'm working on my 3d renderer with PBR shading and skeletal animation, when loading large (relatively not too large) model file with animation it takes time reading assets and create textures, packing model data into GPU buffers, loading animations, skeletal data

I wonder how games doesn't take all this time to load it's data and it may load it in runtime without any lag also it bother me while working just to change variable in shader I have to run and wait again to run this, I know it take seconds but it just a 3 model !!!!

lethal gate
#

Well, "just a 3D model" can mean anything from a few bytes to a few terabytes of data

#

For fast runtime loading you really want to have binary assets preprocessed ready to be uploaded directly to the GPU

#

You can also speed up the process of loading models from source by using a faster loader (like #1019965526434394173)

#

compressing textures with BCn formats is good for runtime and load times

#

likewise quantizing mesh data

#

optimizing models for realtime use by simplifying meshes to include detail only where it needs to be

#

You can apply additional lossless compression to all assets to reduce storage bandwidth limitations

#

(and PCIe bandwidth if you decompress on the GPU, e.g. using GDEFLATE)

verbal rover
#

Hmmm that's nice so should I do this for build only ?! For example is unity engine reload all assets again each time I open project?!

#

Any resources help me cache my assets into Binary files

lethal gate
#

just lots of binary (de)serialization, quantizing mesh data, texture compression, and/or lossless compression

verbal rover
#

Ok any resources for that how to learn that

lethal gate
#

For simplifcation/quantization
https://github.com/zeux/meshoptimizer
Quantization
https://johnwhite3d.blogspot.com/2017/10/signed-octahedron-normal-encoding.html?view=classic
https://www.jeremyong.com/graphics/2023/01/09/tangent-spaces-and-diamond-encoding/
Runtime texture compression
https://www.reedbeta.com/blog/understanding-bcn-texture-compression-formats/
Lossless decompression on the GPU (this is more of an extra thing, you can do this later or not at all)
https://github.com/NVIDIA/libdeflate
to name a few (there's a lot more out there)

I don't have any good resources on binary serialization since that's mostly just simply reading/writing header structs and blobs of data

verbal rover
#

Ok thanks

river sparrow
#

Profile to see what is slow in your loading code. For example if you load images from png, decoding is likely way too slow. Using imagw format that does not need decoding step when loading ö can make a big difference.

river sparrow
#

Ideally files that you load contain data that can be directly uploaded to textures and buffers. You may choose to compress that data, to make app take less space on device and download, but it probably will slow down loading times slightly.

lethal gate
#

with GPU decompression it'll speed up loading times with larger assets

#

assuming you have enough decompression throughput to max out the PCIe still (which is likely on any GPU that would be reasonably handling large assets in the first place)

river sparrow
#

True. Although it is still relatively new tech, I am not sure how widely it is supported.

lethal gate
#

wave intrinsics are preferred, but not required

#

the I/O side of DirectStorage-like access, that is BypassIO on Windows, is a lot less supported