Some questions about point lights and shadows
by Oscar Velzi · in Torque 3D Professional · 02/16/2011 (9:04 am) · 7 replies
I have a couple of questions regarding some things I'm experimenting with interior lighting in our "isometric" RPG.
One thing I want to make (well, our programmer, not me), is to make a toggle in some lights to prevent the characters (PC and NPCs) casting shadows from that light, but having all the rest of the geometry cast shadows. Basically, everything cast shadows except for characters. Has anyone done it? Is it hard? I don't want our programmer to waste time looking for something that can't be done.
Another thing I would be interested is in a "half-point light", basically, a light that only lights in a semicircle. I'm pretty sure it can't be done, but well, can't hurt to ask.
Anyway, any help or pointers are appreciated! Thanks!
EDIT: Better clarity in the first question.
One thing I want to make (well, our programmer, not me), is to make a toggle in some lights to prevent the characters (PC and NPCs) casting shadows from that light, but having all the rest of the geometry cast shadows. Basically, everything cast shadows except for characters. Has anyone done it? Is it hard? I don't want our programmer to waste time looking for something that can't be done.
Another thing I would be interested is in a "half-point light", basically, a light that only lights in a semicircle. I'm pretty sure it can't be done, but well, can't hurt to ask.
Anyway, any help or pointers are appreciated! Thanks!
EDIT: Better clarity in the first question.
About the author
Lead Artist of Iron Tower Studio
Recent Threads
#2
About the spotlight, I tried that but it didn't work..
02/16/2011 (11:29 am)
Oh, I wasn't clear enough. I meant that those lights should cast shadows from all the geometry except for characters.About the spotlight, I tried that but it didn't work..
#3
02/16/2011 (12:45 pm)
Do you need the lights to be dynamic ? If not then I guess you could bake some lightmaps for the interiors.
#4
02/16/2011 (8:25 pm)
Yes, I know, but it's not an option at this point of development. Thanks =)
#5
The issue is you want certain lights to skip rendering characters to the shadows?
This isn't supported right now, but what you want to do is have is a per-light ObjectType mask. You can quickly hack something into the shadow map classes. For example in 'engine\source\lighting\shadowMap\dualParaboloidLightShadowMap.cpp' around line 108:
... basically every call to sceneManager->renderScene() in the shadow map classes would need a similar change. If you wanted to control this per-light then you need to have a setting from the light itself control the mask.
I've entered a feature request to have per-light object type masks, but it won't happen until after 1.1 final. THREED-1419
02/17/2011 (9:46 am)
@OscarThe issue is you want certain lights to skip rendering characters to the shadows?
This isn't supported right now, but what you want to do is have is a per-light ObjectType mask. You can quickly hack something into the shadow map classes. For example in 'engine\source\lighting\shadowMap\dualParaboloidLightShadowMap.cpp' around line 108:
// Front map render
{
GFXDEBUGEVENT_SCOPE( DualParaboloidLightShadowMap_Render_FrontFacingParaboloid, ColorI::RED );
mShadowMapScale.set(0.5f, 1.0f);
mShadowMapOffset.set(-0.5f, 0.0f);
sceneManager->renderScene(baseState, 0xFFFFFFFF & ~PlayerObjectType); // CHANGED!
}... basically every call to sceneManager->renderScene() in the shadow map classes would need a similar change. If you wanted to control this per-light then you need to have a setting from the light itself control the mask.
I've entered a feature request to have per-light object type masks, but it won't happen until after 1.1 final. THREED-1419
#6
02/17/2011 (11:05 am)
Thanks for pointing at the place where the magic happens. Very helpful post, Tom.
#7
02/17/2011 (11:09 am)
Thanks Tom! =)
Torque 3D Owner Bryan Sawler
muteki corporation
As for the half-point light...not really -I suppose you can do a spotlight with a wide-enough radius to get roughly the same effect?