Game Development Community

dev|Pro Game Development Curriculum

Because I just can't drop DRL...

by Alex Scarborough · 04/27/2006 (11:27 pm) · 8 comments

I really wanted to get away from rendering. I've even got some work lined up that has absolutely nothing to do with rendering. At all. But, I think I'm becoming addicted to little rendering side projects. It all started so innocently... just an optimization here, a tweak there, a scale/bias maybe... Now I'm working on Dynamic Range Lighting and bloom and exposure blending... when will it stop?

So... ya. I put GLSL support into Torque because... well, people really want to use actual GLSL shaders instead of Cg shaders from what I've seen. And hey, who says copying 157 function declarations and #defines isn't fun? But, I needed to test the GLSL support. Preferably with some sort of post-process rendering effect...

DRL

Take a good long look at that picture. That is DRL as it is today. Also note the framerate. Ouch. 21.4 FPS. I usually get 80-100 without DRL.

Whoo shader!

See any difference? You should. Check the FPS. 34.3. That's a pretty nice improvement, wouldn't you say? With some careful juggling of settings, I was able to get shaderized DRL going at around 60 FPS. No bloom, but I did keep exposure blending going (had to actually, it's hardcoded in the shader). Without shaders, the only way DRL ever hit 60FPS in this mission is if everything was disabled except the tonemap. No bloom, no exposure blending, no brightness/contrast adjustment. Just a constant scale and bias.

Moral of the story: Shaders rock. Look forward to a resource that adds GLSL support to Torque in the near future. (Note: by support, I mean you can put shaders in Torque. I won't be going through and shaderizing Torque's rendering pipeline. Ever.) DRL with shaders rocks a lot. Look forward to an update to DRL that shaderizes it in the near future. Incidentally, the entire DRL shader takes up only seven lines of GLSL code. There's a lot of space to add some spiffy effects in there...

#1
04/28/2006 (2:02 am)
I officially love you.
I've been trying to get basic GLSL shaders into torque for weeks now (for reflections), and Ive only gotten as far as rendering to a texture... It think... Theres no way to test it, because it doesn't store the image outside of memory. I'm not even sure if thats working. the function is called, and there are no complaints...
I'll just wait for your resource before trying anything else...
#2
04/28/2006 (7:51 am)
Man that is looking great!
#3
04/28/2006 (11:54 am)
There's a bigger diff, the second pic is lighter ;)

Looking good man. I want -more-

[Ishbuu]
#4
04/28/2006 (3:06 pm)
A good one, Alex!
I would buy DRL kit with GLSL support ;) especially if it runs on Mac!
Though, I'm already a TLK owner
#5
04/29/2006 (2:35 pm)
Anybody doing this for TSE yet?
#6
04/29/2006 (3:51 pm)
I belive TSE has it in a way of shaders support...
#7
04/29/2006 (4:08 pm)
@Alexander: TSE supports HLSL shaders, which only work with DirectX. It does not, at the moment, support GLSL shaders, which work with OpenGL. I have no idea if anyone is actively working on porting TSE to OpenGL/GLSL
#8
04/29/2006 (4:15 pm)
Good point, Alex, I just meant the lightning techniques in general.
From what I know, the next TSE milestone may/will have atleast fixed function shaders and port to OpenGL. Expecting it during this summer.