Fullscreen IR and nightvision effects...
by decryptoid · in Torque Game Engine Advanced · 07/26/2005 (3:34 pm) · 15 replies
For those of you who are wondering.... YES, you can do realtime fulscreen shader effects with TSE!
I just re-wrote a large portion of the GameTSCtrl (NOT guiTSCtrl) to support multiple rendering modes with shaders that change on the fly... and it works with ZERO framerate penalty (at least with my ATI X800, have not tested on other cards)
Here's a little taste of Infrared Mode::

I will prolly have this as a resource in late August, but I have a major project to finish first.
If you can't wait, here's generally what I did:
1) copied gamerender to a new function IN gameTSCtrl
2) make GameTSCtrl::renderWorld run the new gamerender function if in shader mode, and the regular gamerender function if in regular mode
2) in the new function, instead of the normal render, made gclientSceneGraph->renderscene render to a surface instead of the screen
3) then push the image to the screen running a shader on it's way
You can find most of what you need to do this in glowbuffer.cpp already. Glowbuffer is perfect since it shows you how to setup the ortho geometry so that the image is flat and perpendicular to the viewport.
My boss flipped when he saw the nightvision mode (you'll have to wait for that one!)
I just re-wrote a large portion of the GameTSCtrl (NOT guiTSCtrl) to support multiple rendering modes with shaders that change on the fly... and it works with ZERO framerate penalty (at least with my ATI X800, have not tested on other cards)
Here's a little taste of Infrared Mode::

I will prolly have this as a resource in late August, but I have a major project to finish first.
If you can't wait, here's generally what I did:
1) copied gamerender to a new function IN gameTSCtrl
2) make GameTSCtrl::renderWorld run the new gamerender function if in shader mode, and the regular gamerender function if in regular mode
2) in the new function, instead of the normal render, made gclientSceneGraph->renderscene render to a surface instead of the screen
3) then push the image to the screen running a shader on it's way
You can find most of what you need to do this in glowbuffer.cpp already. Glowbuffer is perfect since it shows you how to setup the ortho geometry so that the image is flat and perpendicular to the viewport.
My boss flipped when he saw the nightvision mode (you'll have to wait for that one!)
About the author
#2
07/31/2005 (10:50 am)
Pretty cool! Nice work.
#3
That looks exactly like how SOE does the Everquest 2 night vision. Just a different purplish shader.
08/13/2005 (4:55 pm)
I like it a lot!!That looks exactly like how SOE does the Everquest 2 night vision. Just a different purplish shader.
#4
08/13/2005 (6:21 pm)
That is pretty cool. Nice to see something new on the shader front. :)
#5
10/11/2005 (11:29 am)
Any news on a resource for this? Or will it be turning up on TDN around TSE/Shaders/Awesome_Stuff
#6
10/11/2005 (12:36 pm)
I am on travel until next week... but I'll try to put something up as soon as I get back!
#7
10/31/2005 (11:48 am)
Any status on this?
#8
11/03/2005 (12:44 pm)
I put up a resource but it may take a while to get approved.... If you wanna give it a try just shoot me an email and I can give you a few files to play around with.
#9
11/03/2005 (8:48 pm)
Thx dude.
#10
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=9104
Be sure to let me know if anything is wrong or unclear!
11/04/2005 (5:29 am)
Here's the resource...www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=9104
Be sure to let me know if anything is wrong or unclear!
#11
11/04/2005 (4:22 pm)
I'll test it out tomorrow. Thx thx..
#12
11/06/2005 (5:56 pm)
Works great, much fun. But do you know of a way to go through multiple shaders? Like, run things through a shader, then take the output of that and run it through a second, or third even..
#13
12/05/2005 (4:37 pm)
Have you tried multiple Custom Materials?
#14
12/06/2005 (10:37 am)
I have not personally, but I see no reason why that shouldn't work. You will have to change the code in the render routine to make more than one pass for that to work though.
#15
BTW I noticed BF2 Special Ops added some kind of static noise to the NV full screen effect. And a cheesy airbrush painted NV goggle outline. The latter effect while cheap is very effective.
12/08/2005 (4:17 am)
Hey thanks again for the resource. You didn't have to share the code but ya did. And I thank you (lol ZZTop song??). BTW I noticed BF2 Special Ops added some kind of static noise to the NV full screen effect. And a cheesy airbrush painted NV goggle outline. The latter effect while cheap is very effective.
Torque Owner Kevin Johnson