>> It appears you can't put functions into a rgbt<>.
> No, but you can have a function that will return a pigment.
> pigment{ rgbt fRingPigment(x,y,z) }
> or even
> pigment{ fRingPigment(x,y,z) }
I tried this and the parser fails as soon as it hits the x, saying "Parse Error: Float
expected but vector or color expression found."
 
Here is the entire code...
 
#local InnerEdge=74.510;
#local OuterEdge=140.390;
 
#local fRingGradient=
function
{
    (sqrt((x*x)+(y*y)+(z*z))-InnerEdge)/(OuterEdge-InnerEdge)
}
 
#local fRingColour=
function
{
    pigment
    {
        image_map
        {
            png "bjj\sat_ring_color.png"
            interpolate 4
        }
    }
}
 
#local pRingColour=
function
{
    pigment
    {
        colour fRingColour(fRingGradient(x, y, 0),0,0)
    }
}
 
fRingGradient() returns a value from 0 to 1 depending where on the ring disk x,y,z is. 0 at inner edge, 1 at outer edge
fRingColour() returns a square pigment loaded with the imagemap file. This file is 800px wide and 1px high.
pRingColour() should return the colour from the image mapping the square image onto the ring.
 
Unfortunately it appears that in pRingColour() the x and y are no longer the parameters, but have reverted to the standard vectors.
 
I have tried removing the "colour" keyword, removing the "pigment" all to no avail.
 
There is something odd going on here.
 
Rarius