Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The texture of the Simple Texture model of glTF 2.0 is upside down #2

Closed
cx20 opened this issue Feb 5, 2017 · 8 comments
Closed

The texture of the Simple Texture model of glTF 2.0 is upside down #2

cx20 opened this issue Feb 5, 2017 · 8 comments

Comments

@cx20
Copy link
Contributor

cx20 commented Feb 5, 2017

I think that it is probably a mistake, but it seems that the orientation of the texture is reversed in glTF 1.1 and 2.0 models.

https://github.com/javagl/gltfTutorialModels/blob/master/SimpleTexture/glTF/square.bin
image

https://github.com/javagl/gltfTutorialModels/blob/2.0/SimpleTexture/glTF/square.bin
image

@javagl
Copy link
Owner

javagl commented Feb 5, 2017

Drawing the connection between javagl/JglTF#10 (comment) and more importantly CesiumGS/cesium#4808 (comment) - and as you can see in these links: It's difficult.

The texture coordinates have been flipped for the 2.0 version of the models, as per request in the second link.

Ironically, this was supposed to avoid confusion ;-)

However, now I have also updated the texture image (the PNG file), and added a note in the README at https://github.com/javagl/gltfTutorialModels/blob/master/SimpleTexture/README.md , emphasizing that the texture image now actually shows the real texture coordinates.

Also, another disclaimer: Much of the discussion around 2.0 is not finalized. The models here are highly preliminary.

@cx20
Copy link
Contributor Author

cx20 commented Feb 6, 2017

I am confused again. :-(
Is it correct that the results of Screenshot and glTF Loader are different?

Version Texture README's Screenshot Three.js result
glTF Tutorial 1.1
glTF Tutorial 2.0

@javagl
Copy link
Owner

javagl commented Feb 6, 2017

Sorry, this....

The texture coordinates have been flipped for the 2.0 version of the models, as per request in the second link.

... was misleading: The 2.0 branch is not yet completely updated!

Particularly, the "SimpleTexture" model in the 2.0 branch is older than the "SimpleTexture" model in the 1.1 branch. In the 1.1 branch, the texture is flipped and the texture coordinates are updated. In the 2.0 branch, this is not done yet.

The following models have been updated to 2.0, as far as this is possible:

Triangle
TriangleWithoutIndices     
AnimatedTriangle
Cameras
SimpleMeshes
SimpleMaterial

But these models are still in an old 1.1-ish state:

SimpleOpacity
SimpleSkin
SimpleTexture

Sorry, I know that this is a mess. But the update to 2.0 came like a bolt from the blue. The changes between 1.0 and 2.0 mean that much of the existing code basically has to be rewritten or at least heavily refactored. Beyond that, it's still not clear whether the tutorial should cover PBR (which is still far from being finalized), or whether the tutorial models should be based on PBR or on KHR_technique_webgl (which isn't finalized either).

The best thing would probably be to not rely on this gltfTutorialModels repository until the dust around 2.0 has settled. (Also see KhronosGroup/glTF-Sample-Models#27 (comment) )

@cx20
Copy link
Contributor Author

cx20 commented Feb 6, 2017

The 2.0 branch is not yet completely updated!

I understood. I will try again when the model is updated.

@javagl
Copy link
Owner

javagl commented Feb 7, 2017

@cx20 I have pushed the latest state at 7dfcda6 , but again: This should be considered as preliminary. I think it does not really make sense to test loaders and viewers against glTF 2.0 when glTF 2.0 and the extension that is required to use techniques+programs+shaders are not finalized yet...

@cx20
Copy link
Contributor Author

cx20 commented Feb 7, 2017

The SimpleTexture model is not displayed in the latest version.
2db67bc#diff-100fee0de5023bc5ec08ae270ece77b0R66

 "uri": "unitSquare0.bin", 

It seems that unitSquare0.bin does not exist.

This should be considered as preliminary.

I think so, too. I would like to update the sample again when the specifications have made progress.

@javagl
Copy link
Owner

javagl commented Feb 7, 2017

Right now, I cannot even test the models myself - I have not yet set up the infrastructure to load 2.0. There also is no validator for 2.0, so using these models probably does not make sense.

I'll notify you when they are merged into master (here or in the Khronos repo), and when they can be used for first tests.

@javagl
Copy link
Owner

javagl commented Dec 27, 2023

The SimpleTexture model that will be added to the glTF-Sample-Assets repo as part of KhronosGroup/glTF-Sample-Assets#90 should have the right texture.

@javagl javagl closed this as completed Dec 27, 2023
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

No branches or pull requests

2 participants