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

FlipY flag in gltf ? #736

Closed
AurL opened this issue Oct 4, 2016 · 7 comments
Closed

FlipY flag in gltf ? #736

AurL opened this issue Oct 4, 2016 · 7 comments

Comments

@AurL
Copy link

AurL commented Oct 4, 2016

Hi,

I have a question regarding this point in the glTF spec:

Implementation Note: With WebGL API, the first pixel transferred from the TexImageSource (i.e., HTML Image object) to the WebGL implementation corresponds to the upper left corner of the source. Non-WebGL runtimes may need to flip Y axis to achieve correct texture rendering.

Do we really expect almost all the 3D softwares to flip all their textures to fit this model so that referenced images are correctly oriented in the output glTF file?
Is there any plan on adding a flag to know if a texture actually needs to have the Flip-Y flag enabled?

I understand that glTF is built closely to OpenGL spec (that uses top/left corner as image origin), but when we think about it's use as transport format by 3d softwares (and also as a replacement of the proprietary FBX format), this point seems to bring a limit that could be seen as a real drawback.

What's the actual reason doing this ? Maybe I am missing something?

Any detail is welcome, thanks for your time!

@lexaknyazev
Copy link
Member

glTF 1.0 targets mainly WebGL 1.0. Next version of the format should have pixel transfer flags.

@lexaknyazev
Copy link
Member

Also see #674.

@donmccurdy
Copy link
Contributor

I'm working on PBR support in THREE.GLTFLoader, and noticing that the Sketchfab/Unity glTF exporter includes a flipY flag.

Is this intended for the spec, or should I file a bug with the exporter?

@AurL
Copy link
Author

AurL commented Feb 17, 2017

It not intended for the spec or a bug actually. At the moment of the development, we added this flag in order to know what was the orientation of the textute. We added this flag as a fallback as we were generating files from Unity that has it set to true (contrary to glTF that has it false)
It's not official, as mentionned in the README.

Moreover, materials doesn't perfectly fit the specification of the PBR extension. For example, we split metalness and roughness into two distinct textures.

This code is being updated to fit with the progress of glTF 2.0, but for now you might find some out-of spec contents in our files

@donmccurdy
Copy link
Contributor

Ok great, thanks!

@pjcozzi
Copy link
Member

pjcozzi commented Feb 18, 2017

Thanks for the quick response, @AurL. @donmccurdy we're really looking forward to glTF 2.0 support in three.js!

@lexaknyazev OK to close this?

@lexaknyazev
Copy link
Member

Yes, this could be closed and texture origin should be defined as a part of #835.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants