Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Can a single vertex have multiple UV coordinates depending on how many faces it belongs to? #138

@jimver04

Description

@jimver04

Hi,

Let us assume that we have two triangles connected to make a quad.

I use gltf-sdk to export the quad with 4 UV texture coordinates, one per vertex, as follows.

The upper triangle (T1) has all 3 UV coordinates as pink (3 dots at pink pixel in the example)
image

whereas the lower triangle (T2) has 1 new UV coordinate (1 dot at green) and two old pink UV coordinates from T1
image

So far so good.

In Blender3D, when I select the face of T2, I can change the UV coordinate of the shared upper vertex for T2,
image

the part of T2 at shared vertex become green without affecting T1.
image

When I export from Blender3D to gltf, this shared vertex that has different UV coordinate for T1 vs T2,
becomes duplicated:

image

From what I have understood, GLTF format does not allow a vertex to have two UV coordinates. See this stackoverflow: https://gamedev.stackexchange.com/questions/140132/how-can-i-use-blender-style-uvs-and-not-per-vertex-in-opengl
whereas Blender allows it. Blender uses all features of OpenGL whereas GLTF is let us say a "gpu friendly" format (https://stackoverflow.com/questions/61521259/vertex-normal-texture-uv-coordinate).

  • Does gltf-sdk support vertex duplication when one vertex has two or more UV coordinates depending on how many faces it belongs?
  • Is there any library that can be used within gltf-sdk to do the duplication seamingless ?
  • Is ACCESSOR_TEXCOORD_1 something operational different from ACCESSOR_TEXCOORD_0, does it offer extra capabilities like vertex duplication like in this specific case ?

Best,
Dimitrios

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions