Skip to content

Commit 102d038

Browse files
committed
WebGLShadowMap: Avoid changing state when shadowMap is enabled but there are not light with shadows in the scene.
1 parent acfeda0 commit 102d038

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/renderers/webgl/WebGLShadowMap.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ THREE.WebGLShadowMap = function ( _renderer, _lights, _objects ) {
9393
this.render = function ( scene, camera ) {
9494

9595
var faceCount, isPointLight;
96+
var shadows = _lights.shadows;
97+
98+
if ( shadows.length === 0 ) return;
9699

97100
if ( scope.enabled === false ) return;
98101
if ( scope.autoUpdate === false && scope.needsUpdate === false ) return;
@@ -108,8 +111,6 @@ THREE.WebGLShadowMap = function ( _renderer, _lights, _objects ) {
108111

109112
// render depth map
110113

111-
var shadows = _lights.shadows;
112-
113114
for ( var i = 0, il = shadows.length; i < il; i ++ ) {
114115

115116
var light = shadows[ i ];

0 commit comments

Comments
 (0)