POV-Ray : Newsgroups : povray.advanced-users : function pigment problems : Re: function pigment problems Server Time
5 Jul 2024 16:29:45 EDT (-0400)
  Re: function pigment problems  
From: sooperFoX
Date: 17 Dec 2007 01:40:00
Message: <web.47661958d746c09b943b35b60@news.povray.org>
Jan Dvorak <jan### [at] centrumcz> wrote:
> as for the average, you can nest multiple averages. Average each 256 of
> the 1024 and then group the four results together.

I don't know in advance how many I will need, and if it is not a multiple of 256
there would be too little weighting on the final set.

Anyway the averaging part works fine - the problem is with the function/pigment
colour mapping beforehand. See below.


> as for the wrapping, I've got no idea

I figured out WHY it is doing that - this is the code to map the function to a
colour. It is called 3 times - once for red, green and blue, for each image in
the set before it is averaged.

  pigment {
    function { Fn(x, y, z) }
    color_map {
      [ 0 color Color1 ]
      [ 1 color Color2 ]
    }
  }

....so if the value of the function is more than 1 it will wrap back to the first
colour in the color_map. I have confirmed this is what is happening with
Photoshop's colour eyedropper tool.

Now - HOW do I fix it? I don't want to add a million [ x color Color2*x ]
rows...


- sooperFoX


Post a reply to this message

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