Game Development Community

dev|Pro Game Development Curriculum

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:
img66.imageshack.us/img66/43/drl1none5jc.th.jpgimg91.imageshack.us/img91/9994/drl13ij.th.jpg

Outdoor Before/After
img114.imageshack.us/img114/8752/drl3none8at.th.jpgimg89.imageshack.us/img89/9531/drl32nn.th.jpg

Night Before/After
img380.imageshack.us/img380/1152/drl5none7iw.th.jpgimg130.imageshack.us/img130/5092/drl53lc.th.jpg

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.
Page«First 3 4 5 6 7 8 9 Next»
#161
04/16/2008 (3:00 pm)
Yes you're right. I fixed it above by removing that line altogether since the 'all references of .z to .Z
' covers it.

thanks!
#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
05/06/2008 (6:37 pm)
@BillF

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.
#165
05/06/2008 (6:54 pm)
@Jonathon

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.
#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?
#170
04/22/2009 (11:30 am)
does anyone know where I would set my bloom strength in script????
#171
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.
Page«First 3 4 5 6 7 8 9 Next»