Skip to content

Commit

Permalink
replicate WebGPU texture filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
aardgoose committed Dec 22, 2023
1 parent 30b19e3 commit cffdad4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion examples/jsm/renderers/webgl/utils/WebGLTextureUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,12 @@ class WebGLTextureUtils {
}

gl.texParameteri( textureType, gl.TEXTURE_MAG_FILTER, filterToGL[ texture.magFilter ] );
gl.texParameteri( textureType, gl.TEXTURE_MIN_FILTER, filterToGL[ texture.minFilter ] );


// follow WebGPU backend mapping for texture filtering
const minFilter = texture.minFilter === LinearFilter ? LinearMipmapLinearFilter : texture.minFilter;

gl.texParameteri( textureType, gl.TEXTURE_MIN_FILTER, filterToGL[ minFilter ] );

if ( texture.compareFunction ) {

Expand Down

0 comments on commit cffdad4

Please sign in to comment.