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
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
#2
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
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
Your example makes perfect sense:
Lightmap:

In-Games

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.
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:

In-Games

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
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
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
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?
03/07/2011 (8:57 am)
Late bump :PToday 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?
Employee Michael Perry
ZombieShortbus