[Radiance-general] Surface normal and Rdot in mix functions

Georg Mischler [email protected]
Fri, 3 May 2002 14:02:21 -0400 (EDT)


Peter Apian-Bennewitz wrote:

> [email protected] wrote:
>
> >
> > I have used .cal functions based on cos(theta) of the incoming (eye) ray.
> > For this purpose, there is a special variable available, Rdot, which is the
> > dot product of the eye ray and the surface normal and hence should be equal
> > to cos(theta), if I have understood correctly. I have also supposed
> > Radiance always flips the normal
>
> ... if I recall it right:
> dielectric, interface, BRTDfunc, glow and mixfunc don't re-orient
> surfaces and Rdot[-1:1]
> colorfunc, brightfunc, transfunc (+ their ~data equivalents), trans,
> plastic(2), metal(2), glass do flip surface normals and so Rdot[0:1] .


Note that, as far as I am aware of, this "normal flipping" is
NEVER done for non-material modifiers.  The original question
was about mixtures, though the wording unintentionally confused
the issue a bit. For the materials, I think the list above is
about correct.

You can assign different materials/patterns/textures to the front
and back side of a surface simply by using "if(Rdot,1,0)" as the
coefficient for a mixture. In fact, there is a file "diffside.cal"
available in the Rayfront library that does exactly this.

If you don't want to differentiate between the two sides of a
surface in non-material modifiers, then you'll have to look at the
absolute value of Rdot (or the absolute values of Nx/Ny/Nz).
Positive and negative values of Rdot are equivalent to each other
for the respective "other" side of the surface. I'm not sure if
the perturbation caused by the roughness parameter is reflected
in the N# values seen by a function file.


-schorsch

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