POV-Ray : Newsgroups : povray.general : Modulo in 3.7RC4? : Re: Modulo in 3.7RC4? Server Time
29 Jul 2024 08:24:23 EDT (-0400)
  Re: Modulo in 3.7RC4?  
From: clipka
Date: 2 Mar 2012 08:33:22
Message: <4f50cc22$1@news.povray.org>
Am 02.03.2012 03:28, schrieb gregjohn:
> Hi. I've been using this code in a color map. In 3.6 it behaves as expected. In
> 3.7RC4,  all my colors are shifted to cyan, magenta, yellow, and white.  This
> makes me wonder if the mod() function is behaving differently in 3.7RC4, or if
> it requires a different syntax now.  Crazy hypothesis, but so are the results
> compared to 3.6.

The mod() function hasn't been touched since ages. But gamma handling 
has, and can cause exactly the effect you see.

> rgb<  mod(a.x+b.x,1),mod(a.y+b.y,1),mod(a.z+b.z,1)>

Instead, try this:

   srgb <mod(a.x+b.x,1),mod(a.y+b.y,1),mod(a.z+b.z,1)>

Or, if you're using this recursively, leave that line unchanged, and 
instead set the initial values of a and b like this:

   #declare a = srgb<...>;
   #declare b = srgb<...>;


Alternatively (though not recommended if you're aiming for realism) you 
can specify "global_settings { assumed_gamma srgb }".


Post a reply to this message

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