Game Development Community

Check color of lightmap.

by Mathew Roppe · in Torque 3D Professional · 08/02/2010 (4:29 pm) · 5 replies

I'm trying to create a stealth element for my game. Right now I'm using triggers to detect when a player enters and leaves a shadow, but I now I want to make moving/changing shadows.

I've heard of detecting the color of the lightmap that you're standing on, but how would you do so?

About the author

Recent Threads


#1
08/02/2010 (6:49 pm)
I'd expect with a raycast to the ground and then return some sort of RGB value of the material ...

I vaguely remember an old thread in the TGE section about this, but can't remember if it was ever resolved. Maybe try a search in that forum?
#2
08/02/2010 (7:18 pm)
I've been searching the forums but no luck. Only place I saw this solution mentioned didn't go into detail about how to detect color of the lightmap.
#3
08/02/2010 (7:31 pm)
TGEA used this trick on sampling the lightmap on the ground to emulate entering and leaving shadows (it would use the same amount of darkness on the player). The lighting code has changed significantly, but looking at the old TGEA code might give you some ideas to get started with at least.
#4
08/02/2010 (7:53 pm)
Alright I've been trying to familiarize myself with torque script but still have troubles with things not covered in documentation/forums/tutorials.

I did a dump of an object and light but there wasn't a dynamic field that held RGB information that could be referenced.

Is there some work-around that I'm unaware of?
#5
08/02/2010 (8:21 pm)
I did find an old post that required changing source code but looked liked it works, but links to example dll were broken. In concept I understand it, but I haven't ventured into changing source code yet.

http://www.torquepowered.com/community/forums/viewthread/95225