[WebGL2] NPOT Texture should not fallback in webgl2

Description of the problem

These fallback logic should be skipped in webgl2:

// webgl2 skip this
_gl.texParameteri( textureType, _gl.TEXTURE_WRAP_S, _gl.CLAMP_TO_EDGE );
_gl.texParameteri( textureType, _gl.TEXTURE_WRAP_T, _gl.CLAMP_TO_EDGE );
_gl.texParameteri( textureType, _gl.TEXTURE_MAG_FILTER, filterFallback( texture.magFilter ) );
_gl.texParameteri( textureType, _gl.TEXTURE_MIN_FILTER, filterFallback( texture.minFilter ) );

// isPowerOfTwo should be (isPowerOfTwo || webgl2)
function textureNeedsGenerateMipmaps( texture, isPowerOfTwo ) {
	return texture.generateMipmaps && isPowerOfTwo &&
			texture.minFilter !== NearestFilter && texture.minFilter !== LinearFilter;
}
Three.js version
  • Dev
  • r100
Browser
  • All of them
  • Chrome
  • Firefox
  • Internet Explorer
OS
  • All of them
  • Windows
  • macOS
  • Linux
  • Android
  • iOS

Author: Fantashit

1 thought on “[WebGL2] NPOT Texture should not fallback in webgl2

Comments are closed.