POV-Ray : Newsgroups : povray.general : Transparency maps : Re: Transparency maps Server Time
22 Jun 2024 06:31:46 EDT (-0400)
  Re: Transparency maps  
From: Stephen
Date: 26 Nov 2014 12:09:22
Message: <54760942$1@news.povray.org>
On 26/11/2014 16:10, Bald Eagle wrote:
> Stephen <mca### [at] aolcom> wrote:
>
>> I am or something like it.
>> My understanding is that PovRay uses either an alpha channel or a pallet
>> based transparency. With the pallet based method 256 channels are the
>> most you can use.
>
> Are you using image_pattern and/or use_alpha?
>

I am using image_map


>> I was hoping that someone had devised a way to use the
>> greyscale value.
>
> I sort of see what you want to do...
> Maybe you could "scan" the image with eval_pigment and then calculate a
> transparency variable using the grayscale value?
>

LOL
You might be able to do that. I couldn't code my way out of a wet paper 
bag. ;-)

I use a modeller for everything. I can modify and add code, though.


> I dunno - I'm still only on coffee #2, and the foot of snow we're supposed to be
> getting is just starting to come down, so I'm not 100% focused...
>
Excuses, excuses. I've been up for eleven hours, allready. ;-)


>> I have an acceptable result by converting the original image to 8 bit
>> and blurring it a small bit. Then inputing the pallet entries by hand.
>> Or by Excel, actually. :-)
>
> That sounds somewhat labor intensive, though interesting.
>

Yes it is. :-(

But I have automated a lot of it in Excel and I copy and paste into the 
modeller.

> Maybe some example code and a small illustrative image would help puzzle out a
> solution.
>

I'll make up a little package including the transparency map, later. But 
you could use one of the ones Thomas pointed to.

The basic material is:

#declare CloudedEarth =
texture {
   #declare BISHOP3D_TEMPORARY_IDENTIFIER =
     texture {
       pigment {
         image_map{
           png "f:\Graphics\B3D Data\Maps\Planets\Earth\EarthMap2.png"
/*
This is the image  map of Earth.

*/

           interpolate 4
           map_type 1
         }
       }

       normal {
         bump_map{
           png "f:\Graphics\B3D Data\Maps\Planets\Earth\EarthBum_Neg.png"

/*
This is the bmp  map of Earth.

*/

           interpolate           2
           use_color
           map_type 1
         }
         0.100      }


     }
     texture {
       pigment {
         image_map{
           png "F:\Graphics\B3D 
Data\Maps\Planets\Earth\earthcloudmaptrans_Neg240.png"
/*
This is the cloud map that I want the dark parts transparent.

*/

           interpolate 2
           map_type 1
           transmit 0, 1.000
           transmit 1, 1.000

// Snip lots of entries
           transmit 238, 0.007
           transmit 239, 0.000
         }
       }


     }
   ;// the semicolon is necessary or POV-Ray will not figure out that 
the declarations has ended
   BISHOP3D_TEMPORARY_IDENTIFIER
}




-- 

Regards
     Stephen


Post a reply to this message

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