|
![](/i/fill.gif) |
Thank you very much Francois !
I think I understand rgbt better now,
but I have some more testing to do before
I'm sure about how it works.
Tor Olav
Francois Labreque wrote:
>
> Tor Olav Kristensen wrote:
>
> > I'm trying to understand layered textures better,
> > but I don't understand why the colors of the left
> > spheres in the attached image don't match the
> > colors of right spheres.
> >
> > See my code below.
> >
> > Can anyone please explain ?
> >
> > And what do I have to do in order to make the
> > colors of the right spheres equal to the colors
> > of the left spheres (using subtractive color
> > mixing for the right ones and additive for the
> > left ones) ?
> >
> > E.g.: Any changes to the finish {} part of the textures ?
> >
>
> Nope.
>
> What happens is that when you put a color that has a non-zero transmit
> component, it does a weighted average of the color and the color underneath.
>
> for example:
>
> > // White - Blue - Green = Red
> > texture { pigment { color rgbt <1, 0, 1, 0.0> } }
> > texture { pigment { color rgbt <1, 1, 0, 0.5> } }
>
> is equivalent to:
>
> texture { pigment { color rgbt < 1, 0.5, 0.5, 0.0 > } }
>
> That is:
>
> #declare Weight = 0.5;
> #declare Magenta = color rgb < 1, 0, 1 >;
> #declare Yellow = color rgb < 1, 1, 0 >;
> #declare Not_Red = Weight*Magenta + (1-Weight)*Yellow;
>
> As you can see, the green and blue components of the final color are not
> zero as a fraction of the orignal two colors is still present in the
> final one.
>
> Since layered textures are additive, to substract a color component,
> you'd have to add a negative color, in other words,do the following:
> texture { pigment { color rgbt <1, 1, 1, 0.0> } }
> texture { pigment { color rgbt <1, -1, -1, 0.5> } }
>
> As you can see, the second texture does not make physical sense.
>
> --
> /*Francois Labreque*/#local a=x+y;#local b=x+a;#local c=a+b;#macro P(F//
> /* flabreque */L)polygon{5,F,F+z,L+z,L,F pigment{rgb 9}}#end union
> /* @ */{P(0,a)P(a,b)P(b,c)P(2*a,2*b)P(2*b,b+c)P(b+c,<2,3>)
> /* videotron.ca */}camera{location<6,1.25,-6>look_at a orthographic}
Post a reply to this message
|
![](/i/fill.gif) |