3.6. The 'tone_mapping.inc' include file

Christoph Hormann

This part describes the tone_mapping.inc include file that comes with MegaPOV and contains macros for common tone mapping functions.

For how the tone mapping patch works in general see Section 2.7.2, “Custom tone mapping function”. The macros are supposed to be called in global_settings{}. Like:

#include "tone_mapping.inc"

global_settings { 
  Clip_Colors() 
}

3.6.1. The Clip_Colors() macro

This macro applies a hard clipping of color values at 1.0 before antialiasing. Using this results in the POV-Ray™ 3.5 behavior.

3.6.2. The Film_Exposure() macro

This macro generates the same function that is used in the film exposure simulation patch (see Section 2.7.1, “Film exposure simulation”).

parameters:

  • Exposure - exponent for the exposure curve
  • Exposure_Gain - gain for the exposure curve

3.6.3. The Film_Exposure_Invert() macro

This macro generates a film exposure tone mapping curve and the inversion of it. This results in a linear output like without tone mapping but the antialiasing is applied for the exponential mapping function.

parameters:

  • Exposure - exponent for the exposure curve
  • Exposure_Gain - gain for the exposure curve

3.6.4. The Gamma_Correct() macro

This macro generates a gamma correction function.

parameters:

  • Gamma - gamma correction factor
[Note]Note

It is not a good idea to use this as a replacement for the internal gamma correction to do actual gamma correction. It may however be useful for scenes that are designed for being rendered without gamma correction (like for example certain older POV-Ray sample scenes).

3.6.5. The Brightness_Contrast() macro

This macro generates a function that applies brightness and contrast corrections to the image. These are linear operations so they won't affect the antialiasing quality.

parameters:

  • Brightness - brightness adjustment
  • Contrast - contrast adjustment