LC_MESH_MAX_DATA_COUNT
The max. number of UVs, Colors and Alphas sets associated to mesh vertices is 6. It is a parameter (LC_MESH_MAX_DATA_COUNT) defined at LuxCore compilation time.
PLY file format
PLY file format doesn't natively support multiple UVs, Colors and Alphas so I had to extend the file format. Usually UVs are defined as "s" and "t" vertex channels, I added the support for "s1/"t1", "s2"/t2", etc. up to LC_MESH_MAX_DATA_COUNT. "red1"/"green1"/blue1", "red2"/"green2"/blue2", etc. for colors and "alpha1", "alpha2", etc. for alphas.
uvmapping2d and uvmapping3d
Now texture mapping uvmapping2d and uvmapping3d accept an additional parameter (".uvindex") where you can select the data set to use:
Code: Select all
scene.textures.tex1.type = imagemap
scene.textures.tex1.file = map.png
scene.textures.tex1.gamma = 2.2
scene.textures.tex1.mapping.type= uvmapping2d
scene.textures.tex1.mapping.uvindex = 1
scene.textures.tex1.mapping.uvscale = 2 2
Now textures hitpointcolor, hitpointalpha and hitpointgrey accept an additional parameter (".dataindex") where you can select the data set to use.
Implicit usage
UVs coordinates are implicitly used in many other contexts. For instance, Glossy material anisotropic direction, Cloth material direction, Pointiness, etc. At the moment, they are all still using the first UV data set (i.e. index 0). Eventually, the support for an explicit selection of the UV data set to use can be easily added.
Scene::DefineMeshExt()
Scene::DefineMeshExt() is the new method used in LuxCore API to define meshes with multiple vertex data sets.