|
@@ -45,8 +45,14 @@ import { CubeTexture } from '../../textures/CubeTexture.js';
|
|
|
import { Texture } from '../../textures/Texture.js';
|
|
|
import { DataArrayTexture } from '../../textures/DataArrayTexture.js';
|
|
|
import { Data3DTexture } from '../../textures/Data3DTexture.js';
|
|
|
+import { DepthTexture } from '../../textures/DepthTexture.js';
|
|
|
+import { LessEqualCompare } from '../../constants.js';
|
|
|
|
|
|
const emptyTexture = /*@__PURE__*/ new Texture();
|
|
|
+
|
|
|
+const emptyShadowTexture = /*@__PURE__*/ new DepthTexture( 1, 1 );
|
|
|
+emptyShadowTexture.compareFunction = LessEqualCompare;
|
|
|
+
|
|
|
const emptyArrayTexture = /*@__PURE__*/ new DataArrayTexture();
|
|
|
const empty3dTexture = /*@__PURE__*/ new Data3DTexture();
|
|
|
const emptyCubeTexture = /*@__PURE__*/ new CubeTexture();
|
|
@@ -563,7 +569,9 @@ function setValueT1( gl, v, textures ) {
|
|
|
|
|
|
}
|
|
|
|
|
|
- textures.setTexture2D( v || emptyTexture, unit );
|
|
|
+ const emptyTexture2D = ( this.type === gl.SAMPLER_2D_SHADOW ) ? emptyShadowTexture : emptyTexture;
|
|
|
+
|
|
|
+ textures.setTexture2D( v || emptyTexture2D, unit );
|
|
|
|
|
|
}
|
|
|
|
|
@@ -947,6 +955,7 @@ class SingleUniform {
|
|
|
this.id = id;
|
|
|
this.addr = addr;
|
|
|
this.cache = [];
|
|
|
+ this.type = activeInfo.type;
|
|
|
this.setValue = getSingularSetter( activeInfo.type );
|
|
|
|
|
|
// this.path = activeInfo.name; // DEBUG
|
|
@@ -962,6 +971,7 @@ class PureArrayUniform {
|
|
|
this.id = id;
|
|
|
this.addr = addr;
|
|
|
this.cache = [];
|
|
|
+ this.type = activeInfo.type;
|
|
|
this.size = activeInfo.size;
|
|
|
this.setValue = getPureArraySetter( activeInfo.type );
|
|
|
|