|
@@ -170,7 +170,9 @@ function WebGLLights( extensions, capabilities ) {
|
|
|
numDirectionalShadows: - 1,
|
|
|
numPointShadows: - 1,
|
|
|
numSpotShadows: - 1,
|
|
|
- numSpotMaps: - 1
|
|
|
+ numSpotMaps: - 1,
|
|
|
+
|
|
|
+ numLightProbes: - 1
|
|
|
},
|
|
|
|
|
|
ambient: [ 0, 0, 0 ],
|
|
@@ -192,7 +194,8 @@ function WebGLLights( extensions, capabilities ) {
|
|
|
pointShadowMap: [],
|
|
|
pointShadowMatrix: [],
|
|
|
hemi: [],
|
|
|
- numSpotLightShadowsWithMaps: 0
|
|
|
+ numSpotLightShadowsWithMaps: 0,
|
|
|
+ numLightProbes: 0
|
|
|
|
|
|
};
|
|
|
|
|
@@ -220,6 +223,8 @@ function WebGLLights( extensions, capabilities ) {
|
|
|
let numSpotMaps = 0;
|
|
|
let numSpotShadowsWithMaps = 0;
|
|
|
|
|
|
+ let numLightProbes = 0;
|
|
|
+
|
|
|
// ordering : [shadow casting + map texturing, map texturing, shadow casting, none ]
|
|
|
lights.sort( shadowCastingAndTexturingLightsFirst );
|
|
|
|
|
@@ -250,6 +255,8 @@ function WebGLLights( extensions, capabilities ) {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ numLightProbes ++;
|
|
|
+
|
|
|
} else if ( light.isDirectionalLight ) {
|
|
|
|
|
|
const uniforms = cache.get( light );
|
|
@@ -437,7 +444,8 @@ function WebGLLights( extensions, capabilities ) {
|
|
|
hash.numDirectionalShadows !== numDirectionalShadows ||
|
|
|
hash.numPointShadows !== numPointShadows ||
|
|
|
hash.numSpotShadows !== numSpotShadows ||
|
|
|
- hash.numSpotMaps !== numSpotMaps ) {
|
|
|
+ hash.numSpotMaps !== numSpotMaps ||
|
|
|
+ hash.numLightProbes !== numLightProbes ) {
|
|
|
|
|
|
state.directional.length = directionalLength;
|
|
|
state.spot.length = spotLength;
|
|
@@ -456,6 +464,7 @@ function WebGLLights( extensions, capabilities ) {
|
|
|
state.spotLightMatrix.length = numSpotShadows + numSpotMaps - numSpotShadowsWithMaps;
|
|
|
state.spotLightMap.length = numSpotMaps;
|
|
|
state.numSpotLightShadowsWithMaps = numSpotShadowsWithMaps;
|
|
|
+ state.numLightProbes = numLightProbes;
|
|
|
|
|
|
hash.directionalLength = directionalLength;
|
|
|
hash.pointLength = pointLength;
|
|
@@ -468,6 +477,8 @@ function WebGLLights( extensions, capabilities ) {
|
|
|
hash.numSpotShadows = numSpotShadows;
|
|
|
hash.numSpotMaps = numSpotMaps;
|
|
|
|
|
|
+ hash.numLightProbes = numLightProbes;
|
|
|
+
|
|
|
state.version = nextVersion ++;
|
|
|
|
|
|
}
|