<fruela@[EMAIL PROTECTED]
> wrote:
> It is possible to create a sphere with one half "metal shader" and the
> other half with "matte shader"?
The easiest way is to create two hemispheres:
Surface "metal"
Sphere 1 -1 0 360
Surface "matte"
Sphere 1 0 1 360
Another way is to write one shader that does it all:
surface metalmatte(float Ka = 1, Kd = 1, Ks = 1, roughness = 0.1)
{
normal Nf = faceforward(normalize(N), I);
Oi = Os;
if (v < 0.5)
Ci = Os * Cs * (Ka * ambient() +
Ks * specular(Nf, normalize(-I), roughness));
else
Ci = Os * Cs * (Ka * ambient() + Kd * diffuse(Nf));
}
Rick LaMont
Dot C Software, Inc.
http://www.dotcsw.com/


|