Skip to content

Commit e855bf6

Browse files
committed
WebGLShadowMap: Clamp mapSize to maxTextureSize (Take 2). See mrdoob#9289
1 parent 16262c1 commit e855bf6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/renderers/webgl/WebGLShadowMap.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ THREE.WebGLShadowMap = function ( _renderer, _lights, _objects, capabilities ) {
1313
_lightShadows = _lights.shadows,
1414

1515
_shadowMapSize = new THREE.Vector2(),
16+
_maxShadowMapSize = new THREE.Vector2( capabilities.maxTextureSize, capabilities.maxTextureSize ),
1617

1718
_lookTarget = new THREE.Vector3(),
1819
_lightPositionWorld = new THREE.Vector3(),
@@ -126,7 +127,7 @@ THREE.WebGLShadowMap = function ( _renderer, _lights, _objects, capabilities ) {
126127
var shadowCamera = shadow.camera;
127128

128129
_shadowMapSize.copy( shadow.mapSize );
129-
_shadowMapSize.min( capabilities.maxTextureSize, capabilities.maxTextureSize );
130+
_shadowMapSize.min( _maxShadowMapSize );
130131

131132
if ( light instanceof THREE.PointLight ) {
132133

0 commit comments

Comments
 (0)