Game Development Community

T3D 1.1 Beta 3 - Spotlight rendering through tsStatic visible meshes - LOGGED

by CSMP · in Torque 3D Professional · 03/24/2011 (8:53 am) · 15 replies

csmp.angelfire.com/bugs/Spotlight_Bug.png

Build: 1.1 Beta 3 Pro

Platform: Windows 7 64 bit

Target: In-Game

Issues: Spotlight type (and most likely pointlights?) lights are not being blocked by visible meshes and shine through solid walls, I do not have actual collision meshes so I'm limited to testing with visible mesh collision.

Steps to Repeat:
1. Launch the game
2. Create a spotlight type
3. Create a tsStatic structure in front of the spotlight and set the collision to visible mesh
4. You will see the spotlight through the tsStatic regardless of visible meshes blocking the light

Additional Notes:
This may or may not be an issue for tsStatics with collision meshes.

#1
03/24/2011 (9:43 am)
A light will shine through collision or anything else. The proper way to "fix" this is that the building should be casting a shadow (and therefore that entire chunk outside of the building will be in shadow)

In Basic Lighting this is a lot less doable as we don't have the glorious shadows Advanced Lighting does. In this case I'd check if zones disable lights when they're in the zone and you're not, or use a trigger around the area to enable the light when inside and disable when outside.
#2
03/24/2011 (9:51 am)
Turn "castShadows" on ...
#3
03/24/2011 (10:00 am)
I want to say that this already has an existing ticket, but I'm not sure.
#4
03/24/2011 (10:00 am)
Logged as THREED-1519.

EDIT:
I should refresh before I post. I didn't see a spotlight particular one in the tickets. I did see one about the sun, though.
#5
03/24/2011 (10:44 am)
@Bryan: I am using the spotlight for a mounted flashlight so those methods are less accurate when the light can be anywhere the character can fit.

@Steve: castShadows is enabled by default in my project, even though source and scripts say otherwise.

@Scott & David: Thanks for the quick response.
#6
03/24/2011 (4:12 pm)
I believe this thread HERE demonstrates the problem you are experiencing.

I've not actually played with T3D much since I made the above post (July 2009)
and I was hoping this would have been looked at.

@OP, try tessellating your model, and see if it fixes or at least
reduces the problem for you.

Cheers,

Hewster
#7
03/24/2011 (4:50 pm)
This is not a bug.

Lights without shadows will shine thru objects... collision plays no part in this.

The fix is to turn on shadows for that spot light.
#8
03/25/2011 (12:14 am)
how do you stop the flare from doing the same?
#9
03/25/2011 (2:02 am)
@deepscratch

The flare is a very different thing as its just a single point... tiny sphere really. If that sphere is occluded or partially occluded we can attenuate the flare.

The light is a volume emanating from a starting position.

I could fairly easily tell if that volume is completely occluded and not render the light at all... we do this to optimize shadow updates.

We can also tell if its partially occluded, but we don't know what parts those are. To know what parts are not visible you need to render the scene from the point of view of the light... thats what shadows are.
#10
03/25/2011 (2:19 am)
@Hewster: I have noticed that problem, but my main problem is Basic Lighting shadows.

@Tom: No shadows are not being cast in Basic Lighting.(guess I should have clarified) :)

@deepscratch: I set my tsStatics for visible mesh collision and it blocked the flare.
#11
03/25/2011 (2:26 am)
thanks Tom,
that helped me understand it a bit better, surely flares should be concidered as part of the light? and kinda do what it does?

I cant think of any example of where there could be a flare without a light....

thanks CSMP,
but a 25000 poly car mesh as its own collision mesh, just to hide flares from the brakes, doesnt work out.

idealy flares should be concidered as part of the light, and behave correctly.
#12
03/25/2011 (3:11 am)
@deepscratch: Lol... yeah that wouldnt work so well, I was having problems with that as well when mounted to the character, Having a flare that can inherit the Parent Spotlights direction and angle or even a seperate 'flareAngle' would be a great enhancement.
#13
03/25/2011 (9:15 am)
The best solution would be being able to constrain lights to only affect objects in the same zone they are at, and place the house and its contents inside a zone.
#14
03/25/2011 (11:29 am)
@Manoel

With Rene's improved zoning we considered that, but the zoning wouldn't be able to 'clip' the light unless we use stencil to reject lighting outside the working zone. Even then it would be hard to get to work with forward lighting unless we change it to render lights in a separate pass on the geometry.

A more generic solution is to allow a custom convex to be associated to a light. That convex is then used to clip the light in custom ways... like having a non-shadowed point light not spill thru a wall. This is what i hope to do in the next major release.
#15
03/25/2011 (5:30 pm)
The best solution would be to use a dif. a dif with separate lighting passes for the interior and exterior zones would be a great solution. =)