|
|
On Fri, 29 Mar 2002 17:03:25 +0100, "Sebastian H." <seb### [at] webde>
wrote:
>Hi there
>
>I'am playing around with image maps and cannot disable the transparency
>of a mapped tga.
>
If you are using 3.5, try:
#macro remove_trans(pig_in)
#local f1 = function {
pigment { pig_in }
}
#local p_out = pigment {
average
pigment_map {
[ 1
function { f1(x, y, z).red }
color_map {
[ 0.0 color rgb 0 ]
[ 1.0 color rgb <3, 0, 0> ]
}
]
[ 1
function { f1(x, y, z).green }
color_map {
[ 0.0 color rgb 0 ]
[ 1.0 color rgb <0, 3, 0> ]
}
]
[ 1
function { f1(x, y, z).blue }
color_map {
[ 0.0 color rgb 0 ]
[ 1.0 color rgb <0, 0, 3> ]
}
]
}
}
p_out
#end
You'de call it something like:
#declare non_trans = pigment {
remove_trans(
pigment {
image_map {
tga "my_tga32_w_alpha.tga"
}
}
)
}
What is going on there is that it breaks the image into
three functions, one for red, one for green, one for
blue. In this way we ignore the fourth (alpha) channel.
The average function is used to add the R, G, and B
channels back together, without the alpha.
This technique could also be used to extract the alpha
channel and make is visable/usable on its own. This
last I will leave as an exercise for the reader. :)
Post a reply to this message
|
|