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

GLTFExporter: Fix buildORMTexture() #23463

Merged
merged 1 commit into from
Feb 11, 2022
Merged

Conversation

takahirox
Copy link
Collaborator

Description

Currently buildORMTexture() in GLTFExporter returns Texture.image if aoMap.image, roughnessMap.image, and metalnessMap.image are identical but it should return Texture for the type consistency and the return value is used for processTexture(), passing Texture.image to it can cause an error.

This PR fixes the problem by returning Texture.

This is just an easy and quick fix. We may need some more tweaks and clean up.

Currently buildORMTexture() returns Texture.image
if aoMap.image, roughnessMap.image, and metalnessMap.image
are identical but it should return Texture.
This PR fixes the problem by returning Texture.
@mrdoob
Copy link
Owner

mrdoob commented Feb 11, 2022

Oh, that's actually a bug yeah.

@mrdoob mrdoob added this to the r138 milestone Feb 11, 2022
@mrdoob mrdoob merged commit 8bea2a8 into mrdoob:dev Feb 11, 2022
@mrdoob
Copy link
Owner

mrdoob commented Feb 11, 2022

Thanks!

@takahirox takahirox deleted the FixGLTFExporter branch February 11, 2022 22:38
donmccurdy pushed a commit to donmccurdy/three.js that referenced this pull request Mar 10, 2022
Currently buildORMTexture() returns Texture.image
if aoMap.image, roughnessMap.image, and metalnessMap.image
are identical but it should return Texture.
This PR fixes the problem by returning Texture.
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.

2 participants