POV-Ray : Newsgroups : povray.beta-test : Experimental tonemapping Server Time
27 Dec 2024 13:21:20 EST (-0500)
  Experimental tonemapping (Message 1 to 10 of 12)  
Goto Latest 10 Messages Next 2 Messages >>>
From: clipka
Subject: Experimental tonemapping
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

From: clipka
Subject: Re: Experimental tonemapping
Date: 10 Apr 2016 11:02:47
Message: <570a6b17$1@news.povray.org>
Am 09.04.2016 um 04:33 schrieb clipka:
> 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 here's the deal: Get the thing, test the shit out of it and enjoy! :)

Hmm... no takers yet? Or is that just the spring weekend dragging people
outside?


Post a reply to this message

From: Jaime Vives Piqueres
Subject: Re: Experimental tonemapping
Date: 10 Apr 2016 17:17:40
Message: <570ac2f4$1@news.povray.org>
El 10/04/16 a las 17:02, clipka escribió:
>> So here's the deal: Get the thing, test the shit out of it and
>> enjoy! :)
>
> Hmm... no takers yet? Or is that just the spring weekend dragging
> people outside?
>

   Just tried it for noise:

   tonemapping {
     parameters { red,green,blue }
     function(r,g,b) { r*f_granite(g*image_width,b*image_height,0) }
     function(r,g,b) { g*f_granite(r*image_width,b*image_height,0) }
     function(r,g,b) { b*f_granite(r*image_width,g*image_height,0) }
   }

   I don't know if I've used it correctly there, but looks nice without
aa. With aa it loses most of the noise (and a later conversion to jpg
makes it almost unnoticeable). I guess that's one of the things that
will do better with the future post-aliasing "postprocesing" feature.

--
jaime


Post a reply to this message

From: Jaime Vives Piqueres
Subject: Re: Experimental tonemapping
Date: 11 Apr 2016 06:29:15
Message: <570b7c7b@news.povray.org>
El 10/04/16 a las 23:17, Jaime Vives Piqueres escribió:
>    Just tried it for noise:

   Ok, ditch that one, these work better:

   // RGB noise
   tonemapping {
     #declare noise_amount=0.05;
     parameters { red,green,blue,x,y }
     function(r,g,b,x,y) 
{r-f_granite(.1+x*image_width,y*image_width,0)*noise_amount+f_granite(.4+x*image_width,y*image_width,0)*noise_amount}
     function(r,g,b,x,y) 
{g-f_granite(.2+x*image_width,y*image_width,0)*noise_amount+f_granite(.5+x*image_width,y*image_width,0)*noise_amount}
     function(r,g,b,x,y) 
{b-f_granite(.3+x*image_width,y*image_width,0)*noise_amount+f_granite(.6+x*image_width,y*image_width,0)*noise_amount}
   }

   // B&W noise
   tonemapping {
     #declare noise_amount=0.05;
     parameters { red,green,blue,x,y }
     function(r,g,b,x,y) 
{r-f_granite(.1+x*image_width,y*image_width,0)*noise_amount+f_granite(.2+x*image_width,y*image_width,0)*noise_amount}
     function(r,g,b,x,y) 
{g-f_granite(.1+x*image_width,y*image_width,0)*noise_amount+f_granite(.2+x*image_width,y*image_width,0)*noise_amount}
     function(r,g,b,x,y) 
{b-f_granite(.1+x*image_width,y*image_width,0)*noise_amount+f_granite(.2+x*image_width,y*image_width,0)*noise_amount}
   }

   Also, I found a solution for the pre-aa problem : don't use aa, but 
focal blur. :)

--
jaime


Post a reply to this message

From: Jaime Vives Piqueres
Subject: Re: Experimental tonemapping
Date: 11 Apr 2016 07:48:06
Message: <570b8ef6$1@news.povray.org>
El 10/04/16 a las 17:02, clipka escribió:
>> So here's the deal: Get the thing, test the shit out of it and enjoy! :)

   // vignetting
   #declare vignetting_amount=0.3;
   #declare f_vignette=
   function{
     pigment{
       spherical
       color_map{
         [vignetting_amount rgb 0]
         [1 rgb 1]
       }
     }
   }
   tonemapping {
     #declare noise_amount=0.05;
     parameters { red,green,blue,x,y }
     function(r,g,b,x,y) {r*f_vignette(x-.5,y-.5,0).gray}
     function(r,g,b,x,y) {g*f_vignette(x-.5,y-.5,0).gray}
     function(r,g,b,x,y) {b*f_vignette(x-.5,y-.5,0).gray}
   }


Post a reply to this message

From: Jaime Vives Piqueres
Subject: Re: Experimental tonemapping
Date: 11 Apr 2016 07:49:37
Message: <570b8f51$1@news.povray.org>
El 11/04/16 a las 13:48, Jaime Vives Piqueres escribió:
>      #declare noise_amount=0.05;

   Oops... that's a leftover from previous test, you can delete it.

--
jaime


Post a reply to this message

From: Jaime Vives Piqueres
Subject: Re: Experimental tonemapping
Date: 11 Apr 2016 14:06:13
Message: <570be795$1@news.povray.org>
El 09/04/16 a las 04:33, clipka escribió:
> So here's the deal: Get the thing, test the shit out of it and enjoy!
> :)
>

   Ok, first suggestion: how about a way to accumulate several effects,
perhaps using multiple tonemapping{} statements?

--
jaime


Post a reply to this message

From: clipka
Subject: Re: Experimental tonemapping
Date: 11 Apr 2016 15:00:10
Message: <570bf43a$1@news.povray.org>
Am 11.04.2016 um 20:06 schrieb Jaime Vives Piqueres:

>   Ok, first suggestion: how about a way to accumulate several effects,
> perhaps using multiple tonemapping{} statements?

Jotted down on the to-do list for future versions.

The present implementation is driven by the following goals:

(1) Achieve "gamma complete" status in 3.7.1 proper; to this end, it
seems necessary to provide _some_ mechanism by which users can effect
"artistic gamma" without having to misuse any of the existing technical
gamma handling mechanisms.

(2) At all costs avoid implementing a dedicated "artistic gamma" feature
that would become obsolete just one version later.

(3) Keep the first implementation simple to avoid excessively stalling
the release of 3.7.1 proper (*).


(* Sorry, no -- it's still too soon to hold your breath. Most notably
there's still plenty of work to do on the inbuilt help of the Windows
version.)


Post a reply to this message

From: Tim Riley
Subject: Re: Experimental tonemapping
Date: 12 Apr 2016 00:45:10
Message: <570c7d56$1@news.povray.org>
A simple question from a simple mind: what #version statement needs to 
be used? It's gagging on the "tonemapping" statement.

On 4/10/2016 9:02 AM, clipka wrote:
> Am 09.04.2016 um 04:33 schrieb clipka:
>> 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 here's the deal: Get the thing, test the shit out of it and enjoy! :)
>
> Hmm... no takers yet? Or is that just the spring weekend dragging people
> outside?
>


Post a reply to this message

From: clipka
Subject: Re: Experimental tonemapping
Date: 12 Apr 2016 15:04:34
Message: <570d46c2$1@news.povray.org>
Am 12.04.2016 um 06:44 schrieb Tim Riley:
> A simple question from a simple mind: what #version statement needs to
> be used? It's gagging on the "tonemapping" statement.

As far as the tonemapping statement is concerned, the experimental
version doesn't care what "#version" statement you use.

If you post the scene that gives you the error message, I should be able
to tell you whether it is a problem with the scene or a problem with the
version of POV-Ray you're using.


Post a reply to this message

Goto Latest 10 Messages Next 2 Messages >>>

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