So this is my first question
Generated from OpenStreetMap-data I have XYZ- and UV-values and a texture-material.
I generate a BABYLON.Mesh(“custom” for i.e an OSM-building.
Now I have many buildings with different colors.
So I use subMeshes and a MultiMaterial. A City is visible, fine.
BUT!: Some of the buildings have windows, done by a 2nd transparent Texture.
An in this case there are two sets of UV-values!
(As there are many combinations of textures, I can’t make one mixed texture.)
With ThreeJS, I solved this by a workaround :
I used both sets of UV, duplicated the XYZ and added two subMeshes and two materials.
But that doubles the GPU load too.
I assume, a shader-material should be used. But I do not know shaders
Babylon certainly offers more than one solution to this.
Is there a Multi-Texture-Material?
If Shader, could someone show me the way? A playground would be heaven.
- Materials with two Textures in a multiMaterial should be no problem.
- Do I have just to add the two sets of UV-values in the UV array?
- Do I NOT have to double the XYZ values?