Dynamic light affect player only?
by Randy Condon · in Torque Game Engine · 09/02/2006 (1:23 pm) · 3 replies
Is there a straightforward way for a dynamic light to only affect specific .dts objects (like a player object)?
It seems the 'lightGroup/EffectsDTSObjects=false' behavior is the ticket, but will that work for non-static, shapebase derived objects (player, vehicle, etc.)?
Thanks in advance.
It seems the 'lightGroup/EffectsDTSObjects=false' behavior is the ticket, but will that work for non-static, shapebase derived objects (player, vehicle, etc.)?
Thanks in advance.
#2
This will make the light unique to the vehicle - you'll need to find a way to light the player too (copy the light when mounted, or check to see what it's mounted to and pull its light).
09/05/2006 (4:15 am)
Hmm, the best way to do that might be to give the vehicle a LightInfo object that defines its light and make sure the light is added to the light manager in sgSceneObject::installLights (sgSceneObject.cc line 174), see sgSceneObject::installLightsAdvanced for an example of how this is done (when it adds the sgLightIds list lights). Make sure to remove the light in sgSceneObject::uninstallLights.This will make the light unique to the vehicle - you'll need to find a way to light the player too (copy the light when mounted, or check to see what it's mounted to and pull its light).
#3
Works, just what I was looking for.
Again, thanks for those pointers.
09/05/2006 (10:20 am)
Thanks John.Works, just what I was looking for.
Again, thanks for those pointers.
Torque 3D Owner Randy Condon
Default Studio Name
EffectsDTSObjects seems to only effect static Lights.
Implemented a test with setting the score on installGLLights to zero for Point types, depending on a new var passed to ignore dynamic lights or not. Managed to get only DTS objects lit that were designated to do so. (But didn't work for terrain, not that I have much terrain).
Probably not the general solution, but might work for what I'm working on. I'll give it a think overnight and have a look tomorrow. (Still testing and exploring, hence this approach).
The goal is to get an attached dynamic light that only lights the the main character and his vehicle. (No shadows)