|
|
OK, now I feel really stupid... All I kept thinking was, "average is going
to make it all 1/3 the brightness and that'll destroy the accuracy if I
just blend three slopes together". Just putting "ambient 3" in the final
texture makes it work perfectly and I can render any shapes into a normal
map just like I wanted.
Here's a sphere with a "normal map" pigment. It produces <128,128,255> in
the +Z direction.
#declare RedX = pigment
{
slope x
color_map
{
[ 0 color rgb <0, 0, 0> ]
[ 1 color rgb <1, 0, 0> ]
}
}
#declare GreenY = pigment
{
slope y
color_map
{
[ 0 color rgb <0, 0, 0> ]
[ 1 color rgb <0, 1, 0> ]
}
}
#declare BlueZ = pigment
{
slope z
color_map
{
[ 0 color rgb <0, 0, 0> ]
[ 1 color rgb <0, 0, 1> ]
}
}
sphere
{
<0, 0, 0>, .25
texture
{
pigment
{
average
pigment_map
{
[1 RedX ]
[1 GreenY ]
[1 BlueZ ]
}
}
finish { ambient 3 diffuse 0 }
}
}
Post a reply to this message
|
|