|
@@ -1,4 +1,4 @@
|
|
-import { FrontSide, BackSide, DoubleSide, RGBAFormat, NearestFilter, PCFShadowMap, VSMShadowMap, RGBADepthPacking, NoBlending } from '../../constants.js';
|
|
|
|
|
|
+import { FrontSide, BackSide, DoubleSide, NearestFilter, PCFShadowMap, VSMShadowMap, RGBADepthPacking, NoBlending } from '../../constants.js';
|
|
import { WebGLRenderTarget } from '../WebGLRenderTarget.js';
|
|
import { WebGLRenderTarget } from '../WebGLRenderTarget.js';
|
|
import { MeshDepthMaterial } from '../../materials/MeshDepthMaterial.js';
|
|
import { MeshDepthMaterial } from '../../materials/MeshDepthMaterial.js';
|
|
import { MeshDistanceMaterial } from '../../materials/MeshDistanceMaterial.js';
|
|
import { MeshDistanceMaterial } from '../../materials/MeshDistanceMaterial.js';
|
|
@@ -131,20 +131,9 @@ function WebGLShadowMap( _renderer, _objects, _capabilities ) {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- if ( shadow.map === null && ! shadow.isPointLightShadow && this.type === VSMShadowMap ) {
|
|
|
|
-
|
|
|
|
- shadow.map = new WebGLRenderTarget( _shadowMapSize.x, _shadowMapSize.y );
|
|
|
|
- shadow.map.texture.name = light.name + '.shadowMap';
|
|
|
|
-
|
|
|
|
- shadow.mapPass = new WebGLRenderTarget( _shadowMapSize.x, _shadowMapSize.y );
|
|
|
|
-
|
|
|
|
- shadow.camera.updateProjectionMatrix();
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
if ( shadow.map === null ) {
|
|
if ( shadow.map === null ) {
|
|
|
|
|
|
- const pars = { minFilter: NearestFilter, magFilter: NearestFilter, format: RGBAFormat };
|
|
|
|
|
|
+ const pars = ( this.type !== VSMShadowMap ) ? { minFilter: NearestFilter, magFilter: NearestFilter } : {};
|
|
|
|
|
|
shadow.map = new WebGLRenderTarget( _shadowMapSize.x, _shadowMapSize.y, pars );
|
|
shadow.map = new WebGLRenderTarget( _shadowMapSize.x, _shadowMapSize.y, pars );
|
|
shadow.map.texture.name = light.name + '.shadowMap';
|
|
shadow.map.texture.name = light.name + '.shadowMap';
|
|
@@ -181,7 +170,7 @@ function WebGLShadowMap( _renderer, _objects, _capabilities ) {
|
|
|
|
|
|
// do blur pass for VSM
|
|
// do blur pass for VSM
|
|
|
|
|
|
- if ( ! shadow.isPointLightShadow && this.type === VSMShadowMap ) {
|
|
|
|
|
|
+ if ( shadow.isPointLightShadow !== true && this.type === VSMShadowMap ) {
|
|
|
|
|
|
VSMPass( shadow, camera );
|
|
VSMPass( shadow, camera );
|
|
|
|
|
|
@@ -211,6 +200,12 @@ function WebGLShadowMap( _renderer, _objects, _capabilities ) {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if ( shadow.mapPass === null ) {
|
|
|
|
+
|
|
|
|
+ shadow.mapPass = new WebGLRenderTarget( _shadowMapSize.x, _shadowMapSize.y );
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
// vertical pass
|
|
// vertical pass
|
|
|
|
|
|
shadowMaterialVertical.uniforms.shadow_pass.value = shadow.map.texture;
|
|
shadowMaterialVertical.uniforms.shadow_pass.value = shadow.map.texture;
|