|
|
On Fri, 29 Mar 2002 17:03:25 +0100, "Sebastian H." <seb### [at] webde> wrote:
> Do I have to save the tga without transpyrency information (This is what
> I want to avoid) or does anyone know an other solution?
What about layered texture ?
Also you can always (in 3.5) recreate your pigment with functions removing
transparency but it could slow down tracing a lot probably.
ABX
Post a reply to this message
|
|
|
|
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
|
|