Skip to content

Remove multiple flips of the V texcoord in MaterialXView (upon glTF load and when accessing textures)#2882

Closed
bhouston wants to merge 2 commits intoAcademySoftwareFoundation:mainfrom
bhouston:remove-gltf-v-texcoord-flipping
Closed

Remove multiple flips of the V texcoord in MaterialXView (upon glTF load and when accessing textures)#2882
bhouston wants to merge 2 commits intoAcademySoftwareFoundation:mainfrom
bhouston:remove-gltf-v-texcoord-flipping

Conversation

@bhouston
Copy link
Copy Markdown

@bhouston bhouston commented May 5, 2026

Fixes the issue identified here: #2881

The MaterialXViewer flips V texture coordinates of obis and glTF files upon load. It also flips the V texture coordinate when accessing textures. I believe both of these flips are incorrect. Neither should exist. This PR removes both of them.

It leads to simpler code but also now the UV space of a mesh does not have to be modified in order to render it.

Lastly, math operations in a flip UV space are not the same as in a non-flipped UV space. Thus this flipped UV space leads to incorrect math results:

prefliped V with math != post-flipped V with math

flipV(V) + 0.1 != flipV( V + 0.1 )
( 1 - V ) + 0.1 != 1 - ( V + 0.1 )
1.1 - V != 0.9 - V

And also pre flipped + post-flipped V doesn't equal no flipping:

flipV( flipV(V) + 0.1 ) !== V + 0.1
1 - ( 1 - V + 0.1 ) != V + 0.1
1 - 1 + V - 0.1 != V + 0.1
V - 0.1 != V + 0.1

@bhouston bhouston changed the title Remove the flipping of the V texcoord upon glTF load. WIP Do Not Merge: Remove the flipping of the V texcoord upon glTF load. May 5, 2026
@bhouston bhouston changed the title WIP Do Not Merge: Remove the flipping of the V texcoord upon glTF load. Remove multiple flips of the V texcoord in MaterialXView (upon glTF load and when accessing textures) May 5, 2026
@bhouston
Copy link
Copy Markdown
Author

bhouston commented May 5, 2026

This was an incorrect PR. glTF's UV space is flipped compared to MaterialX/Blender.

@bhouston bhouston closed this May 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant