Home Technical Talk

faking an HDR image from a single photo

Erol
polycounter lvl 18
Offline / Send Message
Erol polycounter lvl 18
Does anyone have any experience trying to create an hdr sphere from a single photo? Most of the info I've found has to do with going out and taking pictures at various exposures, but what about faking it from a single pic?

This seemed to be kind of close: http://www.luminous-landscape.com/tutorials/hdr.shtml but again it looks like these were photos taken on location w/ known f-stops. Hrrmm.

Replies

  • thomasp
    Options
    Offline / Send Message
    thomasp hero character
    try here: http://www.3d-palace.com/xenomorphic/education/doc_pseudo_hdri.htm
    should be applicable to other packages than max as well.
  • FatAssasin
  • oXYnary
    Options
    Offline / Send Message
    oXYnary polycounter lvl 18
    Ohh.. so hdr is only applicable to pre-processed environmental reflections? Im still a little ? even though I have heard about it for years.
  • Eric Chadwick
    Options
    Offline / Send Message
    Nope, usable in realtime as well, as Lost Coast demonstrated so nicely.
  • Vailias
    Options
    Offline / Send Message
    Vailias polycounter lvl 18
    Oxy: these are just techniques to fake an HDR image if you only have a single ldr image to start with.
    If you compile these things into a single hdr image they can then be used in any environment that supports them
  • malcolm
    Options
    Offline / Send Message
    malcolm polycount sponsor
    Just to clear this up as it has been bothering me for a while.

    1. HDR does not mean bloom.

    2. You do not need any form of HDR to render bloom

    3. Tone mapping or exposure control is usually the only benefit HDR rendering has in a game, you can blind people when they look at the sun and then adjust the exposure as their "eye" adjusts.

    4. I bet most game artists would be hard pressed to tell the difference between xbox360 games rendered in full HDR or a game rendered with an "overbright" solution in a 0-2 range.
  • Erol
    Options
    Offline / Send Message
    Erol polycounter lvl 18
    Great info--thanks, guys.
  • oXYnary
    Options
    Offline / Send Message
    oXYnary polycounter lvl 18
    Eric, I undestand this, but does every diffuse map have a HDR version or only environmental reflection maps? The links seem to be showing this.

    In example, would I create a HDR for a character diffuse? If so, Im not sure how the above processes shown would apply to create a hdr from its ldr since it isnt a environment nor photo sourced.
  • JordanW
    Options
    Offline / Send Message
    JordanW polycounter lvl 19
    no, you would not use HDR images for diffuse maps, the benifit of using HDR images for environments is that they can emit light and show up nicely in reflections. I could see a situation where someone might would want to have an emmissive texture be HDR but that'd be a waste in texture memory compared to just making a b&w emmissive texture.

    One thing I think that is being confused is that you never have to make HDR images to have a game use HDR lighting, the code could simply allow for lights to have a range higher/lower than 0-1, and te renderer will just adjust the exposure to light.
  • Eric Chadwick
    Options
    Offline / Send Message
    Here's a 24MB video that shows some of the realtime HDR tech, contrasting LDR with HDR (though rather poor example of LDR lighting if you ask me). All the source textures are LDR (you can d/l the source here), so it's really all in the lighting and shading code.

    Another interesting lighting demo I saw recently (listening in on GDAlgorithms). Not HDR, but a possibly robust realtime global illumination system. Nice looking, would solve a lot of problems, but I'm really skeptical it could be used in a real game.
  • oXYnary
    Options
    Offline / Send Message
    oXYnary polycounter lvl 18
    Auhhh.. so its more with environmental lighting ahd shading? I guess my confusion started with a M$ demo awhile back at a IGDA meeting where the presenter made it seem that every texture in a level would have to be shot at different f stops.
  • Eric Chadwick
    Options
    Offline / Send Message
    Might help to think of it merely as a lighting issue, not a texturing one. So you bascially just create all your color textures as if they were fully lit, then let the HDR lighting handle the relative exposures for each surface, darkening or overbrightening them depending on how much light the observer sees.
  • malcolm
    Options
    Offline / Send Message
    malcolm polycount sponsor
    Putting any HDR bitmaps into a game is not applicable yet as they are 32bit images so you eat up the texture ram quick. Emitting light from a texture can be done with a 4bit image no need for HDR and reflections as well. The only reason to use an HDR image for either is you get way more levels of intensity, so you still get hot whites on your reflection even if you turn down the reflectivity. It's more precision and a more realistic looking reflection. Make a bump map that has a gradient in it and render that, you will see banding. Make a 16bit or 32bit bump with gradient, less and no banding.
  • Whargoul
    Options
    Offline / Send Message
    Whargoul polycounter lvl 18
    [ QUOTE ]
    Putting any HDR bitmaps into a game is not applicable yet as they are 32bit images so you eat up the texture ram quick.

    [/ QUOTE ]

    You can do some fancy tricks though - ie putting in an "exponent" value into the alpha channel lets you drive the brightness much higher, and the texture can still be saved as a regualr dxt or whatever. Just a little pixel shader math to bring it back to near full quality. You lose a bit of detail (banding) due to quantizing the data - but it can look pretty good. Mostly just used for skyboxes anyways, and overdriving the brights.
  • Downsizer
    Options
    Offline / Send Message
    Downsizer polycounter lvl 18
    oxy, lemme dumb it down a bit. HDR as a full screen shader/environment effect in a game is a method to display the level with more and dynamic light ranges. This may be paired up with an environment texture/cube map that the shader/effect pulls light info from.

    HDR as a texture usually a few different exposure times on a single still image. Combined they create several light ranges to mix between. Use is as a cube map in an engine or render that supports those extra lightranges and you get all the nifty blinding light effects.

    Correct me if i'm wrong.
  • Eric Chadwick
    Options
    Offline / Send Message
    You're wrong! smile.gif Well at least insomuch that you don't need to stuff the cubemap with multiple HDR exposures in order to get nifty lighting out of it. Besides that's too much mem, as people said.

    We use the tech Whargoul mentioned, alpha is the 0-200% exponent, for skybox/reflect/transmit cubes and for emissive-glow fx. Then we have a camera-like global exposure control that uses those alphas and any high-exponent light values to influence the over/under exposure. Not fully working yet, but pretty cool so far.

    Here's a cool little demo of HDR exposure control, etc. Fun to play with, if you have a decent card.
    19_s.jpg
  • malcolm
    Options
    Offline / Send Message
    malcolm polycount sponsor
    Cody yeah we have no choice but to over drive our gloss and eccentricity maps due to the lack of bit depth in the .dxt Pretty nifty really. We are doing this for our HDR lighting as well, best part is it is completely transparent to the artist but allows for the correct ranges in game.
  • Eric Chadwick
    Options
    Offline / Send Message
    malcolm, how do you author the alphas? Any tricks?
    I've been painting on a Linear Dodge layer, then moving that into the alpha. Or just copying the RGB and Levelling it down some. It's just not very intuitive I guess.
  • malcolm
    Options
    Offline / Send Message
    malcolm polycount sponsor
    I don't supply any alpha, it's all done in code so it's transparent to me.
  • Eric Chadwick
    Options
    Offline / Send Message
    Oh sorry, what do you mean by "over drive" then... you don't mean creating low-intensity bitmaps, and letting the lighting ramp them back up?
  • malcolm
    Options
    Offline / Send Message
    malcolm polycount sponsor
    No not really, I supply a gloss map which has a good range of values in it and then in the game engine in real time I can over drive those values past what could be achived in the texture with a slider bar. For example we weren't getting bright enough whites in our gloss maps.
  • Eric Chadwick
    Options
    Offline / Send Message
    Ah, gotcha now, thanks.

    btw, I saw this paper today. Nice writeup of how/why bloom/flares occur with the human perceptual system.
    Physically-Based Glare Effects for Digital Images (3MB PDF)
    Suffers a bit from programmer art syndrome, but the ideas are very readable.
Sign In or Register to comment.