about Light Discard Distance

Started by MichaelJPCT, November 06, 2018, 03:28:16 AM

Previous topic - Next topic

MichaelJPCT

Hi again.
i recently found that discard distance of Light means the distance between Light and origin of an Object3D.
if an object3D(such as a ball) has radius of 10, placed 15 from light, discard distance is 10, then the object is not lit. but in reality the light should lit a part of the object at that distance.
when the light move closer to the object , down to 9.9 unit away, the object is suddenly lit.
would it be better if discard distance takes into account the radius of object3d?
that's just a thought, there may be downside too.

EgonOlsen

For compiled object (which are all objects in jPCT-AE), discarding lights is based on the center of an object and it's distance to the light source. That's why there's no half-lit object in your case. If it would have been better to base it on the bounds of an object depends on the case, I guess. There might be situations where one is better than the other or where even someting else would be good. So I went with the computational least expensive way of doing it, which is just checking the center.

MichaelJPCT