Skip to content

Commit

Permalink
Merge pull request mrdoob#16260 from WestLangley/dev-light_probe_color
Browse files Browse the repository at this point in the history
LightProbe: modulate irradiance by probe color
  • Loading branch information
mrdoob authored Apr 16, 2019
2 parents e6e110a + 068959c commit 4a222c9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/lights/LightProbe.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function LightProbe( color, intensity ) {

this.sh = new SphericalHarmonics3();

this.sh.coefficients[ 0 ].set( this.color.r, this.color.g, this.color.b );
this.sh.coefficients[ 0 ].set( 1, 1, 1 );

this.type = 'LightProbe';

Expand Down
7 changes: 6 additions & 1 deletion src/renderers/webgl/WebGLLights.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,12 @@ function WebGLLights() {

for ( var j = 0; j < 9; j ++ ) {

state.probe[ j ].addScaledVector( light.sh.coefficients[ j ], intensity );
var probe = state.probe[ j ];
var coeff = light.sh.coefficients[ j ];

probe.x += coeff.x * color.r * intensity;
probe.y += coeff.y * color.g * intensity;
probe.z += coeff.z * color.b * intensity;

}

Expand Down

0 comments on commit 4a222c9

Please sign in to comment.