Просмотр исходного кода

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

Renaud Rohlinger 1 год назад
Родитель
Сommit
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 ] );
 
 
+		const hasMipmaps = texture.mipmaps !== undefined && texture.mipmaps.length > 0;
+
 		// 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 ] );
 

粤ICP备19079148号