Skip to content

Commit

Permalink
fix: break should have been at the start of the loop.
Browse files Browse the repository at this point in the history
  • Loading branch information
bhouston committed Jul 12, 2020
1 parent 32ae498 commit e88fb87
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/examples/lights/04_multi/fragment.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ void main() {

for( int i = 0; i < MAX_PUNCTUAL_LIGHTS; i ++ ) {

if( i >= numPunctualLights ) break;

PunctualLight punctualLight;
punctualLight.type = punctualLightType[i];
punctualLight.position = punctualLightViewPosition[i];
Expand All @@ -68,8 +70,6 @@ void main() {
outputColor += irradiance * BRDF_Specular_GGX( surface, lightDirection, specularF0, specularRoughness );
outputColor += irradiance * BRDF_Diffuse_Lambert( albedo );

if( i >= numPunctualLights ) break;

}

gl_FragColor.rgb = linearTosRGB( outputColor );
Expand Down

0 comments on commit e88fb87

Please sign in to comment.