POV-Ray : Newsgroups : povray.advanced-users : use_alpha and hierarchy Server Time
23 Nov 2024 18:33:35 EST (-0500)
  use_alpha and hierarchy (Message 1 to 2 of 2)  
From: Bald Eagle
Subject: use_alpha and hierarchy
Date: 23 Oct 2014 15:40:02
Message: <web.544958848419c90d5e7df57c0@news.povray.org>
I'm having a bit of difficulty structuring my texture statement for a
black&white frame.  I'm guessing that I somehow need to use "use_alpha", and
then have another level of the hierarchy specify the mapping of the textures for
the black and white regions of the image.

NOT using the use_alpha keyword and just texture_map from 0.01 to 1 didn't seem
to quite give me what I wanted.  I still seem to be experiencing a bit of
confusion with all the different map types and how to structure them.

Can anyone jump in with an explanation, or some example code?
Thanks!



#declare ImageMap =
texture {
     image_pattern { png "AlphaMirror2.png" use_alpha once}
  texture_map {
   [0.00 texture_map {
    [0.00 pigment {Black}]  //  DullGold]
    [1.00 pigment {White}]  //  DullGold]
    }]
   [1.00 pigment { transmit 1 }]]
   }
}


Post a reply to this message

From: clipka
Subject: Re: use_alpha and hierarchy
Date: 23 Oct 2014 23:43:48
Message: <5449caf4$1@news.povray.org>
Am 23.10.2014 21:35, schrieb Bald Eagle:
> I'm having a bit of difficulty structuring my texture statement for a
> black&white frame.  I'm guessing that I somehow need to use "use_alpha", and
> then have another level of the hierarchy specify the mapping of the textures for
> the black and white regions of the image.
>
> NOT using the use_alpha keyword and just texture_map from 0.01 to 1 didn't seem
> to quite give me what I wanted.  I still seem to be experiencing a bit of
> confusion with all the different map types and how to structure them.
>
> Can anyone jump in with an explanation, or some example code?
> Thanks!
>
>
>
> #declare ImageMap =
> texture {
>       image_pattern { png "AlphaMirror2.png" use_alpha once}
>    texture_map {
>     [0.00 texture_map {

What pattern is this texture_map supposed to be using?

>      [0.00 pigment {Black}]  //  DullGold]
>      [1.00 pigment {White}]  //  DullGold]
>      }]
>     [1.00 pigment { transmit 1 }]]
                                    ^
Extraneous closing bracket.

>     }
> }


Presuming that "AlphaMirror2.png" is a greyscale image with additional 
transparency information, you're actually /almost/ there; the code 
should look something like this:

   texture {
     image_pattern { png "AlphaMirror2.png" use_alpha once }
     texture_map {
       [0.00
         image_pattern { png "AlphaMirror2.png" once }
         texture_map {
           [0.00 pigment { Black }]
           [1.00 pigment { White }]
         }
       ]
       [1.00 pigment { transmit 1 }]
     }
   }

Each texture_map needs its own pattern statement; "use_alpha" takes the 
pattern information from the image's alpha channel, while the normal 
image_pattern takes the pattern information from the image's greyscale 
value.


Post a reply to this message

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