Puybaret
Expert
France
Joined: Nov 7, 2005
Post Count: 9426
Status:
Offline
|
|
Re: Is Sunflow limited in Sweet Home 3D?
|
Hum, I think you should learn how to handle colors with hexadecimal or binary notation, rather than like integers...
enkonyito, your code should be:this.sunflow.parameter("radiance", null, power * ((lightColor >> 16) & 0xFF) * ((this.homeLightColor >> 16) & 0xFF), power * ((lightColor >> 8) & 0xFF) * ((this.homeLightColor >> 8) & 0xFF), power * (lightColor & 0xFF) * (this.homeLightColor & 0xFF)); You need to apply a 0xFF filter on the color bits after they are shifted from 16 bits, because the 8 higher bits may contain the transparency value, 0xFF being a full opaque value.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator
|
[May 4, 2018, 3:34:23 PM]
|
|
[Link]
|
|