[Radiance-general] trouble with colourpict

Georg Mischler [email protected]
Thu, 26 Jul 2001 13:09:48 -0400 (EDT)


Georg Mischler wrote:

> Russell Maunder wrote:
>
> > I was hoping someone on this list might be able to help me. I am using
> > rayfront 1.02 and I cant seem to get the colourpict pattern to work
> > correctly as a pattern.
> >  ....
>
>
> Russell,
>
> Has the the explanation I sent through the Radiance-Support
> mailing list not arrived downunder yet? Modifiers just multiply
> their values with the material values. And a multiplication based
> on blue/green material values of zero will simply give zero again.
> You want to use a white base material, and a red logo picture.


Looking from a more general point of view:

If you want a *full color* picture without a tint from the
color of the surrounding wall, then you have two basic choices.

One would be to add a polygon to your model for holding the
picture, which gets a white material.

If you want to avoid the modelling effort, then you'll have to
manipulate your picture, so that it's color values compensate for
the color values of the base material.  Of course, this only
works if the rgb values of the material are all non-zero, or you
will run into the multiplication-by-zero dilemma. Seems like the
polygon solution will be simpler in most cases.

Actually, you could combine the two approaches, by defining
a mixfunc which selects the red plastic for the surrounding
area, and a white plastic with the colorpict in the picture
area. Mixtures are the exception to "normal" modifiers, in that
they can actually replace material values according to their
functional criteria, instead of just modifying (sic!) them.

Rayfront makes the use of mixtures exceptionally easy, after all,
and the function for this task is trivial:

  if(and(inside(X0,Px,X1),inside(Z0,Pz,Z1)),1,0)

If you replace X0, X1, Z0, Z1 with the lower and upper X and Z
boundaries of the image, then you can write this directly into
the expression field of the mixfunc dialog. If the image is
aligned to the YZ-plane, then you'll have to adapt accordingly.
The white plastic and colorpict will now go into the foreground
slot, and the red plastic becomes the background.


-schorsch

-- 
Georg Mischler  --  simulations developer  --  schorsch at schorsch.com
+schorsch.com+  --  lighting design tools  --  http://www.schorsch.com/