POV-Ray : Newsgroups : povray.binaries.images : Squirted pigments (34KB) : Re: Squirted pigments (34KB) Server Time
20 Nov 2024 06:27:28 EST (-0500)
  Re: Squirted pigments (34KB)  
From: Mark James Lewin
Date: 28 Sep 2001 02:02:23
Message: <3BB40FA3.C94C2321@yahoo.com.au>
Tor,
        Have you tried 'average'? I have used this to achieve similar control as your
technique (though not so complicated). Here is how I do it...

#declare F_Red = function{(sin(x)+sin(y)+sin(z)+3)/6}
// Or any function between 0 and 1

#declare F_Green =function{(cos(x)+cos(y)+cos(z)+3)/6}
#declare F_Blue =function{(sin(-x)+sin(-y)+sin(-z)+3)/6}

#declare P_Red =
pigment
        {
        function{F_Red(x,y,z)}
        colour_map
                {
                [0 rgb <0,0,0>][1 rgb <3,0,0>]
                // Note the colour max is 3, not 1
                }
        }

#declare P_Green =
pigment
        {
        function{F_Green(x,y,z)}
        colour_map
                {
                [0 rgb <0,0,0>][1 rgb <0,3,0>]
                }
        }

#declare P_Blue =
pigment
        {
        function{F_Blue(x,y,z)}
        colour_map
                {
                [0 rgb <0,0,0>][1 rgb <0,0,3>]
                }
        }

#declare P_Average =
pigment
        {
        average
        pigment_map
                {
                [1 P_Red]
                [1 P_Green]
                [1 P_Blue]
                }
        }

Then you have a pigment with control over rgb channels without semi transperent
layers.


Post a reply to this message

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