Skip to content

Commit

Permalink
MeshStandardMaterial: Fix envMapIntensity
Browse files Browse the repository at this point in the history
  • Loading branch information
WestLangley committed Nov 5, 2015
1 parent 0fa027d commit 3f679f7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/materials/MeshStandardMaterial.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
* alphaMap: new THREE.Texture( <Image> ),
*
* envMap: new THREE.CubeTexture( [posx, negx, posy, negy, posz, negz] ),
* envMapIntensity: <float>
*
* refractionRatio: <float>,
*
* shading: THREE.SmoothShading,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#if defined( USE_ENVMAP ) || defined( STANDARD )
uniform float reflectivity;
uniform float envMapIntenstiy;

This comment has been minimized.

Copy link
@erich666

erich666 Aug 9, 2016

Contributor

@WestLangley This looks to be a bug, it should be envMapIntensity (not "...stiy").

The bug may not be noticed because of this line

This comment has been minimized.

Copy link
@WestLangley

WestLangley Aug 9, 2016

Author Collaborator

Thanks, @erich666. The incorrectly-spelled uniform does not appear to be used. The correctly-spelled uniform defined elsewhere is used. This code needs to be revisited...

This comment has been minimized.

Copy link
@mrdoob

mrdoob Dec 6, 2016

Owner

Fixed! 14419de

#endif

#ifdef USE_ENVMAP
Expand Down
4 changes: 2 additions & 2 deletions src/renderers/shaders/ShaderChunk/lights_pars.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {

envMapColor.rgb = inputToLinear( envMapColor.rgb );

return PI * envMapColor.rgb;
return PI * envMapColor.rgb * envMapIntensity;

}

Expand Down Expand Up @@ -237,7 +237,7 @@ vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {

envMapColor.rgb = inputToLinear( envMapColor.rgb );

return envMapColor.rgb;
return envMapColor.rgb * envMapIntensity;

}

Expand Down

0 comments on commit 3f679f7

Please sign in to comment.