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

Fix mipmap generation #1148

Merged
merged 4 commits into from
Jun 24, 2019
Merged

Fix mipmap generation #1148

merged 4 commits into from
Jun 24, 2019

Conversation

xintongxia
Copy link
Contributor

@xintongxia xintongxia commented Jun 21, 2019

For #1147 and #1146

Background

Change List

  • check mipmap enabled before calling generateMipmaps
  • add test

@coveralls
Copy link

coveralls commented Jun 21, 2019

Coverage Status

Coverage decreased (-5.2%) to 41.186% when pulling 1b94ab6 on xx/mipmaps into 400846b on master.

modules/webgl/test/classes/texture.spec.js Outdated Show resolved Hide resolved
@@ -195,14 +195,23 @@ export default class Texture extends Resource {
type: this.type,
dataFormat: this.dataFormat,
border: this.border,
mipmaps: false
mipmaps: this.mipmaps
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This logic doesn't seem correct to me. What if you resize from a POT to NPOT size?

A better solution to me would be to just pass in mipmapping as an additional parameter (default to false).

Copy link
Contributor Author

@xintongxia xintongxia Jun 23, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tsherif

inside resize, it calls initialize, which will check if the texture is NPOT or not and disable mipmap for NPOT. But it is a problem if the user resizes the texture from POT to NPOT and then back to POT, the mipmap will be false.

maybe allow user to pass in mipmapping as a parameter and fallback to this.mipmaps?

modules/webgl/src/classes/texture.js Show resolved Hide resolved
@tsherif
Copy link
Contributor

tsherif commented Jun 24, 2019

Looks great, @xintongxia

@xintongxia xintongxia merged commit 53026ec into master Jun 24, 2019
@xintongxia xintongxia deleted the xx/mipmaps branch June 24, 2019 17:09
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.

None yet

4 participants