I have a lot of opaque geometries. Some of them have UVs but the others have only positions and normals. Let’s say they all use the same PBR materials with almost the same configuration. So basically I will have two define sets, one has uv and Albedo texture as true and the other as false. As a result Babylon will have to generate two shaders.
So how can we guarantee the best rendering performance?
- Does Babylon cache the shaders so that we don’t recompile it when we detect an attribute change?
- Do we need to sort the geometries so that we can avoid switching between the shaders too frequently ?