From 3f679f7878f639f041b131fb1a795d2c79dd8d2b Mon Sep 17 00:00:00 2001 From: WestLangley Date: Thu, 5 Nov 2015 15:05:38 -0500 Subject: [PATCH] MeshStandardMaterial: Fix envMapIntensity --- src/materials/MeshStandardMaterial.js | 2 ++ src/renderers/shaders/ShaderChunk/envmap_pars_fragment.glsl | 1 + src/renderers/shaders/ShaderChunk/lights_pars.glsl | 4 ++-- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/materials/MeshStandardMaterial.js b/src/materials/MeshStandardMaterial.js index 2d3d1de8ce9183..fd07648311fa86 100644 --- a/src/materials/MeshStandardMaterial.js +++ b/src/materials/MeshStandardMaterial.js @@ -39,6 +39,8 @@ * alphaMap: new THREE.Texture( ), * * envMap: new THREE.CubeTexture( [posx, negx, posy, negy, posz, negz] ), + * envMapIntensity: + * * refractionRatio: , * * shading: THREE.SmoothShading, diff --git a/src/renderers/shaders/ShaderChunk/envmap_pars_fragment.glsl b/src/renderers/shaders/ShaderChunk/envmap_pars_fragment.glsl index 6cc4b896681ca2..8b060c651f1ca1 100644 --- a/src/renderers/shaders/ShaderChunk/envmap_pars_fragment.glsl +++ b/src/renderers/shaders/ShaderChunk/envmap_pars_fragment.glsl @@ -1,5 +1,6 @@ #if defined( USE_ENVMAP ) || defined( STANDARD ) uniform float reflectivity; + uniform float envMapIntenstiy; #endif #ifdef USE_ENVMAP diff --git a/src/renderers/shaders/ShaderChunk/lights_pars.glsl b/src/renderers/shaders/ShaderChunk/lights_pars.glsl index 0151a370ec305e..cf03495cfea2b6 100644 --- a/src/renderers/shaders/ShaderChunk/lights_pars.glsl +++ b/src/renderers/shaders/ShaderChunk/lights_pars.glsl @@ -163,7 +163,7 @@ vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { envMapColor.rgb = inputToLinear( envMapColor.rgb ); - return PI * envMapColor.rgb; + return PI * envMapColor.rgb * envMapIntensity; } @@ -237,7 +237,7 @@ vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { envMapColor.rgb = inputToLinear( envMapColor.rgb ); - return envMapColor.rgb; + return envMapColor.rgb * envMapIntensity; }