|
@@ -110,7 +110,7 @@ const VSMPassVertical = /*@__PURE__*/ Fn( ( { samples, radius, size, shadowPass,
|
|
|
|
|
|
|
|
let depth = shadowPass.sample( add( screenCoordinate.xy, vec2( 0, uvOffset ).mul( radius ) ).div( size ) );
|
|
let depth = shadowPass.sample( add( screenCoordinate.xy, vec2( 0, uvOffset ).mul( radius ) ).div( size ) );
|
|
|
|
|
|
|
|
- if ( shadowPass.value.isDepthArrayTexture || shadowPass.value.isDataArrayTexture ) {
|
|
|
|
|
|
|
+ if ( shadowPass.value.isArrayTexture ) {
|
|
|
|
|
|
|
|
depth = depth.depth( depthLayer );
|
|
depth = depth.depth( depthLayer );
|
|
|
|
|
|
|
@@ -156,7 +156,7 @@ const VSMPassHorizontal = /*@__PURE__*/ Fn( ( { samples, radius, size, shadowPas
|
|
|
|
|
|
|
|
let distribution = shadowPass.sample( add( screenCoordinate.xy, vec2( uvOffset, 0 ).mul( radius ) ).div( size ) );
|
|
let distribution = shadowPass.sample( add( screenCoordinate.xy, vec2( uvOffset, 0 ).mul( radius ) ).div( size ) );
|
|
|
|
|
|
|
|
- if ( shadowPass.value.isDepthArrayTexture || shadowPass.value.isDataArrayTexture ) {
|
|
|
|
|
|
|
+ if ( shadowPass.value.isArrayTexture ) {
|
|
|
|
|
|
|
|
distribution = distribution.depth( depthLayer );
|
|
distribution = distribution.depth( depthLayer );
|
|
|
|
|
|
|
@@ -421,11 +421,11 @@ class ShadowNode extends ShadowBaseNode {
|
|
|
|
|
|
|
|
depthTexture.compareFunction = null; // VSM does not use textureSampleCompare()/texture2DCompare()
|
|
depthTexture.compareFunction = null; // VSM does not use textureSampleCompare()/texture2DCompare()
|
|
|
|
|
|
|
|
- if ( shadowMap.isRenderTargetArray ) {
|
|
|
|
|
|
|
+ if ( shadowMap.depth > 1 ) {
|
|
|
|
|
|
|
|
if ( ! shadowMap._vsmShadowMapVertical ) {
|
|
if ( ! shadowMap._vsmShadowMapVertical ) {
|
|
|
|
|
|
|
|
- shadowMap._vsmShadowMapVertical = builder.createRenderTargetArray( shadow.mapSize.width, shadow.mapSize.height, shadowMap.depth, { format: RGFormat, type: HalfFloatType, depthBuffer: false } );
|
|
|
|
|
|
|
+ shadowMap._vsmShadowMapVertical = builder.createRenderTarget( shadow.mapSize.width, shadow.mapSize.height, { format: RGFormat, type: HalfFloatType, depth: shadowMap.depth, depthBuffer: false } );
|
|
|
shadowMap._vsmShadowMapVertical.texture.name = 'VSMVertical';
|
|
shadowMap._vsmShadowMapVertical.texture.name = 'VSMVertical';
|
|
|
|
|
|
|
|
}
|
|
}
|
|
@@ -434,7 +434,7 @@ class ShadowNode extends ShadowBaseNode {
|
|
|
|
|
|
|
|
if ( ! shadowMap._vsmShadowMapHorizontal ) {
|
|
if ( ! shadowMap._vsmShadowMapHorizontal ) {
|
|
|
|
|
|
|
|
- shadowMap._vsmShadowMapHorizontal = builder.createRenderTargetArray( shadow.mapSize.width, shadow.mapSize.height, shadowMap.depth, { format: RGFormat, type: HalfFloatType, depthBuffer: false } );
|
|
|
|
|
|
|
+ shadowMap._vsmShadowMapHorizontal = builder.createRenderTarget( shadow.mapSize.width, shadow.mapSize.height, { format: RGFormat, type: HalfFloatType, depth: shadowMap.depth, depthBuffer: false } );
|
|
|
shadowMap._vsmShadowMapHorizontal.texture.name = 'VSMHorizontal';
|
|
shadowMap._vsmShadowMapHorizontal.texture.name = 'VSMHorizontal';
|
|
|
|
|
|
|
|
}
|
|
}
|
|
@@ -451,7 +451,7 @@ class ShadowNode extends ShadowBaseNode {
|
|
|
|
|
|
|
|
let shadowPassVertical = texture( depthTexture );
|
|
let shadowPassVertical = texture( depthTexture );
|
|
|
|
|
|
|
|
- if ( depthTexture.isDepthArrayTexture ) {
|
|
|
|
|
|
|
+ if ( depthTexture.isArrayTexture ) {
|
|
|
|
|
|
|
|
shadowPassVertical = shadowPassVertical.depth( this.depthLayer );
|
|
shadowPassVertical = shadowPassVertical.depth( this.depthLayer );
|
|
|
|
|
|
|
@@ -459,7 +459,7 @@ class ShadowNode extends ShadowBaseNode {
|
|
|
|
|
|
|
|
let shadowPassHorizontal = texture( this.vsmShadowMapVertical.texture );
|
|
let shadowPassHorizontal = texture( this.vsmShadowMapVertical.texture );
|
|
|
|
|
|
|
|
- if ( depthTexture.isDepthArrayTexture ) {
|
|
|
|
|
|
|
+ if ( depthTexture.isArrayTexture ) {
|
|
|
|
|
|
|
|
shadowPassHorizontal = shadowPassHorizontal.depth( this.depthLayer );
|
|
shadowPassHorizontal = shadowPassHorizontal.depth( this.depthLayer );
|
|
|
|
|
|
|
@@ -503,7 +503,7 @@ class ShadowNode extends ShadowBaseNode {
|
|
|
|
|
|
|
|
let shadowColor = texture( shadowMap.texture, shadowCoord );
|
|
let shadowColor = texture( shadowMap.texture, shadowCoord );
|
|
|
|
|
|
|
|
- if ( depthTexture.isDepthArrayTexture ) {
|
|
|
|
|
|
|
+ if ( depthTexture.isArrayTexture ) {
|
|
|
|
|
|
|
|
shadowColor = shadowColor.depth( this.depthLayer );
|
|
shadowColor = shadowColor.depth( this.depthLayer );
|
|
|
|
|
|