libgdx / box2dlights

Fork of box2dlights by Kalle Hamalainen
Apache License 2.0
257 stars 82 forks source link

Light Shadow somehow get's colored to color of light #79

Closed azakhary closed 9 years ago

azakhary commented 9 years ago

Having weird bug with latest box2dlights.

Shadow, instead of being... black. is colored instead. so it feels inverted. light instead of shadow o_O I cannot even explain it using words, take a look yourself: https://www.youtube.com/watch?v=rkrl4_HdhzU

Here is my code: http://pastebin.com/Sjnhg5jt

am I doing something wrong?

piotr-j commented 9 years ago

Thats not exactly a bug. This is caused by the lights softness length being larger than the lights size itself. The default is 2.5f, had the same exact issue some time ago. It probably should be set to something like distance * 0.1f.

light.setSoftnessLength(light.getDistance() * 0.1f);

azakhary commented 9 years ago

oh... got it. weird. would be cool if softness is not set the default value will adjust itself according to the distance. Because right now, you kinda try the simple default example, and that's what happens.

Thanks a lot! it works now.

piotr-j commented 9 years ago

Created a #80 for this.