Game Development Community

Hope you like HDR, because I do

by Jacob Dankovchik · in Torque Game Engine Advanced · 10/29/2005 (4:02 pm) · 11 replies

Well, I've found a site with full code for creating a sample for HDR, and this is just what I needed! This probably isn't a perfect making of HDR, but it does indeed work. It involves multiplying the color of the texture by a certain number then setting the color of all pixels that are not over-exposed to 0. You then blur the remaining full power pixels and then do a tonemapping phase.

Since I'm really not too skilled with alot of programming, I just modified the glow shader. Since it performs a blur, I figured this would work perfect as I could just multiply and set the colors before it actually performs the blur in the shader. And after it does, do the tonemapping step.

Since I have a glow buffer applied to every surface, the FPS hit is rather hard. Don't have exact numbers, but it certainly doesn't run too smooth anymore.

I'm sitll working with the exposure levels. As you can see in the pictures below, its a bit over-done. However it still looks awesome I think!

Be sure to note the contrast of it all. Despite the fact the textures are bright and glowy all over, the dark shadowed areas are still shadowed, shaded areas still shaded. This is a nice step forward for me. :)

Normal picture:
img428.imageshack.us/img428/6159/nohdr7zw.jpg
And with HDR:
img428.imageshack.us/img428/8098/hdr2vj.jpg

#1
10/29/2005 (4:07 pm)
What was the site?
#2
10/29/2005 (4:17 pm)
www.gamedev.net/columns/hardcore/hdrrendering/

Heh, forgot..

Although I'm having some interesting issues right now.. Cant seem to get things to change.
#3
10/29/2005 (4:55 pm)
Thanks.
#4
10/29/2005 (6:23 pm)
That's very cool! I hope someone makes a resource to add HDR to TSE.
#5
10/29/2005 (6:26 pm)
Actually, as I went through this more I've found its very very flawed, what I've got now. I got lucky and hit something sorta close, but I need to restart all over and get things right..
#6
11/02/2005 (2:17 pm)
After a bit more work, I completely disconnected from the glow buffer. And glowing in general. I setp a rather ugly hacky method of doing some overbrightening with more contrast. I must admit, the results are rather exciting for me. These pictures use the same textures, just a bit of a different shader. This setup seems to really draw out a lot of character in the texture though.

Normal:
img154.imageshack.us/img154/8553/nohdr6ju.jpg

And with the changes:
img154.imageshack.us/img154/4493/hdr1yg.jpg
HDR or not, I think this may prove to be an interesting little shader setup for really drawing out some interesting detail. From plain dull grey to dirty, grungy metal. All with no extra textures. :)
#7
11/02/2005 (5:04 pm)
Hahahah, I'm having so much fun with this!

Right now however it only works off ambient light, which isn't any good. I'm going to set it up soon to work with the lightmap. Also the specular is all garbled up. But you need to see this picture I just made, the results are awesome!!

Here is the first, this is a plain, normal mapped rock texture.
img485.imageshack.us/img485/9928/rocklow2ow.jpg
And here is the exact same files run through my shader. Since I haven't got settings tweaked just right I turned up the ambient light all the way so you could see things, since thats what this shader only uses for light.

img485.imageshack.us/img485/540/rockhigh2bk.jpg
Of cource everything needs touched up, but I think this is very cool. The color is just really drawn out from the textures with this! Next step is tweaking things to work right then looking into anything for blooms.
#8
11/03/2005 (5:29 am)
Are you getting good performance cuz it looks real cool :)
#9
11/03/2005 (6:03 am)
Well, after I apply it to all surfaces, things get a lil rough, however that may simply be because of the flawed shader. There are some things in it that aren't very good. I'm going to do more work on it soon.
#10
12/29/2005 (7:24 am)
Any change you want to post this great thing as a resource? We could all use this info a lot :D
#11
12/29/2005 (7:33 am)
Actually.. I lost the shader recently and I haven't tried to remake it yet.. Go figure. heh.. I'll post it once I make it again.