Tonemapping

From FreeSpace Wiki
Jump to: navigation, search

This page is intended to help you choose and potentially understand your mod's tonemapping configuration using [lighting_profiles.tbl]. This is a work in progress. More information and comparisons are planned.

What is Tonemapping and why do I need it?

The choice of tonemapper makes a big difference in how the game looks. If you need to understand what tonemapping is doing and why, read this. If you just want to treat it as a black box of graphical options, the next section has pictures.

To understand tonemapping, you need to understand high dynamic range (HDR) lighting. The name might remind you of annoying games that proudly blind you with pitch dark or blazing bright screens when you move between light and dark regions, but these are purely optional features that confuse the issue. HDR lighting is in reality a fundamental feature of physically based rendering, and its presence demands tonemapping.

Non-HDR lighting, low dynamic range (LDR), handles light and color in a way that’ll be very familiar to anyone who has done digital art. Pixels range between fully black to fully white, 0.0 to 1.0 or 0 to 255 depending on your context. Since this is how screens work, with pixels having a hard maximum brightness, this makes a lot of intuitive sense.

However, if you instead think about rendering as mimicking the real behavior of light, LDR breaks down. Practically speaking in reality there is no maximum brightness, so HDR lighting doesn’t have one. Instead of colors topping out at 1.0 brightness, they can get as bright as they need to, and the math is happy. But when you go to send it to the screen, this of course becomes a problem again, you can’t make a screen pixel be brighter than full.

This is where tonemapping takes over. Tonemapping algorithms, sometimes called operators, do math to the raw HDR color values to squeeze them back into the 0-1 range in a variety of ways. Many of them try to mimic the way human eyes react to real world brightness, or model the behavior of cameras or film stock, or just do abstract mathematical things to try to make a frame look how an artist wants it to.

More reading

  1. Filmic Tonemapping with Piecewise Power Curves, John Hable
  2. Tone Mapping, 64
  3. Filmic Tonemapping Operators, John Hable