Add Lighting effects to T2D
by Jason Swearingen · in Torque Game Builder · 08/08/2005 (4:33 pm) · 16 replies
Refer to my earlier thread for where this idea came from.
Since no lighting effects exist in T2D, i think it would be a great addition for a general-purpose lighting effect tool.. what would be the most gracefull way of implementing this in T2D?
And I do think it is a "general purpose" tool, or it COULD be.. below are my thoughts:
=================
I have no knowlege of how T2D performs scene renders, so bellow is what I am thinking conceptually it should be:
Allow ability to add a brightness layer to the scene.
0 = black
100 = normal
255 = white.
Add the ability to set the layer's scene's default brightness.
Allow brightness layer to be modified on a per-pixel level.
Allow a variaty of "effects" to modify the brightness according to user defined algorithms.
with these algorithms, you could make areas of the screen brighter, or darker.
Predefine the following algorithms:
Rectangle
Rectangle diffuse
Circle
Circle diffuse
Cone
Cone diffuse
=======================
Just an idea... I dont have the bandwidth to make this happen right now, so if someone else wants to explore this opportunity, it would be welcomed by me :)
Since no lighting effects exist in T2D, i think it would be a great addition for a general-purpose lighting effect tool.. what would be the most gracefull way of implementing this in T2D?
And I do think it is a "general purpose" tool, or it COULD be.. below are my thoughts:
=================
I have no knowlege of how T2D performs scene renders, so bellow is what I am thinking conceptually it should be:
Allow ability to add a brightness layer to the scene.
0 = black
100 = normal
255 = white.
Add the ability to set the layer's scene's default brightness.
Allow brightness layer to be modified on a per-pixel level.
Allow a variaty of "effects" to modify the brightness according to user defined algorithms.
with these algorithms, you could make areas of the screen brighter, or darker.
Predefine the following algorithms:
Rectangle
Rectangle diffuse
Circle
Circle diffuse
Cone
Cone diffuse
=======================
Just an idea... I dont have the bandwidth to make this happen right now, so if someone else wants to explore this opportunity, it would be welcomed by me :)
#2
And allowing the ability to set the fxSceneObject2D's lighting via an algorithm is cool too, but least nessicary i think)
08/08/2005 (5:36 pm)
It would also be very cool to be able to set a lighting level per- fxSceneObject2D... to cause it to glow/blink under certain conditionsAnd allowing the ability to set the fxSceneObject2D's lighting via an algorithm is cool too, but least nessicary i think)
#3
If you want a spotlight, grab a grayscale circle (feathered, if need be), and add that as a GL blended sprite (don't ask me what blend mode, it's been some months since I've touched T2D). Same thing with full screen brightness, only this time with a large rectangle, or some such thing.
I believe there have been discussions about per-pixel pallete adjustments, and those, from what I recall, were shot down rather quickly, since that sort of thing is slow and inefficient, and fairly narrow in scope to boot.
08/09/2005 (1:55 am)
I don't really know that you'd need Melv to add specific "lighting" effects, since you can do this rather easily with the GL blending modes (shown to great effect with the fish demo).If you want a spotlight, grab a grayscale circle (feathered, if need be), and add that as a GL blended sprite (don't ask me what blend mode, it's been some months since I've touched T2D). Same thing with full screen brightness, only this time with a large rectangle, or some such thing.
I believe there have been discussions about per-pixel pallete adjustments, and those, from what I recall, were shot down rather quickly, since that sort of thing is slow and inefficient, and fairly narrow in scope to boot.
#4
08/09/2005 (11:50 am)
Hmmm good thoughts Teck. i'll try out the fish demo before i open my mouth again :)
#5
08/09/2005 (7:04 pm)
Core Warz uses blend modes and a gradient-like sprite to produce lighting effects. These are pretty simple to do. If you're really lazy (like me, for example), I'd be happy to send you the functions and sprites I used.
#6
I would be interested in seeing your stuff, as I game idea I am working on would benefit from having some cool lighting effects.
Thanks
Mike
08/10/2005 (4:03 am)
@ Ted.I would be interested in seeing your stuff, as I game idea I am working on would benefit from having some cool lighting effects.
Thanks
Mike
#7
08/10/2005 (8:55 am)
Here's an honest question since I'm not tech savvy: If future Windows OS's aren't going to support openGL wouldn't it be wise to cut such uses now? I swore I asked this already, but I didn't see the post. Guessed I wussed out in embarassment.
#8
08/10/2005 (9:18 am)
Current versions of Windows aren't supporing OpenGL very well either. It's the graphics card manufactorers that do.
#9
There are 2 assumptions present in your statement, and both are false.
1: Future Windows OS's are not going to stop supporting OpenGL. Indeed, the GL support is actually being slightly improved (the non-ICD version goes from 1.1 to 1.4, and uses hardware through D3D, which is better than what we've had since the beginning).
2: When we said "OpenGL blend modes", that doesn't mean go start making OpenGL calls. The engine uses the OpenGL blending parameters to specify its blend modes, but the backend doesn't need to be OpenGL rendering, as long as those parameters are translated into whatever the backend renderer uses.
08/10/2005 (2:29 pm)
Quote:If future Windows OS's aren't going to support openGL wouldn't it be wise to cut such uses now?
There are 2 assumptions present in your statement, and both are false.
1: Future Windows OS's are not going to stop supporting OpenGL. Indeed, the GL support is actually being slightly improved (the non-ICD version goes from 1.1 to 1.4, and uses hardware through D3D, which is better than what we've had since the beginning).
2: When we said "OpenGL blend modes", that doesn't mean go start making OpenGL calls. The engine uses the OpenGL blending parameters to specify its blend modes, but the backend doesn't need to be OpenGL rendering, as long as those parameters are translated into whatever the backend renderer uses.
#10
Like I said, I don't claim to be tech savvy. I thought I read (on the GG forums, no less) that Windows Vista won't be supporting open GL. I could read more so I don't make the same mistake again, but that would require effort. Anyway, #2 cleared everything up (that sounds really bad when taken out of context).
08/10/2005 (2:58 pm)
Ah, I wouldn't call them assumptions as much as I'd call them "ignorances"... wait, assumptions was better, right? Yeah, yeah, they were assumptions. Like I said, I don't claim to be tech savvy. I thought I read (on the GG forums, no less) that Windows Vista won't be supporting open GL. I could read more so I don't make the same mistake again, but that would require effort. Anyway, #2 cleared everything up (that sounds really bad when taken out of context).
#11
08/10/2005 (10:31 pm)
Matt, you are reading "half truths." Windows Vista supports OpenGL. Torque and T2D will run on Windows Vista better than on Windows XP, because without a custom OpenGL device driver being installed, it will be hardware accelerated via DirectX. There are a bunch of non-Microsoft zealots out there that are always trying to spread just enough FUD to cause trouble. Unfortunately, for those that read just that, and don't look further, it spreads. Don't believe every 13 year old L337 H4><><0R. 0MG!!!!11111
#12
This is almost 100% accurate. There is an issue with Vista and OpenGL. The issue (that has been blown out of proportion) is that OpenGL ICDs (GL drivers specifically for your hardware made by the hardware manufacturer) will cause the Aeroglass desktop compositing feature to be deactivated while an application using an ICD is active. Obviously, for full-screen games, nobody cares if it shuts off desktop compositing or not.
The fear, of course, is that this will make ICD's unpopular for non-fullscreen apps, or that users will blame the application developers for turning off features of their desktop.
The solution appears to be that Microsoft needs to supply some information to IHVs (Independent Hardware Vendors. Graphics card makers. They make ICDs) that will allow them to alter their drivers to allow for desktop compositing to work. It may not even be required that Microsoft divulge this information; the IHVs might be able to figure out what to do just by studying how the desktop compositor works and fooling it into thinking that the OpenGL window is a D3D window.
I would point you towards some various forum threads on the web that deal with this issue, but almost all of them have so much disinformation (on both sides) that it's virtually impossible to see what the real issue is.
08/11/2005 (12:22 pm)
Quote:Torque and T2D will run on Windows Vista better than on Windows XP, because without a custom OpenGL device driver being installed, it will be hardware accelerated via DirectX. There are a bunch of non-Microsoft zealots out there that are always trying to spread just enough FUD to cause trouble. Unfortunately, for those that read just that, and don't look further, it spreads
This is almost 100% accurate. There is an issue with Vista and OpenGL. The issue (that has been blown out of proportion) is that OpenGL ICDs (GL drivers specifically for your hardware made by the hardware manufacturer) will cause the Aeroglass desktop compositing feature to be deactivated while an application using an ICD is active. Obviously, for full-screen games, nobody cares if it shuts off desktop compositing or not.
The fear, of course, is that this will make ICD's unpopular for non-fullscreen apps, or that users will blame the application developers for turning off features of their desktop.
The solution appears to be that Microsoft needs to supply some information to IHVs (Independent Hardware Vendors. Graphics card makers. They make ICDs) that will allow them to alter their drivers to allow for desktop compositing to work. It may not even be required that Microsoft divulge this information; the IHVs might be able to figure out what to do just by studying how the desktop compositor works and fooling it into thinking that the OpenGL window is a D3D window.
I would point you towards some various forum threads on the web that deal with this issue, but almost all of them have so much disinformation (on both sides) that it's virtually impossible to see what the real issue is.
#13
08/11/2005 (1:17 pm)
@Ted: i sent you a mail asking for that lighting code, hope you get it :)
#14
Primitive .plan
You can expect it in about a week, though someone will have to do a little renaming work if you want it to work with the current T2D version.
08/23/2005 (6:04 pm)
Just thought I'd point out that my updated primitive code will be able to do a lot of these "fake lighting effects":Primitive .plan
You can expect it in about a week, though someone will have to do a little renaming work if you want it to work with the current T2D version.
#15
08/23/2005 (6:22 pm)
I assume you all have looked at the fishdemo that comes with T2D and noted that example\fishdemo\client\effects\lightbeams.eff makes a dynamic lighting effect on the scene?
#16
08/24/2005 (5:29 am)
@Alex: That is done through additive blending, which is somewhat limited and would tend to wash out the colors in some cases. It all depends on what kind of lighting you need, of course. It works prefectly for the effect in that demo.
Torque Owner Jason Swearingen