Hello all, as we all know shader compilation time on the browser is a bit slower than we’d like and that is just a limitation with browsers today. Im curious, what is the fastest type of material to compile. Im guessing PBRBaseSimpleMaterial? Im trying to sorta create a fallback shader for browsers that take for ever to compile shaders especially those that dont support parallel shader compile. (if such a fallback shader mode already exists… please do tell!)
I believe the fastest is the simplest Node Material like here - https://nme.babylonjs.com/
that is certainly true. But what I meant is something that has all the basics to represent a shaded surface (normal maps, specular, albedo etc). but perhaps does not have all the complexities of PBR and something that is available currently in the API without the need to build a node material or a custom material plugin. An ultra-fast minimal fallback material would certainly come in handy for those with lower end devices.
All PBR classes rely on
PBRBaseMaterial for their base class, so you won’t get any benefit from using
If possible, try to fall back on
StandardMaterial, which is less complicated than a PBR material and compiles faster. If you can’t, you should disable as many of your PBR material’s features as possible (refraction, sheen, clearcoat, etc.) so that there’s less code and it compiles faster.
I have been thinking lately about Background material, but it was in the context of execution, not compile.
Thinking it might be slightly less than Standard, since think there are no lights, but have no idea about compile time.