|
@@ -1,4 +1,4 @@
|
|
-import { LinearFilter, LinearMipmapLinearFilter, LinearMipmapNearestFilter, NearestFilter, NearestMipmapLinearFilter, NearestMipmapNearestFilter, RGBAFormat, DepthFormat, DepthStencilFormat, UnsignedShortType, UnsignedIntType, UnsignedInt248Type, FloatType, HalfFloatType, MirroredRepeatWrapping, ClampToEdgeWrapping, RepeatWrapping, UnsignedByteType, _SRGBAFormat, NoColorSpace, LinearSRGBColorSpace, SRGBColorSpace } from '../../constants.js';
|
|
|
|
|
|
+import { LinearFilter, LinearMipmapLinearFilter, LinearMipmapNearestFilter, NearestFilter, NearestMipmapLinearFilter, NearestMipmapNearestFilter, RGBAFormat, DepthFormat, DepthStencilFormat, UnsignedShortType, UnsignedIntType, UnsignedInt248Type, FloatType, HalfFloatType, MirroredRepeatWrapping, ClampToEdgeWrapping, RepeatWrapping, UnsignedByteType, _SRGBAFormat, NoColorSpace, LinearSRGBColorSpace, SRGBColorSpace, NeverCompare, AlwaysCompare, LessCompare, LessEqualCompare, EqualCompare, GreaterEqualCompare, GreaterCompare, NotEqualCompare } from '../../constants.js';
|
|
import * as MathUtils from '../../math/MathUtils.js';
|
|
import * as MathUtils from '../../math/MathUtils.js';
|
|
import { ImageUtils } from '../../extras/ImageUtils.js';
|
|
import { ImageUtils } from '../../extras/ImageUtils.js';
|
|
import { createElementNS } from '../../utils.js';
|
|
import { createElementNS } from '../../utils.js';
|
|
@@ -526,6 +526,17 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
[ LinearMipmapLinearFilter ]: _gl.LINEAR_MIPMAP_LINEAR
|
|
[ LinearMipmapLinearFilter ]: _gl.LINEAR_MIPMAP_LINEAR
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+ const compareToGL = {
|
|
|
|
+ [ NeverCompare ]: _gl.NEVER,
|
|
|
|
+ [ AlwaysCompare ]: _gl.ALWAYS,
|
|
|
|
+ [ LessCompare ]: _gl.LESS,
|
|
|
|
+ [ LessEqualCompare ]: _gl.LEQUAL,
|
|
|
|
+ [ EqualCompare ]: _gl.EQUAL,
|
|
|
|
+ [ GreaterEqualCompare ]: _gl.GEQUAL,
|
|
|
|
+ [ GreaterCompare ]: _gl.GREATER,
|
|
|
|
+ [ NotEqualCompare ]: _gl.NOTEQUAL
|
|
|
|
+ };
|
|
|
|
+
|
|
function setTextureParameters( textureType, texture, supportsMips ) {
|
|
function setTextureParameters( textureType, texture, supportsMips ) {
|
|
|
|
|
|
if ( supportsMips ) {
|
|
if ( supportsMips ) {
|
|
@@ -570,6 +581,13 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if ( texture.compareFunction ) {
|
|
|
|
+
|
|
|
|
+ _gl.texParameteri( textureType, _gl.TEXTURE_COMPARE_MODE, _gl.COMPARE_REF_TO_TEXTURE );
|
|
|
|
+ _gl.texParameteri( textureType, _gl.TEXTURE_COMPARE_FUNC, compareToGL[ texture.compareFunction ] );
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
if ( extensions.has( 'EXT_texture_filter_anisotropic' ) === true ) {
|
|
if ( extensions.has( 'EXT_texture_filter_anisotropic' ) === true ) {
|
|
|
|
|
|
const extension = extensions.get( 'EXT_texture_filter_anisotropic' );
|
|
const extension = extensions.get( 'EXT_texture_filter_anisotropic' );
|