POV-Ray : Newsgroups : povray.newusers : image brightness : Re: image brightness Server Time
28 Jul 2024 20:24:54 EDT (-0400)
  Re: image brightness  
From: Vincent Le Chevalier
Date: 14 Sep 2007 09:33:05
Message: <46ea8d91$1@news.povray.org>

>  Also, how do I create a pigment which is a sum of red gradient x, green
> gradient y and blue gradient z, so that the pigment color describes its
> position in space?
> the best I could do is to average those three gradients but I look for a
> cleaner way.

I don't know if it's the cleanest way but this seems to do the trick:

#declare colorCube =  pigment
  {
   gradient x
   pigment_map
   {
    [0 gradient y
       pigment_map
       {
        [0 gradient z color_map{[0 rgb <0,0,0>][1 rgb <0,0,1>]}]
        [1 gradient z color_map{[0 rgb <0,1,0>][1 rgb <0,1,1>]}]
       }
     ]
    [1 gradient y
       pigment_map
       {
        [0 gradient z color_map{[0 rgb <1,0,0>][1 rgb <1,0,1>]}]
        [1 gradient z color_map{[0 rgb <1,1,0>][1 rgb <1,1,1>]}]
       }
     ]
   }
  }


A bit repetitive, but...

-- 
Vincent


Post a reply to this message

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