-
Notifications
You must be signed in to change notification settings - Fork 207
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
Fix mipmap generation #1148
Conversation
modules/webgl/src/classes/texture.js
Outdated
@@ -195,14 +195,23 @@ export default class Texture extends Resource { | |||
type: this.type, | |||
dataFormat: this.dataFormat, | |||
border: this.border, | |||
mipmaps: false | |||
mipmaps: this.mipmaps |
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
?
Looks great, @xintongxia |
For #1147 and #1146
Background
Change List