Skip to content

Commit 4ba585c

Browse files
author
aardgoose
committed
replicate WebGPU texture filtering
1 parent 00ee0b3 commit 4ba585c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

examples/jsm/renderers/webgl/utils/WebGLTextureUtils.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,12 @@ class WebGLTextureUtils {
183183
}
184184

185185
gl.texParameteri( textureType, gl.TEXTURE_MAG_FILTER, filterToGL[ texture.magFilter ] );
186-
gl.texParameteri( textureType, gl.TEXTURE_MIN_FILTER, filterToGL[ texture.minFilter ] );
186+
187+
188+
// follow WebGPU backend mapping for texture filtering
189+
const minFilter = texture.minFilter === LinearFilter ? LinearMipmapLinearFilter : texture.minFilter;
190+
191+
gl.texParameteri( textureType, gl.TEXTURE_MIN_FILTER, filterToGL[ minFilter ] );
187192

188193
if ( texture.compareFunction ) {
189194

0 commit comments

Comments
 (0)