@@ -170,7 +170,9 @@ function WebGLLights( extensions, capabilities ) {
170170 numDirectionalShadows : - 1 ,
171171 numPointShadows : - 1 ,
172172 numSpotShadows : - 1 ,
173- numSpotMaps : - 1
173+ numSpotMaps : - 1 ,
174+
175+ numLightProbes : - 1
174176 } ,
175177
176178 ambient : [ 0 , 0 , 0 ] ,
@@ -192,7 +194,8 @@ function WebGLLights( extensions, capabilities ) {
192194 pointShadowMap : [ ] ,
193195 pointShadowMatrix : [ ] ,
194196 hemi : [ ] ,
195- numSpotLightShadowsWithMaps : 0
197+ numSpotLightShadowsWithMaps : 0 ,
198+ numLightProbes : 0
196199
197200 } ;
198201
@@ -220,6 +223,8 @@ function WebGLLights( extensions, capabilities ) {
220223 let numSpotMaps = 0 ;
221224 let numSpotShadowsWithMaps = 0 ;
222225
226+ let numLightProbes = 0 ;
227+
223228 // ordering : [shadow casting + map texturing, map texturing, shadow casting, none ]
224229 lights . sort ( shadowCastingAndTexturingLightsFirst ) ;
225230
@@ -250,6 +255,8 @@ function WebGLLights( extensions, capabilities ) {
250255
251256 }
252257
258+ numLightProbes ++ ;
259+
253260 } else if ( light . isDirectionalLight ) {
254261
255262 const uniforms = cache . get ( light ) ;
@@ -437,7 +444,8 @@ function WebGLLights( extensions, capabilities ) {
437444 hash . numDirectionalShadows !== numDirectionalShadows ||
438445 hash . numPointShadows !== numPointShadows ||
439446 hash . numSpotShadows !== numSpotShadows ||
440- hash . numSpotMaps !== numSpotMaps ) {
447+ hash . numSpotMaps !== numSpotMaps ||
448+ hash . numLightProbes !== numLightProbes ) {
441449
442450 state . directional . length = directionalLength ;
443451 state . spot . length = spotLength ;
@@ -456,6 +464,7 @@ function WebGLLights( extensions, capabilities ) {
456464 state . spotLightMatrix . length = numSpotShadows + numSpotMaps - numSpotShadowsWithMaps ;
457465 state . spotLightMap . length = numSpotMaps ;
458466 state . numSpotLightShadowsWithMaps = numSpotShadowsWithMaps ;
467+ state . numLightProbes = numLightProbes ;
459468
460469 hash . directionalLength = directionalLength ;
461470 hash . pointLength = pointLength ;
@@ -468,6 +477,8 @@ function WebGLLights( extensions, capabilities ) {
468477 hash . numSpotShadows = numSpotShadows ;
469478 hash . numSpotMaps = numSpotMaps ;
470479
480+ hash . numLightProbes = numLightProbes ;
481+
471482 state . version = nextVersion ++ ;
472483
473484 }
0 commit comments