POV-Ray : Newsgroups : povray.advanced-users : function pigment problems : Re: function pigment problems Server Time
5 Jul 2024 16:06:33 EDT (-0400)
  Re: function pigment problems  
From: Trevor G Quayle
Date: 17 Dec 2007 13:30:00
Message: <web.4766bfa4d746c09bc150d4c10@news.povray.org>
stbenge <stb### [at] hotmailcom> wrote:
> sooperFoX wrote:
>
> > The problem occurs when the colour value for any channel (R, G, B) exceeds 1.0 -
> > the value for that channel seems to wrap back around to 0.0 and this is causing
> > strange colour banding effects. I will post an image to p.b.i when I get home
> > from work in a few hours.
>
> I know Slime already gave you a fix for this, but in case you run into
> more related problems, and for future reference, I give you this little
> clippit. This will ensure that f(x,y,z) will not exceed a value of one:
>
> function{
>   select(
>   f(x,y,z)-1,
>   f(x,y,z),
>   1)
> }
>
>
> Sam

Except that this clips the value at 1, which may not be the desired solution
under certain circumstances (i.e., you don't want them clipped).  In this case
the values need to be scaled to be within the 0-1 range rather than simply
clipped.

-tgq


Post a reply to this message

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