@@ -170,7 +170,9 @@ function WebGLLights( extensions, capabilities ) {
170
170
numDirectionalShadows : - 1 ,
171
171
numPointShadows : - 1 ,
172
172
numSpotShadows : - 1 ,
173
- numSpotMaps : - 1
173
+ numSpotMaps : - 1 ,
174
+
175
+ numLightProbes : - 1
174
176
} ,
175
177
176
178
ambient : [ 0 , 0 , 0 ] ,
@@ -192,7 +194,8 @@ function WebGLLights( extensions, capabilities ) {
192
194
pointShadowMap : [ ] ,
193
195
pointShadowMatrix : [ ] ,
194
196
hemi : [ ] ,
195
- numSpotLightShadowsWithMaps : 0
197
+ numSpotLightShadowsWithMaps : 0 ,
198
+ numLightProbes : 0
196
199
197
200
} ;
198
201
@@ -220,6 +223,8 @@ function WebGLLights( extensions, capabilities ) {
220
223
let numSpotMaps = 0 ;
221
224
let numSpotShadowsWithMaps = 0 ;
222
225
226
+ let numLightProbes = 0 ;
227
+
223
228
// ordering : [shadow casting + map texturing, map texturing, shadow casting, none ]
224
229
lights . sort ( shadowCastingAndTexturingLightsFirst ) ;
225
230
@@ -250,6 +255,8 @@ function WebGLLights( extensions, capabilities ) {
250
255
251
256
}
252
257
258
+ numLightProbes ++ ;
259
+
253
260
} else if ( light . isDirectionalLight ) {
254
261
255
262
const uniforms = cache . get ( light ) ;
@@ -437,7 +444,8 @@ function WebGLLights( extensions, capabilities ) {
437
444
hash . numDirectionalShadows !== numDirectionalShadows ||
438
445
hash . numPointShadows !== numPointShadows ||
439
446
hash . numSpotShadows !== numSpotShadows ||
440
- hash . numSpotMaps !== numSpotMaps ) {
447
+ hash . numSpotMaps !== numSpotMaps ||
448
+ hash . numLightProbes !== numLightProbes ) {
441
449
442
450
state . directional . length = directionalLength ;
443
451
state . spot . length = spotLength ;
@@ -456,6 +464,7 @@ function WebGLLights( extensions, capabilities ) {
456
464
state . spotLightMatrix . length = numSpotShadows + numSpotMaps - numSpotShadowsWithMaps ;
457
465
state . spotLightMap . length = numSpotMaps ;
458
466
state . numSpotLightShadowsWithMaps = numSpotShadowsWithMaps ;
467
+ state . numLightProbes = numLightProbes ;
459
468
460
469
hash . directionalLength = directionalLength ;
461
470
hash . pointLength = pointLength ;
@@ -468,6 +477,8 @@ function WebGLLights( extensions, capabilities ) {
468
477
hash . numSpotShadows = numSpotShadows ;
469
478
hash . numSpotMaps = numSpotMaps ;
470
479
480
+ hash . numLightProbes = numLightProbes ;
481
+
471
482
state . version = nextVersion ++ ;
472
483
473
484
}
0 commit comments