Skip to content
Merged
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
12 changes: 11 additions & 1 deletion src/renderers/webgl/WebGLUniforms.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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 );

}

Expand Down Expand Up @@ -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
Expand All @@ -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 );

Expand Down