Author Topic: How to work with lights? (setDiscardDistance?)  (Read 3600 times)

Offline Kernle 32DLL

  • byte
  • *
  • Posts: 20
    • View Profile
How to work with lights? (setDiscardDistance?)
« on: April 03, 2011, 07:23:44 pm »
Hi,

Yet another problem I need to get solved: How to work with Lights in jPCT-AE? Judging from the docs, it seems there are only "point" lights, e.g. a light pointing into all directions. Any chance to create a spot light, that lights only a certain direction?

Another thing that I need to learn how to use is the function setDiscardDistance for a Light object. I thought that it would set the max. distance where the light could shine, but when regardless to which value I set it, this "distance" seems incredible small, so it seems like there is nearly no illumination at all :/ As a side note, the doc mentiones a value in the Config calls, which does not exist (Config.discardDistance).

Any toughts?

So long,
Kernle

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: How to work with lights? (setDiscardDistance?)
« Reply #1 on: April 03, 2011, 09:43:36 pm »
setDiscardDistance is actually a method to apply an optimization for objects that are too far away. It's not meant to be used to set a lights attenuation. This isn't possible in JPCT-AE right now, because i encountered massive driver problems on some devices when doing so. I'll go and see if this is still a problem on current devices and maybe enable it when i find the time. About the config setting : It's a legacy setting that AE might not have anymore. I'll remove it from the docs. I've no idea why your lights don't display properly. Either its a problem with your setup of them or you've located them inside or at least very close to the objects you want to light.