9 ms·
I've spent years working on rendering algorithms and game engines, so I guess I am a graphics programmer. You are right, the final output dynamic range is limi
by oppositelock 9y ago
I've spent years working on rendering algorithms and game engines, so I guess I am a graphics programmer.
You are right, the final output dynamic range is limited by your output device, you can't circumvent that.
The 1,000,000:1 is the contrast ratio you might see on a sunny day, and represents the state of the world that your eyes are seeing.
Your eyes aren't capable of 1,000,000:1 contrast either, at least not globally across your field of vision, so we can play tricks in rendering to simulate what you would perceive with your limited eyeballs on a 1M:1 contrast ratio day, and this is what HDR rendering does.
Internally, the rendering code handles luminance well in excess of its ability to display on the final output device. All the game rendering happens internally in HDR, preserving this high level of contrast. The final steps of producing a displayable image are doing something to convert non-displayable "real" contrast ratios into post-processed simulation to fool you into perceiving high contrast scenes. This last part is subjective and artistic, since you are trying to figure out a way to show that high dynamic range scene. Common tricks played here are the light bloom from bright areas, the artificial amplification of darks areas, etc.
All these in-between rendering steps compose the result of multiple rendering passes into an image. Each pass which is blended with the results of a previous pass is subject to quantization error. The more passes you do (and modern games do lots), the more this quantization error accumulates, and leads to pretty ugly banding artifacts. You want to do your internal processing in the highest color resolution that you can, so that you only have to worry about the error of quantizing the 1M:1 scene into a 256:1 output device. You don't need the full 20 bits, and common practice is to use 16-bit S10E5 floats since hardware handles this quickly.
HDR televisions, while nicer than nothing, don't help you all that much. Displays have generally been 8-bit per channel, giving you 256 values distributed along a gamma curve which maps to a device with perhaps 3,000:1 contrast capability. HDR tv's give you 1024 values along a gamma curve that spans a higher range of contrast, but not all that much higher.
- ttoinou 9y agoOK but that doesn't explain this sentence from the original blog post : In the real world, the total contrast ratio between the brightest highlights and darkest shadows during a sunny day is on the order of 1,000,000:1. We would need 20 bits of just luminance to represent those illumination ranges
- oppositelock 9y agoLet's call that the writer's artistic license.
- ttoinou 9y agoWell it's kinda accepted in photography / computer vision to say this. Another argument for this formula might come from Shannon information entropy but I'm not 100% sure
- jacobolus 9y agoTheoretically you can have arbitrary contrast with 1 bit (white = looking at the sun, black = 1 photon per square centimeter per year, or whatever). The author probably has some specific amount of brightness discrimination in mind that he wants to adequately capture. For example, with brightness levels corresponding to just-noticeable differences in terms of human perception, after adapting to looking at that specific portion of the scene. In practice modeling vision precisely gets really complicated because there are several types of spatial and temporal adaptation and contrast effects that the human visual system can undergo / be affected by, and something like a video game definitely doesn’t have the computation available to handle it perfectly (not to mention the programmers don’t want to implement anything that complex and finicky). There is also a complication that display black is never especially close to zero light, and depends a lot on the light hitting the display. Etc. So for practical purposes you just have to come up with some kind of “good enough” heuristic.
- ttoinou 9y agoSo for practical purposes you just have to come up with some kind of “good enough” heuristic Ok I agree ; that's what I'm saying to chrisseaton
- dragonwriter 9y ago> The author probably has some specific amount of brightness discrimination in mind that he wants to adequately capture. The assumptions seems to be a linear illumination scale with the darkest value at 1 (with true absence of illumination at zero); 1,000,000:1 needs about 20 bits for that.