StrandedKitty / three-csm

☀️ Cascaded shadow maps (CSMs) implementation for Three.js
MIT License
296 stars 21 forks source link

Configurable light color #13

Closed UstymUkhman closed 1 year ago

UstymUkhman commented 3 years ago

Hey! Awesome plugin, really <3 it. I've noticed that the white color for DirectionalLights is hardcoded right here, so I'd like to suggest to make it configurable from data params we're passing to the constructor for the CSM initialization.

As a workaround I'm currently using this hack:

this.csm = new CSM({ ... });

this.csm.lights.forEach(light =>
  light.color.set(0xffff00)
);

But I don't think that's ideal, what do you think about that?

itsdouges commented 1 year ago

@StrandedKitty heya would you be open to a contribution for this? https://github.com/StrandedKitty/three-csm/blob/master/src/CSM.ts#L130

Would just be adding another property to the constructor lightColor I suppose 😄

StrandedKitty commented 1 year ago

settings.lightColor was introduced in 3.2.0.