HDR Tone mapping

Discussion in 'Backers Lounge (Read-only)' started by zaraasran, October 15, 2013.

  1. zaraasran

    zaraasran New Member

    Messages:
    2
    Likes Received:
    0
    I watched the 41st video update the other day, and thanks for sharing about the HDR/LDR stuffs. I've been wondering which tone mapping technique you guys are using since AFAIK, there are several methods.

    Care to share it in more detail ?
  2. varrak

    varrak Official PA

    Messages:
    169
    Likes Received:
    1,237
    Hi,

    Right now, we're just using a pretty standard tone-mapping technique, based on the average and maximum luminance of the scene. We downsample the framebuffer to a 1x1 texture, where the red channel is the average luminance of the scene, and the green channel is the maximum value. Then we apply Reinhard's tone mapping equation (you can google "Reinhard's tone-mapping equation" and find the Siggraph '02 paper on the topic if you're interested in the details).

    This is really just a first pass at doing the tone-mapping and HDR. As we progress, we'll be looking to see if there's any other methods that are better suited to our content, and the look we want to get from the game.
    Arachnis, zaraasran, ace63 and 2 others like this.
  3. BulletMagnet

    BulletMagnet Post Master General

    Messages:
    3,263
    Likes Received:
    591
    Posted this elsewhere before I saw this thread. Going to repeat it hear because this thread is far more relevant.


    I'd like to know what sort of blurring algorithm is used for bloom calculation. Is it a simple average over neighbouring pixels, or is there a more complex filter kernel?
  4. varrak

    varrak Official PA

    Messages:
    169
    Likes Received:
    1,237
    Right now, the bloom is a really simple 13-tap gaussian. This was a quick-and-dirty way to get things running. Ultimately, I have a ton of ideas of things I would like to add, if I get time. For example, on higher-end systems I would love to use a variable-kernel (or asymmetric kernel) system using compute shaders, or multiple-kernel blended techniques, and whatever else makes sense.
    ace63 and BulletMagnet like this.
  5. maxpowerz

    maxpowerz Post Master General

    Messages:
    2,208
    Likes Received:
    885
    Is there any chance of getting a brightness adjustment on the HDR's gamma or luminance in the settings??
    On my crappy *** Intel HD 4000 its way too bright and im not sure if it works as it should, i have had a fiddle with the post_hdr_compose.fs shader but i can't seem to find values in any section that make it work well with my crap chipset.

    Tried,
    float exposure = 0.04; <-- lowering this value, fixes overbright issue but when it gets dark it goes black :(

    hdrValue += 0.0005 * bloom; <--- tried many diff values here but minimal effect on the overbrightness.

    float toneScalar = (Lp * (0.4 + (Lp / LmSqr))) / (0.4 + Lp); <-- tried adjusting scaling amount it helps a little but needs exposure to be as low as 0.001 or everything is white.

    vec2 luminance = texture2D(Luminance, vec2(1.0, 1.0)).xy; <-- also tried adjusting the amount of luminance read from orig texture too ,, i think this was that line.

    maybe someone with knowledge of shaders and HDR mapping can help me??
    https://forums.uberent.com/threads/hdr-brightness-slider.52962/
    I started a thread on it.

Share This Page