POV-Ray : Newsgroups : povray.general : PovRay 3.6 + WinXP - is "image_map" with alpha channels borked? : Re: PovRay 3.6 + WinXP - is "image_map" with alpha channels borked? Server Time
1 Aug 2024 22:21:45 EDT (-0400)
  Re: PovRay 3.6 + WinXP - is "image_map" with alpha channels borked?  
From: Mike Williams
Date: 1 Apr 2005 01:36:56
Message: <uZe45CAJvOTCFwuf@econym.demon.co.uk>
Wasn't it Tim Otholt who wrote:

>1) When I render the picture, the image is almost completely black.  It
>appears POVRAY doesn't work with .TIF files with alpha channels?

I don't think POV image_map works with alpha channels.

What you can do is save one copy of the image without an alpha channel,
and save the alpha channel separately as a grayscale image, then use a
texture map to map the white parts to an Earth texture and the black
parts to a water texture.

Although this is more complicated than having POV handle the
transparency for you, it gives you a lot more flexibility.

In this example, both the land and the water use the NASA image for the
pigment; only the finish changes. You'll need to find better finish
values than that, and probably add a normal to the water texture to
roughen the specularity)

In my case, I was running a bit short of memory, so I made the
earth_mask.png file very much smaller than the NASA image. You can get
away with having far less detail in the mask than in the pigments.

#declare LandTex = texture {
  pigment {image_map { png "land_ocean_ice_8192.png" map_type 1 } }
}

#declare WaterTex = texture {
  pigment {image_map { png "land_ocean_ice_8192.png" map_type 1 } }
  finish {phong 0.25 phong_size 1}
}

#declare EarthTex = texture { 
  pigment_pattern {image_map {png "earth_mask.png" map_type 1}}
  texture_map {
     [0 WaterTex]
     [1 LandTex]
  }      
}

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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