UV Mapping - does this look correct?

Hi

I am creating a flat, 2D mesh, programmatically. The usual vertices and triangles, and all works a treat. My next challenge - is to map a material / texture onto a single ‘square’ - i.e. two triangles that share 4 vertices. I am getting the following…where the orange just bleeds into the next ‘cell’. The material is a basic orange square with blue border - so i can see the actual lining up. Three sides ( top , left , bottom ) show the blue border places correctly, but then the rhs bleeds over. I have tried for hours to resolve and then I thought - is this how UVs work and what i am trying to do - individually address each cell, is not that easy (possible)?

Happy to post code if this looks wrong, but if this is how UV behaves, I clearly have some work to do :).

many thanks

Malcolm

Image 1 : what I get…

7466872--917111--upload_2021-9-2_1-10-49.png

Image 2: What i want ; expected :slight_smile:

7466872--917117--upload_2021-9-2_1-15-50.png7466872--917111--upload_2021-9-2_1-10-49.png 7466872--917117--upload_2021-9-2_1-15-50.png

I think the loop that creates the vertices is created in the wrong way, or not consistent with how i am creating the UV array. I will leave the post up and will hopefully answer my own question after i’ve had a few hours sleep .

Vertexes and UVs are shared 1-to-1 in Unity.

It’s not possible to have a single vertex be in two different places in the UV map.

Instead, you need to make 2 vertices: their positions would be identical, but their UV position would differ and they would belong to different faces (triangles).

This would enable one face to be pure orange (all of its verts point into orange texture), and another face to be pure blue (all of its verts point into blue), with no bleeding or blending.

If you’re curious about more mesh generation, check out my Makegeo project:

MakeGeo is presently hosted at these locations:

https://bitbucket.org/kurtdekker/makegeo