leech
leech

Reputation: 8431

ThreeJS Inconsistent Lighting

I understand that this can be really complicated to debug, given that there are a lot of objects with different properties, but I'm hoping that there is a common pitfall that can cause PointLights in THREE to shade inconsistently.

wonky lighting

In the picture above I have cubes with MeshLambertMaterial materials. Each cube shares the same model but has it's own material (in case i want to change the colors dynamically). The lights are the yellow splashes.

However cubes have differing shading effects.

  1. a nice gradient shade
  2. a blue luminescent glow

And you can see that the bright blocks suddenly drop off near the bottom.

Can anyone give me pointers to find why my shading is inconsistent?

Upvotes: 0

Views: 154

Answers (1)

leech
leech

Reputation: 8431

I found the problem for me is that THREE's way of storing colors is float based. (0.0 - 1.0) and i was setting some of the colors integer based (0 - 255). THREE didn't complain so it made some colors stronger and thusly the light affected them differently.

Upvotes: 1

Related Questions