Jump to content
The Dark Mod Forums
Sign in to follow this  
Ralle321

High Dynamic Range Rendering Possible?

Recommended Posts

Hello everyone.

Is it possible to integrate HDR or some kind of Fake-HDR in the Darkmod to see a little better in dark areas?

I could also imagine a magical item from the keepers which emits a weak light only the wearer can see. :)

That would be a nice way to have a better visibility than just increasing gamma in the options.

Share this post


Link to post
Share on other sites

HDR has nothing to do with seeing in dark areas, I'm guessing you are referring to radiosity or global illumination techniques. These are possible to simulate by using ambient lights in a map, but cannot be added to the Dark Mod because we do not have the renderer source code.

Share this post


Link to post
Share on other sites

He's referring to pupil dilation simulation, which is unfortunately often lumped in with "HDR".

 

Is it possible with the available tools to dynamically brighten/darken the currently rendered scene?

Share this post


Link to post
Share on other sites

One could raise or lower the brightness of the ambient light, so I think the answer is yes.

 

If you want to achieve an effect similar to the flashbomb you'd have to go a different way and create an overlay over the player's view.

 

Another (more complicated) possibility would be to define a shaderParm on every material that could be set during runtime, but this might be cumbersome.

Share this post


Link to post
Share on other sites
One could raise or lower the brightness of the ambient light, so I think the answer is yes.

 

I think ZylonBane was asking if this could be done dynamically, based on the overall brightness of the current render, rather than statically in the map. It might be possible to hack, for example the lightgem brightness value could be linked with the brightness of a global ambient which is dynamically adjusted, but this would not be a very good solution mainly because the lightgem visibility need not correspond with the brightness of the player's view.

Share this post


Link to post
Share on other sites

Hmm... could we manipulate the gamma setting from within the SDK?


My games | Public Service Announcement: TDM is not set in the Thief universe. The city in which it takes place is not the City from Thief. The player character is not called Garrett. Any person who contradicts these facts will be subjected to disapproving stares.

Share this post


Link to post
Share on other sites

It's just a cvar isn't it?

 

The main issue would be detecting the image brightness; you'd have to perform a low-resolution subrender (like the lightgem does) and integrate to produce an overall intensity, which would be yet another render and hence a performance impact.

Share this post


Link to post
Share on other sites

And it would look like crap as well. Because if you just raise the gamma, and the gamma is already rather high, then the map will look like shit.


Gerhard

Share this post


Link to post
Share on other sites

I personally don't think that TDM would benefit from HDR. Any affect such as a glow around a street lamp could easily be replicated with the use of a sprite and I cannot think of any other instance where HDR would really come in handy other than that.

Share this post


Link to post
Share on other sites
I personally don't think that TDM would benefit from HDR. Any affect such as a glow around a street lamp could easily be replicated with the use of a sprite and I cannot think of any other instance where HDR would really code in handy other than that.

Oh for the love of god. What you're describing now is bloom, not HDR.

 

I don't see why people have such a hard time grasping what High Dynamic Range rendering is. It's so bloody simple-- It's when the renderer internally calculates the brightness of a scene using a luminance gamut (the eponymous "dynamic range") beyond what the output device can display.

 

This, as a side effect, makes it possible to do very realistic pupil dilation simulation, by dynamically expanding/contracting the clamping window onto the HDR data. Bloom is generally used to soften the edges of the regions of the screen which HDR causes to go into an overbrightened state (beyond #FFFFFF).

 

Pupil dilation effects can be simulated without HDR, but it's not as effective, and it's not a gamma operation. It's closer to what you get with a Levels adjustment in Photoshop/PSP/etc.

Edited by ZylonBane

Share this post


Link to post
Share on other sites

From what I understand, HDR is digital photography/rendering related. The photographer takes three pictures of the same scene but with different exposures.

 

http://en.wikipedia.org/wiki/High_dynamic_range_imaging

In computer graphics and photography, high dynamic range imaging (HDRI) is a set of techniques that allow a far greater dynamic range of exposures (i.e. a large difference between light and dark areas) than normal digital imaging techniques. The intention of HDRI is to accurately represent the wide range of intensity levels found in real scenes ranging from direct sunlight to the deepest shadows.

 

HDRI was originally developed for use with purely computer-generated images. Later, methods were developed to produce a HDR image from a set of photos taken with a range of exposures. With the rising popularity of digital cameras and easy to use desktop software, the term "HDR" is now popularly used[1] to refer to the process of tone mapping together bracketed exposures of normal digital images, giving the end result a high, often exaggerated dynamic range; however, in this case neither the input nor the output qualify as "true" HDRI.

 

HDR images were first produced with various renderers, notably Radiance. This allowed for more realistic renditions of modelled scenes because the units used were based on actual physical units e.g watts/steradian/m2. It made it possible for the lighting of a real scene to be simulated and the output to be used to make lighting choices (assuming the geometry, lighting, and materials were an accurate representation of the real scene).

 

http://en.wikipedia.org/wiki/High_dynamic_range_rendering

Preservation of detail in large contrast differences

 

One of the primary features of HDRR is that both dark and bright areas of a scene can be accurately represented. Without HDR (sometimes called low dynamic range, or LDR, in comparison), areas that are too dark are clipped to black and areas that are too bright are clipped to white. These represented by the hardware as a floating point value of 0.0 and 1.0 for pure black and pure white, respectively.

 

Graphics processor company NVIDIA summarizes one of HDRR's features in three points[4]:

 

* Bright things can be really bright

* Dark things can be really dark

* And details can be seen in both

 

The images on the right are from Crytek's FarCry, demonstrating a new patch that enables Shader Model 3.0 effects. In the HDR render (the left image), the bright light from the outside casts a blue glow where it enters using light blooming, allows details underwater to be seen, overall gives the scene more vibrance, and the darker spots have the same amount of detail compared to the low dynamic range image. In the low dynamic range render (the right image), there is no light blooming where the light enters from, and the overall scene looks dull.

Farcryhdr.jpg

Pupil dilation?

 

HDR is used to solve a problem:

http://www.cybergrain.com/tech/hdr/

The Problem

 

Here's the problem in a nutshell:

 

* Real-world scenes contain light ranges that exceed a 50,000:1 dynamic range.

*For over a thousand years, media has been limited to around a 300:1 dynamic range.

* So you have a mapping issue: how do you represent light values in a scene using a much more limited set of light values for a particular media?

The latest photoshop & other ps plugins have HDR related functionality.

Share this post


Link to post
Share on other sites

I think what he meant is manipulating the brightness of various parts of the screen so that bright spaces are more realistically bright and dark places more realistically dark compared to a standard render, so increasing contrast on a differential level to simulate high dynamic range. That's just the way I understood it.

Share this post


Link to post
Share on other sites

For anyone who doesnt' understand yet - to put it in laymans terms, is it's making the game world behave like the backlighting on a video camera does. It's range can't capture the full range of dark to bright that our eyes can (just as the monitor can't display the full range we can see in real life), so it adjusts up or down depending on the incoming light. That also means when you're in a dark room which the camera has adjusted to, and look at a bright window that shows the light outside, it's insanely bright, and glows - just like ascottk's example pic up there.

Share this post


Link to post
Share on other sites

The existence of HDR lighting information does, of course, allow the pupil simulation to produce better results than just modifying the brightness curve of a standard image. Conversely, while it is possible to have pupil simulation with standard dynamic range rendering, HDR without pupil simulation would be pretty pointless.

Share this post


Link to post
Share on other sites

@ZB - well having the high range data available to select the smaller range from (to be recorded by the camera or displayed by the monitor) is HDR data, the way I understand it.

 

Also (to be pedantic) it's not simulating pupil, its simulating a camera. The exaggerated glowing effects like in ascottk's image are what's captured on film (if it were a camera). What we see if we were there in real life, is much clearer and less glowy - because although we experience the same effect, its on a much larger scale of brightness range, so its not as exaggerated as what's in ascottk's image.

Share this post


Link to post
Share on other sites
Conversely, while it is possible to have pupil simulation with standard dynamic range rendering, HDR without pupil simulation would be pretty pointless.

No, it wouldn't be pointless. HDR allows the rendering engine to perform much more realistic operations on everything that involves lighting, by allowing luminance values beyond the range 0-255 to be processed internally. This article provides an excellent practical example of the value of HDR rendering.

 

Basically it allows overbright light sources to stay overbright, even after passing through all the various transparency/refraction/reflection filters. Unlike LDR, where 255 is the brightest you can be, and it only degrades from there. With LDR you could stick a light source that's supposed to represent a star going supernova on the other side of a tinted window, and it'll end up looking no brighter than a desk lamp.

 

Also (to be pedantic) it's not simulating pupil, its simulating a camera. The exaggerated glowing effects like in ascottk's image are what's captured on film (if it were a camera).

When the engine dynamically adjusts the brightness of the scene based on the brightness of the player's surroundings, that's pupil simulation. The glowing effect is bloom, although human eyes do perceive similar effects naturally when going from a dark environment to a brightly-lit one. Ever been out at night, then look directly at a full moon? The moon appears as a featureless white disc until your eyes adjust.

Edited by ZylonBane

Share this post


Link to post
Share on other sites

Re: pupil vs. camera ... if you want to get really technical, I'd say you can both (Domarius & ZB) be right.

 

The same job of the pupil is being done by the f/stop for a camera (basically the camera's pupil); controlling how much light gets through. In that respect, they can both give an "over-exposed" look by opening more than what's considered normal. But it's also true that the retina resolves a much wider contrast range than film (actually, for film this is related to the film speed; the slower it is the more easily it gets over-exposed, but even at its fastest it can't resolve as well as the retina). So a pupil would have to do more work, so to speak, to get the same over-exposre effects as a comparable change in f/stop (a difference which just increases as the film speed slows). And even then the retina has little tricks that film (or a renderer) doesn't, such as artificially exaggerating light contrasts at contours so that the contour still gets filled-in even though the image actually hitting the retina is even more washed out than the image we see.

 

Dom's point was just that the wider-range of the retina lessens how pronounced the 'washed out' look appears (and thus how prounounced the dilation effect would affect it), the screenshots looking more like film than vision in that respect, which is probably right if you actually tested it. (Put a person in the shed and then render the same scene in-game, and he may say that the over-exposed look in-game or on film is more than the over-exposed look from his unadjusted pupils). But even if that's right, the over-exposure effect is still there; and there are plenty of aesthetic reasons why graphic artists might want to manipulate how pronounced the effect is.

 

And ZB's point is that in any event, what we are talking about is really the exposure-simulating mechanism itself, simulating an opening pupil or f/stop to allow a little washing-out -- in which case cameras and eyes are doing the same job ... so there's no need to even really distinguish (nevermind that the receptive sensitivity is different between the two, so they wouldn't look exactly the same).

 

You're both right, IMO, just arguing different points altogether (ZB focusing on the thing doing the over-exposing, the pupil/fstop, Dom focusing on the thing getting over-exposed, the retina/film speed).

Edited by demagogue

What do you see when you turn out the light? I can't tell you but I know that it's mine.

Share this post


Link to post
Share on other sites

Well... no. When I say pupil dilation simulation, what I'm describing is a mechanism by which the "f-stop" of the scene adjusts dynamically to the current light level in the player's field of view. You know-- like the human pupil does.

 

Simulated pupil dilation is something that sits on top of the system you describe above, dynamically twiddling the knob as needed. For example, say you have an HDR range of 0-1000. When you're outside, staring at the sun, yadda yadda, you'd probably want to scale this range so that 900 maps to 255 (the brightest value your monitor can display), and anything over that burns to pure white, giving a nice overbrightening effect. Compressing such a wide dynamic range down like this would cause areas of low brightness, like shadows, to appear more-or-less pitch black, just like in real life. But then, say you step into a mostly dark area. The engine detects this, and adjusts the scaling so that something lower, like 500, maps to 255. Now anything over 500 will burn to pure white (don't bother looking out that window!), but the low end of the dynamic range will have expanded, allowing the player to discern details that were previously indistinguishable. Again, just like what happens in real life when your eyes adjust to a dark area.

 

There's something in Thief I'm occasionally guilty of, and I doubt I'm the only one here that's done it. Sometimes, when I'm sneaking through a particularly dark area of a mission, I'll tap the ol' gamma-adjust keys to brighten the view, then knock the gamma back down when I'm in a well-lit area. This is generally regarded as a mild form of cheating, but really, it's just manually doing what our own eyes would do automatically in this situation.

Share this post


Link to post
Share on other sites

I know it happens with your own eyes (I mentioned that). But what I was originally trying to say is that the game is really emulating a camera. The monitor can only display the same limited range as a camera can record, and the end result (in movies and games) is a lot more brilliantly glowing scenes than we would see in real life.

 

And the glowing effect is acheived with the HDR info. Bloom is a cheap effect that blurs everything additivley, so mostly it does make brighter areas look more blury, but it just makes everything look like fuzzy "hollywood starlet" view. HDR keeps the sharpness while brightening the correct bits.

 

http://au.gamespot.com/features/6147127/p-4.html

 

For example, when you're working with HDR photos in Photoshop, you take 3 pics with your real camera - one at full exposure, one midway, and one at a very closed exposure. A bright, medium, and dark picture. Then you tell photoshop to load all 3 as a single HDR image. You can then adjust the range of brightness seen in real time, with a slider - the end result is as if you're adjusting your exposure as if you were really there. And you see the glowing effects when you shift it up high enough, no bloom involved.

 

I have yet to see a game that allows you to choose Bloom and HDR at the same time. It's either one or the other - Bloom becomes redundant if you can do HDR.

Share this post


Link to post
Share on other sites

So aside from general HDR definitions, there woun't be any HDR. :) Will there be glow support instead? It was awsome in the doom 3 Maximum Graphic mod, which also came along with more reflecting metals and more specular. One further question: Parallaxmapping? :D Reliefmapping? :P

Share this post


Link to post
Share on other sites

Although I really have no authority over the subject, I personally think that the mod would be left better off with more polies over more special affects because I feel rummaging through lush environments is more impressive than rummaging through special affects. Additional mapping or lighting calculations would drag down performance.

Share this post


Link to post
Share on other sites

I agree. I also think having more polies would help much more, because the special effects are somewhat limited. Since many maps are pretty dark anyway, how much room is there for these effects?


Gerhard

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...