- Home /
Shader.WarmupAllShaders ? What it does?
Please can someone enligten me what this function is good for with some simple explanation or example coe how to use it?
Shader.WarmupAllShaders
Answer by Bunny83 · Feb 14, 2012 at 04:12 PM
Isn't the description in the docs enough?
Fully load all shaders to prevent future performance hiccups.
Usually graphics drivers do not actually prepare shaders until they are first needed. However when some object is first rendered with a previously unused shader, there can be a hiccup because the driver is compiling/optimizing the shader. This can be quite noticeable on mobile platforms.
Calling this function will perform dummy one-invisible-triangle rendering with all permutations of all currently loaded shaders. This can take some time but helps to avoid hiccups in the future.
I read documentation first prior asking question. :) I was more about some example when to best call this function and in which context. Also if anyone have som experience of benefit of using this on mobile platform or in general, I would appreciate this info.
Your answer
![](https://koobas.hobune.stream/wayback/20220613064100im_/https://answers.unity.com/themes/thub/images/avi.jpg)