Преглед изворни кода

WebGPURenderer: Fix linear filter textures w/o mipmaps (#29172)

Renaud Rohlinger пре 1 година
родитељ
комит
00e8861b43
1 измењених фајлова са 3 додато и 1 уклоњено
  1. 3 1
      src/renderers/webgl-fallback/utils/WebGLTextureUtils.js

+ 3 - 1
src/renderers/webgl-fallback/utils/WebGLTextureUtils.js

@@ -259,8 +259,10 @@ class WebGLTextureUtils {
 		gl.texParameteri( textureType, gl.TEXTURE_MAG_FILTER, filterToGL[ texture.magFilter ] );
 		gl.texParameteri( textureType, gl.TEXTURE_MAG_FILTER, filterToGL[ texture.magFilter ] );
 
 
 
 
+		const hasMipmaps = texture.mipmaps !== undefined && texture.mipmaps.length > 0;
+
 		// follow WebGPU backend mapping for texture filtering
 		// follow WebGPU backend mapping for texture filtering
-		const minFilter = ! texture.isVideoTexture && texture.minFilter === LinearFilter ? LinearMipmapLinearFilter : texture.minFilter;
+		const minFilter = texture.minFilter === LinearFilter && hasMipmaps ? LinearMipmapLinearFilter : texture.minFilter;
 
 
 		gl.texParameteri( textureType, gl.TEXTURE_MIN_FILTER, filterToGL[ minFilter ] );
 		gl.texParameteri( textureType, gl.TEXTURE_MIN_FILTER, filterToGL[ minFilter ] );
 
 

粤ICP备19079148号