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: Fixed buildMetalRoughTexture #24197

Merged
merged 1 commit into from
Jun 7, 2022
Merged

GLTFExporter: Fixed buildMetalRoughTexture #24197

merged 1 commit into from
Jun 7, 2022

Conversation

mrdoob
Copy link
Owner

@mrdoob mrdoob commented Jun 7, 2022

Fixes #24164

Description

The use of cachedCanvas resulted in #23857 breaking buildMetalRoughTexture().
Seems like a classic case of premature optimization to me.

@mrdoob mrdoob added this to the r142 milestone Jun 7, 2022
@mrdoob mrdoob merged commit 25e01cb into dev Jun 7, 2022
@repalash
Copy link
Contributor

repalash commented Jun 7, 2022

I think cached canvas can be present, and used exporting multiple images.
build roughness metalness texture function could just create a new canvas like it was happening earlier. (and dispose the texture after export)

@mrdoob
Copy link
Owner Author

mrdoob commented Jun 7, 2022

@repalash Feel free to submit a PR. Make sure it doesn't break anything 👍

@LeviPesin
Copy link
Contributor

Something like a flag passed to the getCanvas function to force creation of new canvas?

@mrdoob
Copy link
Owner Author

mrdoob commented Jun 7, 2022

I'm just not sure it's worth it...

@Mugen87
Copy link
Collaborator

Mugen87 commented Jun 7, 2022

Yeah, less not try to make the code "too smart". Makes it only harder to maintain.

@robertlong
Copy link
Contributor

Sorry I wasn't able to work on this! But I think this is the right fix for now 👍

abernier pushed a commit to abernier/three.js that referenced this pull request Sep 16, 2022
snagy pushed a commit to snagy/three.js-1 that referenced this pull request Sep 21, 2022
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.

GLTFExporter: buildMetalRoughTexture not usable
5 participants