POV-Ray : Newsgroups : povray.beta-test : Experimental tonemapping : Experimental tonemapping Server Time
20 Apr 2024 02:50:25 EDT (-0400)
  Experimental tonemapping  
From: clipka
Date: 8 Apr 2016 22:33:31
Message: <570869fb@news.povray.org>
Hi folks,

An experimental version supporting tonemapping can now be found at:

https://github.com/POV-Ray/povray/releases/tag/v3.7.1-alpha.8558038%2Bav124


So far only a 32-bit Windows binary is available, but the usual other
binaries will be added as their build completes.

To use tonemapping, the user needs to supply one or more functions
computing the effective output data from the raw data: One or three
functions to manipulate the colour data, and optionally a second or
fourth function to manipulate the transparency. By default, each
function takes the corresponding channel's raw data as a single
parameter, but the user can specify a different set of data to be passed
to all functions.

The syntax is

    global_settings {
      tonemapping {
        parameters { CHANNEL ... }
        FUNCTION ...
      }
    }

where each `CHANNEL` may be any of:

- `channel` (for the channel's raw data)
- `red`, `green`, `blue`, `filter` (for the named channel's raw data)
- `gray`, `grey` (for the raw grayscale value)
- 'x', 'y' (for the screen coordinate ranging from left/top = 0 to
right/bottom = 1).

Each `FUNCTION` may take either the following forms:

    function { EXPRESSION }
    function(IDENTIFIERS) { EXPRESSION }`

with the latter form allowing to specify the identifiers by which the
chosen data channels will be referred to in EXPRESSION (defaulting to
`x`, `y` and `z`)."

The following example adds the red channel to all colour channels
(including itself):

    global_settings {
      tonemapping {
        parameters { channel,red }
        function(c,r) { c+r }
      }
    }

The following example swaps the red, green, blue and alpha channels
around (note that the tonemapping operates on the transmit channel,
which is equivalent to 1-alpha):

    global_settings {
      tonemapping {
        parameters { red,green,blue,transmit }
        function(r,g,b,tr) { g }
        function(r,g,b,tr) { b }
        function(r,g,b,tr) { 1-tr }
        function(r,g,b,tr) { 1-r }
      }
    }

The feature can even be used to do something useful, such as simulating
film exposure:

    #declare Exposure = 1.6;
    #declare ExposureGain = 1.0;
    global_settings {
      tonemapping {
        function { ExposureGain * (1 - exp(-Exposure * x)) }
      }
    }


So here's the deal: Get the thing, test the shit out of it and enjoy! :)


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.