Adjust brightness/gamma via TLK ?
by ExitReality · in Torque Game Engine · 05/08/2006 (2:03 pm) · 17 replies
Hi All - Orion Elenzil here.
does anyone know if it's possible to adjust the entire scene's gamma and/or brightness via TLK ?
- stock torque's SetDeviceGammaRamp() affects the entire monitor, and we only want to affect the TGE window.
- the DRL resource is awesome but unfortunately the performance hit with even its simple mode is too high for us.
Effectively,
i think i'd just like to bump up the ambient lighting on all polys.
does anyone know if it's possible to adjust the entire scene's gamma and/or brightness via TLK ?
- stock torque's SetDeviceGammaRamp() affects the entire monitor, and we only want to affect the TGE window.
- the DRL resource is awesome but unfortunately the performance hit with even its simple mode is too high for us.
Effectively,
i think i'd just like to bump up the ambient lighting on all polys.
#2
TLK's full-screen exposure level control is perfect !
At least in the first ten seconds of looking at it.
many thanks,
i'll let you know how it goes.
orion
05/08/2006 (3:56 pm)
John -TLK's full-screen exposure level control is perfect !
At least in the first ten seconds of looking at it.
many thanks,
i'll let you know how it goes.
orion
#3
05/08/2006 (4:59 pm)
Where is the exposure level located?
#4
It's a new GuiControl which you need to add to your GUI.
In my case, this meant adding it as the first child of the GameTSCtrl in playGui.gui.
From my playGui.gui:
05/09/2006 (5:44 pm)
@michael - It's a new GuiControl which you need to add to your GUI.
In my case, this meant adding it as the first child of the GameTSCtrl in playGui.gui.
From my playGui.gui:
new GameTSCtrl(PlayGui) {
profile = "GuiContentProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "0 0";
extent = "640 480";
minExtent = "8 8";
visible = "1";
cameraZRot = "0";
forceFOV = "0";
[b] new sgGuiFullScreenFilter(BrightnessFilter) {
profile = "GuiDefaultProfile";
horizSizing = "relative";
vertSizing = "relative";
position = "0 0";
extent = "640 480";
minExtent = "8 2";
visible = "1";
sgExposure = "0.40000 0.400000 0.400000 1.000000";
};
[/b]
#5
on both a fairly modern gfx card and on an old GeForce2 clunker.
Is that expected ?
05/09/2006 (5:45 pm)
John - i'm seeing a pretty consistent 10% frame-rate hit with this guy,on both a fairly modern gfx card and on an old GeForce2 clunker.
Is that expected ?
#6
05/09/2006 (6:21 pm)
Thank you very much.
#7
just a few minutes ago I found that sgGuiFullScreenFilter() is inside playGui.gui (even in stock TLK, but with setting visible="0"), so I came to forums to find out what more info from John about that..
As, the GG search didnt return any results + nothing in documentation.. But it's IN.
Okay, I came here and the first thread opened - is about sgGuiFullScreenFilter. nice ;)
back to topic: sgGuiFullScreenFilter could be nice sometimes to make some full-screen effects.. and I also have exactly 10% FPS drop when sgGuiFullScreenFilter.visible=true;
but i'm not sure if it is a right way to adjust gamma..
John?
05/09/2006 (6:31 pm)
Wow..just a few minutes ago I found that sgGuiFullScreenFilter() is inside playGui.gui (even in stock TLK, but with setting visible="0"), so I came to forums to find out what more info from John about that..
As, the GG search didnt return any results + nothing in documentation.. But it's IN.
Okay, I came here and the first thread opened - is about sgGuiFullScreenFilter. nice ;)
back to topic: sgGuiFullScreenFilter could be nice sometimes to make some full-screen effects.. and I also have exactly 10% FPS drop when sgGuiFullScreenFilter.visible=true;
but i'm not sure if it is a right way to adjust gamma..
John?
#8
That gui component is a very early version of the dynamic range lighting system shown at IGC (it was tossed together in the TLK branch before branching to the IGC demos where a more advanced version was developed). The code was never back-ported first due to performance reasons and then because Alex Scarborough contacted me with ideas for his own TLK DRL resource (the resource is really cool and is already on version 2.0 which includes bloom).
The exposure adjustment I was talking about is the macro SG_LIGHTING_OVERBRIGHT_AMOUNT in sgLighting.h, but as I mentioned above this can only be toggled on and off (the value can only be 1, 2, or 4, nothing in-between will work).
Getting back to the filter gui, it can easily be turned into a control for adjusting gamma or for use in post processing exposure control. I could put together a resource for this if it would be useful.
-John
05/10/2006 (12:30 am)
Hi guys,That gui component is a very early version of the dynamic range lighting system shown at IGC (it was tossed together in the TLK branch before branching to the IGC demos where a more advanced version was developed). The code was never back-ported first due to performance reasons and then because Alex Scarborough contacted me with ideas for his own TLK DRL resource (the resource is really cool and is already on version 2.0 which includes bloom).
The exposure adjustment I was talking about is the macro SG_LIGHTING_OVERBRIGHT_AMOUNT in sgLighting.h, but as I mentioned above this can only be toggled on and off (the value can only be 1, 2, or 4, nothing in-between will work).
Getting back to the filter gui, it can easily be turned into a control for adjusting gamma or for use in post processing exposure control. I could put together a resource for this if it would be useful.
-John
#9
05/10/2006 (7:00 am)
Yes please do thank you.
#10
Heh, this is kinda funny. You recommended checking out one thing in the TLK but i found another which seems like an orphaned child of yours but is pretty close to perfect for us!
Yes, Alex's DRL resource is truly awesome,
but it has a 15% to 30% framerate hit even when dumbed-down to just a static brightness/gamma-adjust.
so the 10% of the sgGuiFullScreenFilter is better for this particular use.
just to double-check, does the 10% sound reasonable ? could we improve that ?
SG_LIGHTING_OVERBRIGHT_AMOUNT: roger that, it's not really what we're after here.
It's pretty good as-is,
but any further expansion on it would be awesome.
05/10/2006 (10:36 am)
Hey John -Heh, this is kinda funny. You recommended checking out one thing in the TLK but i found another which seems like an orphaned child of yours but is pretty close to perfect for us!
Yes, Alex's DRL resource is truly awesome,
but it has a 15% to 30% framerate hit even when dumbed-down to just a static brightness/gamma-adjust.
so the 10% of the sgGuiFullScreenFilter is better for this particular use.
just to double-check, does the 10% sound reasonable ? could we improve that ?
SG_LIGHTING_OVERBRIGHT_AMOUNT: roger that, it's not really what we're after here.
Quote:Getting back to the filter gui, it can easily be turned into a control for adjusting gamma or for use in post processing exposure control.
It's pretty good as-is,
but any further expansion on it would be awesome.
#11
But this is highly dependent on your system, screen resolution, and the control's usage, as it only eats additional fill rate. As an example, higher screen resolutions will see a greater impact, and using the control to affect a smaller screen area will lessen the impact.
Just a note true gamma ramps are performed "for-free" on the video hardware, but affect the entire screen including the desktop and all other running apps. If you don't mind the way it works, using a gamma ramp is the preferred way. This control provides a cool alternative, but doesn't "ramp" the intensity change like true gamma does, it only increases the intensity of the screen area it covers, which is more of an exposure change.
05/10/2006 (1:16 pm)
I whipped up a resource last night. It simplifies the calculations to one or two post processing screen renders (depending on the selected options). The frame rate hit I saw was a 7% decrease (11% if using two pass rendering) in the stronghold mission with Kork, the village, and the trees in view, the control over the entire screen and a screen resolution of 800x600 on an ATI 9600XT.But this is highly dependent on your system, screen resolution, and the control's usage, as it only eats additional fill rate. As an example, higher screen resolutions will see a greater impact, and using the control to affect a smaller screen area will lessen the impact.
Just a note true gamma ramps are performed "for-free" on the video hardware, but affect the entire screen including the desktop and all other running apps. If you don't mind the way it works, using a gamma ramp is the preferred way. This control provides a cool alternative, but doesn't "ramp" the intensity change like true gamma does, it only increases the intensity of the screen area it covers, which is more of an exposure change.
#12
Aye the true video-hardware gamma would work fine,
except that
1. we only want to adjust our window, versus the whole screen
but worse
2. i found that torque's interaction w/ the hardware was kinda fragile and frequently left the video card with undesired gamma settings which were quite difficult for even a graphics-savvy user like me to reset.
so,
um..
whipped up a resource, you say ?
05/10/2006 (1:23 pm)
John you're a wonder.Aye the true video-hardware gamma would work fine,
except that
1. we only want to adjust our window, versus the whole screen
but worse
2. i found that torque's interaction w/ the hardware was kinda fragile and frequently left the video card with undesired gamma settings which were quite difficult for even a graphics-savvy user like me to reset.
so,
um..
whipped up a resource, you say ?
#13
05/11/2006 (8:32 am)
I submitted the resource yesterday, but I imagine it will take at least a week to be approved (this is a big conference week).
#14
05/11/2006 (4:36 pm)
I'll watch for it, thanks.
#15
i'm either not seeing it in the resources section of the site nor in your profile,
or GG just hasn't approved resources in almost two months, which is obviously possible,
so do you think you could point me to the un-approved version of that guy ?
cheers,
Orion
07/01/2006 (9:40 am)
Hi John -i'm either not seeing it in the resources section of the site nor in your profile,
or GG just hasn't approved resources in almost two months, which is obviously possible,
so do you think you could point me to the un-approved version of that guy ?
cheers,
Orion
#16
07/03/2006 (2:21 pm)
The resource just posted today: Torque Lighting Kit - Scene Exposure and Filter Control
#17
The one great thing about pixel shading with CG is that its a simple way to launch to all sorts of other effects, like sepia tone for instance.
07/09/2006 (5:55 pm)
Well misery loves company. My resource is on the same theme, and it hasn't been approved yet either. CG Dynamic GammaThe one great thing about pixel shading with CG is that its a simple way to launch to all sorts of other effects, like sepia tone for instance.
Torque Owner John Kabus (BobTheCBuilder)
The only control, other than the gamma ramp, is TLK's exposure level, but that only turn the exposure on and off - there's no middle ground, so I'm not sure that it will help.