|  |  | 
|  |  |  |  | 
|  |  | 
|  |  | 
|  |  |  |  | 
|  |  | 
|  |  | 
|  |  | I want to render objects having a self-made 3D pigment that is defined
via 3 user-defined functions (one for red, one for green and one for
blue), or via one function that returns an RGB color vector directly
(Or even an 4- or 5-dimensional rgbf, rgbt or rgbft vector)
Is that possible, somehow?
As far as I understand a user-defined pigment functions just returns a
single float that is used as an index in a color_map.
			Lars R.
 Post a reply to this message
 |  | 
|  |  | 
|  |  | 
|  |  |  |  | 
|  |  | 
|  |  | 
|  |  | 
> I want to render objects having a self-made 3D pigment that is
> defined via 3 user-defined functions (one for red, one for green and
> one for blue), or via one function that returns an RGB color vector
> directly
>
> (Or even an 4- or 5-dimensional rgbf, rgbt or rgbft vector)
>
> Is that possible, somehow?
>
>
> As far as I understand a user-defined pigment functions just returns
> a single float that is used as an index in a color_map.
>
  If I understood it correctly, I think the "average" pattern should help
there: create 3 separate pigments for each function, then use a
pigment_map to average them together.
-- 
Jaime Vives Piqueres
		
La Persistencia de la Ignorancia
http://www.ignorancia.org
 Post a reply to this message
 |  | 
|  |  | 
|  |  | 
|  |  |  |  | 
|  |  | 
|  |  | 
|  |  | 
>> I want to render objects having a self-made 3D pigment that is
>> defined via 3 user-defined functions (one for red, one for green and
>> one for blue), or via one function that returns an RGB color vector
>> directly
>>
>> (Or even an 4- or 5-dimensional rgbf, rgbt or rgbft vector)
>>
>> Is that possible, somehow?
>>
>>
>> As far as I understand a user-defined pigment functions just returns
>> a single float that is used as an index in a color_map.
>>
>
> If I understood it correctly, I think the "average" pattern should help
> there: create 3 separate pigments for each function, then use a
> pigment_map to average them together.
>
If you want to add a filter or transmit component, use your function 
this way, after the pigment itself:
filter My_Filter_Function(x,y,z) transmit My_Transmit_Function(x,y,z)
 Post a reply to this message
 |  | 
|  |  | 
|  |  | 
|  |  |  |  | 
|  |  | 
|  |  | 
|  |  | Am 22.06.2011 16:40, schrieb Jaime Vives Piqueres:
>> I want to render objects having a self-made 3D pigment that is
>> defined via 3 user-defined functions (one for red, one for green and
>> one for blue), or via one function that returns an RGB color vector
>> directly
>>
>> (Or even an 4- or 5-dimensional rgbf, rgbt or rgbft vector)
>>
>> Is that possible, somehow?
>>
>>
>> As far as I understand a user-defined pigment functions just returns
>> a single float that is used as an index in a color_map.
>>
>
> If I understood it correctly, I think the "average" pattern should help
> there: create 3 separate pigments for each function, then use a
> pigment_map to average them together.
Yup, AFAIK that's the only way to do it. For each channel, use a 
color_map ranging from "rgbft 0" to "red N" (or "green N", "blue N", 
etc., respectively), where N is the number of channels you intend to 
mix, e.g. 4 for rgbf. (This is required because what you really want is 
a sum, not the average.)
 Post a reply to this message
 |  | 
|  |  | 
|  |  | 
|  |  |  |  | 
|  |  | 
|  |  | 
|  |  | On 6/22/2011 10:13 AM, Lars R. wrote:
> I want to render objects having a self-made 3D pigment that is defined
> via 3 user-defined functions (one for red, one for green and one for
> blue), or via one function that returns an RGB color vector directly
>
> (Or even an 4- or 5-dimensional rgbf, rgbt or rgbft vector)
>
> Is that possible, somehow?
>
>
> As far as I understand a user-defined pigment functions just returns a
> single float that is used as an index in a color_map.
>
>
> 			Lars R.
There are some good examples here:
http://lib.povray.org/searchcollection/index2.php?objectName=ColorSolid&version=1.21&contributorTag=SharkD
Mike
-- 
http://isometricland.com
 Post a reply to this message
 |  | 
|  |  | 
|  |  | 
|  |  |  |  | 
|  |  | 
|  |  | 
|  |  | > There are some good examples here:
> 
>
http://lib.povray.org/searchcollection/index2.php?objectName=ColorSolid&version=1.21&contributorTag=SharkD
Looks nice. I'll download it and look into its source to explore how
they did it. :-)
Thank you!
			Lars
 Post a reply to this message
 |  | 
|  |  | 
|  |  | 
|  |  |  |  | 
|  |  | 
|  |  | 
|  |  | >  If I understood it correctly, I think the "average" pattern should help
> there: create 3 separate pigments for each function, then use a
> pigment_map to average them together.
AFAIK the pigment_maps have to be nested:
the outermost pigment is i.e. 'gradient z' and it pigment_map maps from
the "black/red/green/yellow" pigment of the front xy face to the
"blue/magenta/cyan/white" pigment of the back xy face.
The two 4-color pigments are created the same way:
A gradient in y direction to merge from "black/red" at the bottom to
"green/yellow" at the top => Front face pigment.
A second gradient in y direction to merge from "blue/magenta" at the
bottom to "cyan/white" at the top => back face pigment.
And finally, each of the four vertical ramps are "gradient x" from "left
color" to "left color + red".
Do I got it?
			Lars R.
 Post a reply to this message
 |  | 
|  |  | 
|  |  | 
|  |  |  |  | 
|  |  | 
|  |  | 
|  |  | On 6/23/2011 2:27 AM, Lars R. wrote:
>> There are some good examples here:
>>
>>
http://lib.povray.org/searchcollection/index2.php?objectName=ColorSolid&version=1.21&contributorTag=SharkD
>
> Looks nice. I'll download it and look into its source to explore how
> they did it. :-)
>
> Thank you!
>
> 			Lars
>
>
I was thinking it would be a good subject for a tutorial, but I'm not 
sure I'll get around and do it.
-- 
http://isometricland.com
 Post a reply to this message
 |  | 
|  |  | 
|  |  | 
|  |  |  |  | 
|  |  |