CG Dynamic Gamma & Water Upgrade
by Paul Jan · 07/11/2006 (12:43 pm) · 171 comments
Download Code File
I've merged the code files with the sample files because I found the gui was required, and with other changes goes over the 100k limit on uploads - the full file can be downloaded here:
dynamic_gamma.zip
Update (2006/10/29): Torque 1.5 version code here:
Update (2006/11/23): Some more bug fixes added.... dynamic_gamma-1_5.zip
I'll leave the old one up for folks who aren't moving to Torque 1.5. I haven't had the chance to test it as well as I'd like, so let me know if its not working right!
Before/After:


Outdoor Before/After


Night Before/After


To be honest, the code is a cobbled mess in some places. Still framerate is pretty good, and I've tested it on ATI (radeon 9800) and NV ( 6800 GS) platforms.
It should pretty much be unzip, copy into TLK & recompile. You will still need to install the Nvidia CG libraries as well.
Previous resources and credit where credit is due:
CG Water (Manoel Neto) has not changed from the original resource (adjusted to make DRL work)
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=10357
+ Sky::render fix by David Laurie
CG Dynamic Gamma is similar in effect to the DRL 2.0 resource (Alex "Delerium" Scarborough)
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=10232
using CG shaders increases performance.
It also takes parts from 5.10 Game Programming Gems 4 "Dynamic Gamma Using Sampled Scene Luminance", and VERC "Real time TRON 2.0" collective.valve-erc.com/index.php?go=tron1
edit (Aug 11, 2006) Fixed bloom-crippling bug.
I've merged the code files with the sample files because I found the gui was required, and with other changes goes over the 100k limit on uploads - the full file can be downloaded here:
dynamic_gamma.zip
Update (2006/10/29): Torque 1.5 version code here:
Update (2006/11/23): Some more bug fixes added.... dynamic_gamma-1_5.zip
I'll leave the old one up for folks who aren't moving to Torque 1.5. I haven't had the chance to test it as well as I'd like, so let me know if its not working right!
Before/After:


Outdoor Before/After


Night Before/After


To be honest, the code is a cobbled mess in some places. Still framerate is pretty good, and I've tested it on ATI (radeon 9800) and NV ( 6800 GS) platforms.
It should pretty much be unzip, copy into TLK & recompile. You will still need to install the Nvidia CG libraries as well.
Previous resources and credit where credit is due:
CG Water (Manoel Neto) has not changed from the original resource (adjusted to make DRL work)
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=10357
+ Sky::render fix by David Laurie
CG Dynamic Gamma is similar in effect to the DRL 2.0 resource (Alex "Delerium" Scarborough)
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=10232
using CG shaders increases performance.
It also takes parts from 5.10 Game Programming Gems 4 "Dynamic Gamma Using Sampled Scene Luminance", and VERC "Real time TRON 2.0" collective.valve-erc.com/index.php?go=tron1
edit (Aug 11, 2006) Fixed bloom-crippling bug.
About the author
#162
05/01/2008 (8:30 pm)
Got this working great. Thanks Bill!!!
#163
05/05/2008 (9:49 am)
Has anyone figured out how to get the water reflecting correctly with AFX? I've tried merging the two playgui.gui files back and forth, trying this and that, to no avail.
#164
Will your changes work with the RTS Kit ported to 1.5.2 also? Is there any additional changes that need to be made other than the ones above after overwriting the files in my codebase? Thanks.
05/06/2008 (6:37 pm)
@BillFWill your changes work with the RTS Kit ported to 1.5.2 also? Is there any additional changes that need to be made other than the ones above after overwriting the files in my codebase? Thanks.
#165
I was able to get it to work with the RTS kit, but it required some more tweaks in the RTS specific code. I could discuss this in the RTS only forums or offline if you want.
05/06/2008 (6:54 pm)
@JonathonI was able to get it to work with the RTS kit, but it required some more tweaks in the RTS specific code. I could discuss this in the RTS only forums or offline if you want.
#166
05/07/2008 (1:17 pm)
If you want to post your additional RTS changes on the private RTS forums, that would be great. I am sure that others would also like to see this. Thanks.
#167
05/15/2008 (2:45 pm)
Did you have any luck on this BillF?
#168
10/04/2008 (4:22 am)
Thanks BillF, I got this working with TGE 1.5.2
#169
01/05/2009 (5:01 am)
It appears that the water turns invisible while alt-tabbing, or changing graphics-settings in-game. How would I fix this?
#171
Remember to change in your CG/include/cgGl.h to have dgl/dgl.h instead of GL/gl.h (i forgot, i had to go find the orig tut to find out!).
Copy over/merge with your tge 1.5.2 files!
Click Here For File!
Noticed 1 bug though is that when you are underwater when you lookup all you see is the skybox.
05/29/2009 (12:06 am)
i have merged BillF's changes with the patch for 1.5.2 and uploaded to my server. I have Compiled and tested this on vc6,vs2008!Remember to change in your CG/include/cgGl.h to have dgl/dgl.h instead of GL/gl.h (i forgot, i had to go find the orig tut to find out!).
Copy over/merge with your tge 1.5.2 files!
Click Here For File!
Noticed 1 bug though is that when you are underwater when you lookup all you see is the skybox.

Torque Owner BillF
' covers it.
thanks!