Uvs2 or uv2s? Which one is correct?

The exporters like MayaToBabylon and MaxToBabylon are exporting with babylon meshes with uvs and uvs2 arrays.

   [DataMember]
        public float[] uvs { get; set; }

        [DataMember]
        public float[] uvs2 { get; set; }

But the .babylon file format documentation FileFormat Map (.babylon) - Babylon.js Documentation for VertexData says the below

    "uvs": array of floats (2 per vertex),
        "uv2s": array of floats (2 per vertex) which is the 2nd texture coordinates (can be omitted),
        "uv3s": array of floats (2 per vertex) which is the 3nd texture coordinates (can be omitted),
        "uv4s": array of floats (2 per vertex) which is the 4nd texture coordinates (can be omitted),
        "uv5s": array of floats (2 per vertex) which is the 5nd texture coordinates (can be omitted),
        "uv6s": array of floats (2 per vertex) which is the 6nd texture coordinates (can be omitted),

Documentation for Mesh says below.

    "uvs": array of floats (2 per vertex),
        "uvs2": array of floats (2 per vertex) which is the 2nd texture coordinates (can be omitted),
        "uv3s": array of floats (2 per vertex) which is the 3nd texture coordinates (can be omitted),
        "uv4s": array of floats (2 per vertex) which is the 4nd texture coordinates (can be omitted),
        "uv5s": array of floats (2 per vertex) which is the 5nd texture coordinates (can be omitted),
        "uv6s": array of floats (2 per vertex) which is the 6nd texture coordinates (can be omitted),

If you see, vertexData has attribute uv2s and mesh has attribute uvs2.

Now my question is what are the valid attribute names?
(uvs2, uvs3, uvs4, uvs5, uvs6) or (uv2s, uv3s, uv4s, uv5s, uv6s) ?

There is a confusion here. Moreover, as there are “3nd”, “4nd”, “5nd” instead of “3rd”, “4th”, “5th” in these sentences, I am assuming that it is due to some copy/paste.
It gives a feeling that some mistake is done when documenting uvs2, uv2s etc.
Can you please clarify?

Thanks in advance.

1 Like

These appear to be typos :slight_smile:
uvs2, uvs3, etc is correct.

https://doc.babylonjs.com/api/classes/babylon.vertexdata#uvs

1 Like

I will fix the doc :slight_smile:

1 Like

Thank you @deltakosh

We need more information on this topic.
I think 1st texture is diffuse texture.
What does it mean by 2nd texture, 3rd texture…6th texture?

Is there any documentation which talks about how exactly the texturing happens?
For example, if I want to parse and render a .Babylon file in Windows using directx/sharper, i must understand the significance of every field in that file.
I am looking for such deep understanding and knowledge.

I am now learning directx so that I will get deep exposure to the fundamentals of this 3D world. I set my first goal in this journey that I must be able to render any .Babylon file using directx.

Then I would like to apply for the open positions in your organization. I hope you consider the profile of your ex employee (Microsoft). :blush:

There are not textures but texture coordinates

A texture can decide with one to use with texture.coordinatesIndex. For instance if this value is set to 0 the uvs will be used and so on

1 Like