Skip to content

Commit d3501d9

Browse files
committed
WebGLShadowMap: Clamp mapSize to maxTextureSize. See mrdoob#9289
1 parent 5060cdd commit d3501d9

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/renderers/WebGLRenderer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ THREE.WebGLRenderer = function ( parameters ) {
334334

335335
// shadow map
336336

337-
var shadowMap = new THREE.WebGLShadowMap( this, _lights, objects );
337+
var shadowMap = new THREE.WebGLShadowMap( this, _lights, objects, capabilities );
338338

339339
this.shadowMap = shadowMap;
340340

src/renderers/webgl/WebGLShadowMap.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @author mrdoob / http://mrdoob.com/
44
*/
55

6-
THREE.WebGLShadowMap = function ( _renderer, _lights, _objects ) {
6+
THREE.WebGLShadowMap = function ( _renderer, _lights, _objects, capabilities ) {
77

88
var _gl = _renderer.context,
99
_state = _renderer.state,
@@ -126,6 +126,7 @@ THREE.WebGLShadowMap = function ( _renderer, _lights, _objects ) {
126126
var shadowCamera = shadow.camera;
127127

128128
_shadowMapSize.copy( shadow.mapSize );
129+
_shadowMapSize.min( capabilities.maxTextureSize, capabilities.maxTextureSize );
129130

130131
if ( light instanceof THREE.PointLight ) {
131132

0 commit comments

Comments
 (0)