Previous Blog Next Blog
Prev/Next Blog
by date

Plan for Jeff "Reno" Raab

Plan for Jeff "Reno" Raab
Name:Jeff "Reno" Raab 
Date Posted:Sep 21, 2005
Rating:Not Rated
Public:YES
Comments:YES
RSS Feed:GarageGames Blog feedor Subscribe with .
Profile Page:View profile page for Jeff "Reno" Raab

Blog post
things concerning HDR
Alrighty everyone, sit down around the campfire, for i bear important, and incredibly interesting news.
All of you know of a fanciful thing called High Dynamic Range lighting.
Well, the TTR team has developed HDR for Torque.

But, sad to say, not for TSE.
So for what you may ask?
TGE.

That's right, we've developed HDR for TGE. We're calling it Fixed Function High Dynamic Range out of sheer lazyness.
Some of you are probably asking, "whats your proof?"
well, i shall quote from my original posting on the TTR forums:

Quote:


Welp ladies and gents, the TTR coders have done it again.
We've broken every coding standard ever made.

This isnt strictly TTR related, so it should be in the clear to show, if not, i give full rights to EK to show up at my house and tazer me in the eye.



pretty no?

Allow me to explain what's going on here.
Basically, i'm sure all of you have heard of a pretty little thing called High Dynamic Range lighting, correct? Basically what that does is it allows the camera to simulate the adjustment of the visible range of light so that you can have an overall wider visible range. This introduces more vibrant, realisitic scenes.

Traditional HDR implementation requires at absolute minimum, pixel shaders 2.0, and about a gig of ram, usually more along the likes of ps3.0 and 2gb of ram.
However, there have been implementations that go as low as ps1.1(a helpful member of the GG community has acheived this)

So what have we got that's better? how about HDR that requires no shaders at all, and can run on any machine that can run the stock Torque Game Engine, as seen in the pic above.
We are rather accurately simulating how the eye perceives overbright, the effect that happens when you walk into a very bright area suddenly, like going outside from indoors.

This has been acheived without shaders, and actually runs faster that the psuedo HDR effect that the Torque Lighting Pack does, as well as being more accurate and vibrant.

Why should we care?
Because this will likely work its way onto TSE, saving us alot of power that would otherwise be attributed to the HDR shaders, giving us more elbow room, as well as other indie games having a massive edge over most professional studios.

Hope you enjoyed this little tech report.
me and Del have been working hard, and are still going.
-Reno out



After looking at this, some of you may begin to consider "That's just the Light Pack, but brightened"
Well, actually, its completely new code(and slightly faster, actually)
Not only is it new code, all the lighting in that scene is procedural(the lightmaps themselves are still static, but the ambient HDR lighting is completely calculated on the fly)
While it's still being polished, our dynamic apature code allows for the lighting to adjust to the apature of the camera dynamically, so dark areas are truly dark, and bright areas, as you can see, are truly bright. Our dynamic apature code will also include the support for the sudden transition of lighting, so walking outside from indoors acheives that overbright effect, which your camera will slowly adjust itself to, or vice versa.

We have the intent to show this off in full at IGC, so stay at the ready, because this stuff is danged cool.

Recent Blog Posts
List:03/31/06 - The Third Reich's New Home
01/20/06 - What's happened to TTR?
10/14/05 - Plan for Jeff "Reno" Raab
09/24/05 - Plan for Jeff "Reno" Raab
09/21/05 - Plan for Jeff "Reno" Raab
02/18/05 - Plan for Jeff "Reno" Raab
02/10/05 - Plan for Jeff "Reno" Raab
01/25/05 - Plan for Jeff "Reno" Raab

Submit ResourceSubmit your own resources!

Alex Scarborough   (Sep 21, 2005 at 05:01 GMT)
It should be noted that the scalar factor there is 2.2 and there is no bias. So, the LP can't do this, end of story. Sorry John. It should also be noted that this works on my iMac with a 600Mhz G3 processor and an ATi Rage 128 pro graphics card with 16MB of VRAM. 512MB of RAM. No performance impact at all running this.

Ian Roach   (Sep 21, 2005 at 05:06 GMT)
So this wouldnt be compatible with torque already using the lighting pack ?

damn impressive effect though, name your price :) Kaching $$$$

Look forward to seeing more of this at IGC :)

Greg Gardinier   (Sep 21, 2005 at 05:11 GMT)
Wow, so yeah... details, cost, where, when, gimme!

Justin Kovac   (Sep 21, 2005 at 05:14 GMT)
Ooo impressive! Does this only apprehend to the main light source? Or does it work on all (interior lights)?

Eric Elwell   (Sep 21, 2005 at 05:16 GMT)
*That* is awesome.

Trent "mittens" Polack   (Sep 21, 2005 at 05:16 GMT)
Is it actually real HDR (as in you're rendering the scene to a floating-point surface)?

If not, it'd be better to just call the effect "fake HDR" or just "bloom." Referring to it as an HDR-based effect would mean some kind of involvement with actual HDR surfaces of some sort. And one problem with this kind of technique is that you tend to get "washed out color" syndrome, since you're manipulating colors that the surface isn't necessarily designed to handle.

Jeff "Reno" Raab   (Sep 21, 2005 at 05:45 GMT)
Well, your right mittens, it's not true HDR, but that's mostly because we cant nessicarily render to FP surfaces in only fixed function without killing speed.
But at the same time, simply labling this as bloom doesnt work, because it has the general functionality of HDR, just not doing true FPS calculations.

@Justin: No, we plan to have the main apature adhere the the current visible coloring/light, and then go through all the nearby lightsources as well.

@Ian, actually, the way this is designed, it should work very well with the LP, though you might have to remove a line or two to get it there. I can run some tests this evening to see how hard it would be to acheive LP compatability. Having this plus the LP lights and shadows would make for some nice scenes.

@ Everyone asking about pricing or release dates: That's still a ways in the future, so we havent even put any real thought towards it. But pending John doesnt show up and my front door and kill me( :P )we do plan on selling this in the future. expect a price in the range of, if not slightly less than, the LP.

Alex Scarborough   (Sep 21, 2005 at 05:47 GMT)
Yes, it is totally fake HDR. We can't really deal with true HDR because the target computer (my iMac) can't handle true HDR surfaces. And as you saw, it doesn't work quite right. There are two parts to our extremely oversimplified calculation. All this is is a line applied to the scene coloration. You feed it real values, it multiplies them by a scalar, adds a constant, and then we have our new values which get rendered. Right now that constant doesn't work. with the constant, the effect we would have is the brights getting brighter, and overbrighting, the darks getting darker, and the specified values inbetween stretching to fill the gaps.

So, it's a greatly improved version of the Lighting Pack's "vibrant lighting" functionality that uses a few quads rendered in front of the viewport instead of texture RGB scaling. It's faster and has more functionality, which for 30 lines of code that runs on a computer Torque doesn't officially support isn't half bad. I suppose we could call it "Extra vibrant lighting" but then we'd have John wanting to kill us. Fixed-Function HDR just seemed to be the best way to describe what we're trying to do. If you have any suggestions, I'm open. No need to promise something in a name we can't deliver. Greater midrange lighting perhaps?

Justin Mette   (Sep 21, 2005 at 14:31 GMT)
This is pretty cool tech guys. In an ideal world, this tech would be included in the Torque Lighting Pack instead of as a separate pack. This would guarantee that the tech's work well together and potentially simplify integration (especially in later releases). Looking forward to the IGC preview.

Jeff "Reno" Raab   (Sep 21, 2005 at 17:01 GMT)
Sorry guys, had to post this second shot ;)
It was too nice to let up.

You can really see how it almost simulates the soft lighting in the whole scene, as well as trick your eye into thinking it's bloomed in the overbright areas to a degree.
I think it's pretty nice for just really getting started.

pic:


Clint S. Brewer   (Sep 21, 2005 at 17:24 GMT)
Quote:

In an ideal world, this tech would be included in the Torque Lighting Pack instead of as a separate pack.
whaaaa? in an ideal world this would be posted as a free resource giving back to the community that gives oooh so much :)

Jameson Bennett   (Sep 22, 2005 at 00:40 GMT)
hrrm...HDR is more than this for sure, calling it that is misleading at least. Scaling and adding a constant is a decent solution (isnt 2.0 scaling what the TLK does?), but far from an actual HDR implementation which implies a much larger range of lighting values than the eye can perceive.

Can this effect be tweaked according to environment, such as scaling based on ambient and other light at a position so it changes based on view? The effects in your screenshots are interesting, but the comment about not being able to do it with the TLK isn't very convincing without some visual proof.

Alex Scarborough   (Sep 22, 2005 at 01:14 GMT)
@Jameson: Yes, we know HDR is more than this. We've been over that already. For a fixed function render using only 0.03% of a 600Mhz processor, I'm willing to let a basic imitation slide. A true HDR implementation is flat out impossible on the target range of computers (computers that just *barely* run Torque). The reason the TLK cannot do this is that the TLK uses texture RGB scaling, which only accepts values of 1.0, 2.0, and 4.0. Our method accepts any scalar value greater than 0, and any bias value from -1 to 1.

Our scaling/constant system is used to fake that larger range of values that HDR allows. By adjusting the scalar and bias, it is possible to map any RGB color to any other RGB color (there are some restrictions because this is just one scalar and one bias for three colors, but you can easily work around that). The way the effect is designed to work is to pick a range of colors and expand it to a portion, or the complete, 0-1 standard range. Anything that gets pushed over that by our scalar/bias gets clamped as part of the OGL system. So, values below your specified range get darker, values above your specified range get brighter, and everything between expands to fill in the gaps.

And it all works on my ATi Rage 128 Pro to boot.

Trent "mittens" Polack   (Sep 22, 2005 at 01:32 GMT)
Yeah, so it's not HDR.

Call it what it is: a type of tone mapping (more like a cheap imitation, but I digress). Call it "adaptive bloom," "adaptive tone mapping," or whatever. HDR has nothing to do with it though.
Edited on Sep 22, 2005 02:07 GMT

Jeff "Reno" Raab   (Sep 22, 2005 at 06:50 GMT)
well, real HDR or not, it's danged pretty :)
to give a sense of the difference between our implementation, and the defult Torque lighting:

quite a difference, no?

Josh Moore   (Sep 22, 2005 at 07:24 GMT)
This is truely awesome!

Ian Roach   (Sep 22, 2005 at 08:36 GMT)
Awesome effect :)

Josh Williams   (Sep 22, 2005 at 09:49 GMT)
This is some cool looking stuff guys. Glad you posted about it. I would be more thoughtful about how you're talking about the Torque Lighting Kit however. Certainly, the Torque Lighting Kit represents a great value for any Torque licensee-- it goes well beyond offering any one lighting technique-- it incorporates a lot of impressive, helpful technology, excellent tools, and great learning manterials.

And just to note... John has some pretty amazing stuff in store for the next TLK update, some of which is very relevant here, and which you'll get to see at IGC. :)

In any case, we are all basically in this together. The more we help each other, the more we'll help ourselves. It's cool you guys have found a technique which has some nice results! And it's also neat that you're treading some new water that isn't covered exactly like this in the TLK already, as it stands in public release form today. In the future though, I think you'll be best served by trying to work with outstanding guys like John, rather than thinking in terms of somehow showing other people up.
Edited on Sep 22, 2005 09:51 GMT

Jeff "Reno" Raab   (Sep 22, 2005 at 16:59 GMT)
Didnt mean for it to come off like we where showing anyone up :/
THanks for the comments though Josh.

Actually, i have a pretty good feeling that mixing this with the LP(turning off the LP's overbright, because that'd turn some bizzare results)you could get some really nice things going :)

Again, apoligies if it appeared we took a "better than you" attitude :\

Remember folks, mixing 2 good things gets you better stuff, so you should get hte lighting pack anyways :P
(gah i love the LP's shadows)

Josh Williams   (Sep 22, 2005 at 21:01 GMT)
Hey Jeff, no worries. Thanks for posting about this cool technique! You guys are doing very cool stuff, and I know everyone will be excited to read the next .plans from you and Alex. :)

Ryan   (Sep 23, 2005 at 17:08 GMT)
looking really great.. Are you planning on waiting until TSE goes final before porting this over?

Alex Scarborough   (Sep 23, 2005 at 22:44 GMT)
@Ryan: For TSE, refer to Mitten's .plans. Forget about this for TSE. It would be pointless.

Apparatus   (Dec 01, 2005 at 01:59 GMT)
can we buy this ? :)

Alex Scarborough   (Dec 01, 2005 at 03:33 GMT)
No, but you can get it here for free. This is the more or less finished version of what was shown off in this plan. Have fun with it, and feel free to post or email me if you need any help.

You must be a member and be logged in to either append comments or rate this resource.