- Home /
Spikes for Render.Prepare
I am getting Spikes in my profiler for Render.Prepare specifically in Loading.LoadFileHeaders. What is the best way to remove them?
Answer by Diet-Chugg · May 18, 2013 at 11:47 PM
Make all your textures load before you use them in the scene by creating a fake loading screen which has all the objects you use in the scene render behind the loading screen. Disable all those objects immediately afterward.
I'm doing a Application.LoadLevelAdditiveAsync(), and I'm not allowing any of it to be rendered until it's done with the level load according to the AsyncOperation. Should I be waiting for something different in order for the textures referenced in that scene to be loaded?
I'm seeing big hits in Loading.LoadFileHeaders and also sometimes in Shader.SetPass on certain shaders (really long pause, as if the shader is compiling or something, looks like the first time they're rendered).