How To Use HDRRenderer

After seeing that many games had HDR/tone mapping, I wanted it, even though even now I’m not too sure on what it is. Basically what I know is that it can adjust the render to simulate a wider range of brightness. I don’t know if this is also part of it, but can also do gamma correction to correct the color on screen and naturally do bloom. After searching around, I found that JME had something called “HDRRenderer”.

The test seems to work.

But after adding it to my game it just makes objects really bright, or white. I’ve tried with no parameter changes and the one from the tests no noticeable difference. It’s like this (ignore the line, miscropped):



The background is supposed to be black (which it is in the pic), all the white parts are objects.

Anyone know how to use this properly?

How does it look like without HDR? Are you using filters as well?

Hm, is ur game on a canvas with a resizable jframe?

@Momoko_Fan



No filters.

@Setekh Nope.

This is how TestHDR looks on my computer (laptop):





Looks a bit too yellow imo.

HDR assumes you have non-clamped lighting in your scene (color components larger than 1). In your case a part of the sky is completely black which causes the average luminosity computation to be lower than its supposed to be, so the tone mapping algorithm is trying to ramp up the brightness causing it to appear white.

@Momoko_Fan

Does the regular render clamp colors? For example, if I have an object with Unshaded.j3md and set the color to (1000, 1000, 1000, 1), will the “image” (or whatever HDRRenderer reads it as) have the object’s color clamped to (1, 1, 1, 1)?

Nothing is clamped unless its required. If the framebuffer only supports colors from 0.0 - 1.0 (e.g. non floating-point color buffers), then it has to be clamped. This is why the HDR renderer sets a floating-point buffer target on the viewport you attach it to, so that components larger than 1.0 can be stored in the color buffer.