Game Development Community

Best/most efficient way for dynamic lighting in TGB?

by witcher · in Torque Game Builder · 01/22/2011 (10:04 am) · 5 replies

Hi!

I am currently working on my first game done with TGB. I wanted to wait for the new torque 2d for native
lighting integration but it seem its not for now ^^.

So now I want to know, for you, what is the most efficient dynamic lighting method you use...
using things like lightmap atached to actors is not a problem for me, as I excel in graphic editing software.
Maybe I missed an easy option in TGB but at least I searched the forum (with google because the search bar was broken) before posting ^^. for additional information, I dont own the full source version but I plan
to buy it if the need is big. by the way, point light would be the MOST important type of lighting I try
to reproduce.

So I will wait for your kind answer, thank you!

BTW: GarageGames for ever! :D

About the author

Recent Threads


#1
01/22/2011 (11:12 am)
@witcher - Thanks for the GG support =). As for lighting, T2D does not support real time lighting. This is something you would have to integrate yourself. I have seen a lot of demos where people have done so, but it would require a lot of changes to the rendering system. A year or two back, we created an R&D project for a future 2D engine that utilized Torque 3D's GFX system. Essentially, the 2D demos had materials and full dynamic lighting of multiple point lights. This is not something we plan on releasing, since it was just an R&D demo, but it is doable.
#2
01/22/2011 (11:37 am)
@Michael - Thanks for the quick answer, but theres not a hack to do some lighting? in rpg maker for example, you could make an image where all light would be black and dark area would be white, and then you setted the render mode (for this image) to substract. it was nice, but rpg maker does not allow dynamic and fast image movement like TGB. So I guessed you could atach a black image to a character and set it to substract. Im new to TGB, so I dont know if such option exist...

heres an exemple of what I talk about:
lightmap:
http://img262.imageshack.us/img262/4668/lightmap.png
in-game:
http://img140.imageshack.us/img140/3136/ingamelightmap.png
#3
01/22/2011 (11:47 am)
@witcher - You can definitely fake it in stock T2D using blending, mounting, and ray casts for simulating a lighting effect. It is far removed from a proper dynamic lighting system. I haven't really tried to fake lighting for an entire scene, but it's worth investigating.

Your example makes perfect sense:

Lightmap:
img262.imageshack.us/img262/4668/lightmap.png
In-Games
img140.imageshack.us/img140/3136/ingamelightmap.png
So that does not exist in stock T2D. Changes to the render system would have to be made. If you form a team with an advanced programmer, where both of you have T3D, it is more than possible to port the GFX system to T2D and achieve dynamic lighting. This would not be a small task, but I know it's possible.
#4
01/22/2011 (12:52 pm)
@michael - dont worry, I have the time/patiente to fake it for an entire game :)
For my needs, I think il fake it because I only need some point lights on 2-3 objects in a dark places...no need for fancy real time lighting.

native lighting support would be a MUST for a future 2d engine, I know a lot of peoples who would buy it almost only for that :)

As I am just a beginner, is there a tutorial on how to use a simple substract blend mode? I can only find source factor, destination factor and blend color.

I can even make colored lighting by using the inverted color on the lightmap :P
#5
03/07/2011 (8:57 am)
Late bump :P

Today I checked on the TDN website and found that a substract blending mode is perfectly possible. (in TGB or torque 3d?)

�¨The subtract extension adds two new equation types for blending: subtract and reverse-subtract

Subtract - Cd = (Cs * sC) - (Cd * dC)
Reverse-Subtract - Cd = (Cd * dC) - (Cs * sC)
To use these blend equations you would call glBlendEquationEXT with GL_FUNC_SUBTRACT_EXT, or GL_FUNC_REVERSE_SUBTRACT_EXT.�¨

Can someone explain all of this to me? I would need some code to make my images work right?