POV-Ray : Newsgroups : povray.general : how to make image_map (tga) non transparent Server Time
6 Aug 2024 12:24:35 EDT (-0400)
  how to make image_map (tga) non transparent (Message 1 to 3 of 3)  
From: Sebastian H 
Subject: how to make image_map (tga) non transparent
Date: 29 Mar 2002 11:01:30
Message: <3CA4904D.1040407@web.de>
Hi there

I'am playing around with image maps and cannot disable the transparency 
of a mapped tga.

When trying
#declare p_crash =
   pigment {
     image_map {tga "crash.tga"
       map_type 0
       interpolate 2
     }
   }

#declare T_crash =
texture {
   pigment { p_crash transmit 0 }
}


The whole object gets black and if transmit set to one it gets 
transparent (invisible)
If using transmit all 0 in the image_map pov says that this is not 
allowed for non paletted images.

Do I have to save the tga without transpyrency information (This is what 
I want to avoid) or does anyone know an other solution?

Thanks
Sebastian H.

P.S.: using beta14


Post a reply to this message

From:
Subject: Re: how to make image_map (tga) non transparent
Date: 29 Mar 2002 11:10:55
Message: <nb49au8dh42obi7o1ldla1s2uf837qs328@4ax.com>
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

From: PeterC
Subject: Re: how to make image_map (tga) non transparent
Date: 31 Mar 2002 12:32:22
Message: <3ca7481a.7559558@localhost>
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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.