Open ChocolateRacoon opened 7 months ago
Hi,
You've been using TimeBudgetPerFrameDeferAgent
correctly, but there might be a misunderstanding what it actually does.
Whenever the glTF loading procedure reaches certain milestones the defer agent can decide if the process continues within this frame or "call it a frame" and defer further processing to the next frame. Unfortunately the procedure cannot be stopped at any arbitrary time, so even if you set a low enough time budget a bigger chunk of the process might stall your rendering, especially on weaker hardware.
After I had a glimpse on your model I noticed you use many, quite large PNG textures. Those are likely the problem, as the decoding happens on the main thread (Unity API limitation).
I recommend encoding all textures as KTX Basis Universal files and use KTX for Unity to load them (supported by glTFast). Those are transcoded in a thread and usually load with less friction.
hth
Hello,
Could you please tell me if there is any way to get rid of freeze frames?
As far as I understand, the use of IDeferAgent is intended specifically for loading multiple models and increases the frame rate by queuing. Freeze frames occur even when loading one model.
Files
Model (glb): https://sketchfab.com/3d-models/warcraft-3-alliance-footmanfanmade-201452e568064aedadccfafb668ef6a5
Script
To Reproduce
Steps to reproduce the behavior:
Expected behavior
We get a frame freeze
Video
https://github.com/atteneder/glTFast/assets/108283613/d4f69fd1-83c9-4d52-a441-f48767b895af
Additional data
Device
Optional
As I understand, parameter GenerateMipMaps = true
is very hard for the app.
Setting this parameter to False reduced the peaks (according to the profiler data), but it still doesn't look good. Below I present the profiler data when loading GLTF via gltf fast
GenerateMipMaps = true
GenerateMipMaps = false