|
@@ -205,7 +205,7 @@ function WebGLLights( extensions ) {
|
|
|
const matrix4 = new Matrix4();
|
|
|
const matrix42 = new Matrix4();
|
|
|
|
|
|
- function setup( lights, useLegacyLights ) {
|
|
|
+ function setup( lights ) {
|
|
|
|
|
|
let r = 0, g = 0, b = 0;
|
|
|
|
|
@@ -228,9 +228,6 @@ function WebGLLights( extensions ) {
|
|
|
// ordering : [shadow casting + map texturing, map texturing, shadow casting, none ]
|
|
|
lights.sort( shadowCastingAndTexturingLightsFirst );
|
|
|
|
|
|
- // artist-friendly light intensity scaling factor
|
|
|
- const scaleFactor = ( useLegacyLights === true ) ? Math.PI : 1;
|
|
|
-
|
|
|
for ( let i = 0, l = lights.length; i < l; i ++ ) {
|
|
|
|
|
|
const light = lights[ i ];
|
|
@@ -243,9 +240,9 @@ function WebGLLights( extensions ) {
|
|
|
|
|
|
if ( light.isAmbientLight ) {
|
|
|
|
|
|
- r += color.r * intensity * scaleFactor;
|
|
|
- g += color.g * intensity * scaleFactor;
|
|
|
- b += color.b * intensity * scaleFactor;
|
|
|
+ r += color.r * intensity;
|
|
|
+ g += color.g * intensity;
|
|
|
+ b += color.b * intensity;
|
|
|
|
|
|
} else if ( light.isLightProbe ) {
|
|
|
|
|
@@ -261,7 +258,7 @@ function WebGLLights( extensions ) {
|
|
|
|
|
|
const uniforms = cache.get( light );
|
|
|
|
|
|
- uniforms.color.copy( light.color ).multiplyScalar( light.intensity * scaleFactor );
|
|
|
+ uniforms.color.copy( light.color ).multiplyScalar( light.intensity );
|
|
|
|
|
|
if ( light.castShadow ) {
|
|
|
|
|
@@ -292,7 +289,7 @@ function WebGLLights( extensions ) {
|
|
|
|
|
|
uniforms.position.setFromMatrixPosition( light.matrixWorld );
|
|
|
|
|
|
- uniforms.color.copy( color ).multiplyScalar( intensity * scaleFactor );
|
|
|
+ uniforms.color.copy( color ).multiplyScalar( intensity );
|
|
|
uniforms.distance = distance;
|
|
|
|
|
|
uniforms.coneCos = Math.cos( light.angle );
|
|
@@ -353,7 +350,7 @@ function WebGLLights( extensions ) {
|
|
|
|
|
|
const uniforms = cache.get( light );
|
|
|
|
|
|
- uniforms.color.copy( light.color ).multiplyScalar( light.intensity * scaleFactor );
|
|
|
+ uniforms.color.copy( light.color ).multiplyScalar( light.intensity );
|
|
|
uniforms.distance = light.distance;
|
|
|
uniforms.decay = light.decay;
|
|
|
|
|
@@ -386,8 +383,8 @@ function WebGLLights( extensions ) {
|
|
|
|
|
|
const uniforms = cache.get( light );
|
|
|
|
|
|
- uniforms.skyColor.copy( light.color ).multiplyScalar( intensity * scaleFactor );
|
|
|
- uniforms.groundColor.copy( light.groundColor ).multiplyScalar( intensity * scaleFactor );
|
|
|
+ uniforms.skyColor.copy( light.color ).multiplyScalar( intensity );
|
|
|
+ uniforms.groundColor.copy( light.groundColor ).multiplyScalar( intensity );
|
|
|
|
|
|
state.hemi[ hemiLength ] = uniforms;
|
|
|
|