Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/renderers/webgl/WebGLCapabilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ function WebGLCapabilities( gl, extensions, parameters ) {

if ( maxAnisotropy !== undefined ) return maxAnisotropy;

const extension = extensions.get( 'EXT_texture_filter_anisotropic' );
if ( extensions.has( 'EXT_texture_filter_anisotropic' ) === true ) {

if ( extension !== null ) {
const extension = extensions.get( 'EXT_texture_filter_anisotropic' );

maxAnisotropy = gl.getParameter( extension.MAX_TEXTURE_MAX_ANISOTROPY_EXT );

Expand Down Expand Up @@ -80,7 +80,7 @@ function WebGLCapabilities( gl, extensions, parameters ) {
const maxFragmentUniforms = gl.getParameter( gl.MAX_FRAGMENT_UNIFORM_VECTORS );

const vertexTextures = maxVertexTextures > 0;
const floatFragmentTextures = isWebGL2 || !! extensions.get( 'OES_texture_float' );
const floatFragmentTextures = isWebGL2 || extensions.has( 'OES_texture_float' );
const floatVertexTextures = vertexTextures && floatFragmentTextures;

const maxSamples = isWebGL2 ? gl.getParameter( gl.MAX_SAMPLES ) : 0;
Expand Down
8 changes: 4 additions & 4 deletions src/renderers/webgl/WebGLTextures.js
Original file line number Diff line number Diff line change
Expand Up @@ -453,12 +453,12 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,

}

const extension = extensions.get( 'EXT_texture_filter_anisotropic' );
if ( extensions.has( 'EXT_texture_filter_anisotropic' ) === true ) {

if ( extension ) {
const extension = extensions.get( 'EXT_texture_filter_anisotropic' );

if ( texture.type === FloatType && extensions.get( 'OES_texture_float_linear' ) === null ) return;
if ( texture.type === HalfFloatType && ( isWebGL2 || extensions.get( 'OES_texture_half_float_linear' ) ) === null ) return;
if ( texture.type === FloatType && extensions.has( 'OES_texture_float_linear' ) === false ) return; // verify extension for WebGL 1 and WebGL 2
if ( isWebGL2 === false && ( texture.type === HalfFloatType && extensions.has( 'OES_texture_half_float_linear' ) === false ) ) return; // verify extension for WebGL 1 only

if ( texture.anisotropy > 1 || properties.get( texture ).__currentAnisotropy ) {

Expand Down