Skip to content

Commit

Permalink
fix: Stop adding 1 to light intensity in cuboids
Browse files Browse the repository at this point in the history
  • Loading branch information
TiagoCavalcante committed Oct 25, 2022
1 parent e22d8f6 commit 297a83d
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/primitives/cuboid.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ export default function ({ color = [1, 1, 1], coords, edgeForm = {}, opacity = 1
void getPointLightInfo(const in PointLight pointLight, out IncidentLight light) {
light.direction = normalize(pointLight.position + vViewPosition);
light.color = pointLight.color + 1.0;
light.color = pointLight.color;
}
` : ''}
Expand All @@ -197,11 +197,7 @@ export default function ({ color = [1, 1, 1], coords, edgeForm = {}, opacity = 1
float angleCos = dot(light.direction, spotLight.direction);
if (angleCos > 0.0) {
light.color = spotLight.color * angleCos + 1.0;
} else {
light.color = vec3(0.0);
}
light.color = spotLight.color * max(angleCos, 0.0);
}
` : ''}
Expand Down

0 comments on commit 297a83d

Please sign in to comment.