Hello Deltakosh, hello Wingnut and the whole Babylon Team!
It’s us again, Mainequin. Thank you for your tireless work, it has been a pleasure using Babylon JS so far.
We currently have a usecase, where we need to display furniture with a lot of different possible materials. We do this by unwrapping a table for example, baking it’s lightmap and then defining a texture scale. This texture scale defines a relation between object surface and uv layout, such that 1x1m surface is 1x1 units in uv space.
Then we map a diffuse texture like wood onto the object and define how often this texture repeats on this 1x1m. This gives us incredibly high texture resolution with low bandwith requirements and we can reuse the material textures on different models.
The problem with this method is, that the rotation of the wood texture on the object is defined by the lightmap-layout.
So our first question is:
Do we currently have the option in babylon JS to use a secondary UV-map? Such that we have a UV_lightmap for lightmap.jpg and a UV_material for wood_diffuse.jpg? It would give us a lot more control over the end result and simplify our workflow greatly.
Recently we played around with morph targets and we saw the potential of parametric meshes. We really want to define maybe three parameters for said table like width, length and leg thickness for example, which works almost flawlessly. Except: With our setup the texture will stretch accordingly, since the UV remains unchanged while morphing.
So our second question is:
If we can use a secondary UV, would it be possible to allow morphing of UV-coordinates? We don’t know of any software that can export this kind of morphing, but we can simply build a script that will add the desired UVs in the respective morph-target in the JSON structure.
We would gladly sacrifice another attribute per morph of the 16-attribute limit to do this.
As always thank you very much for your time and dedication
The Mainequin Team