POV-Ray : Newsgroups : povray.general : PovRay 3.6 + WinXP - is "image_map" with alpha channels borked? Server Time
2 Aug 2024 00:18:18 EDT (-0400)
  PovRay 3.6 + WinXP - is "image_map" with alpha channels borked? (Message 1 to 7 of 7)  
From: Tim Otholt
Subject: PovRay 3.6 + WinXP - is "image_map" with alpha channels borked?
Date: 31 Mar 2005 22:50:01
Message: <web.424cc3e8a34020cb88aba4fb0@news.povray.org>
Hello!

I am working on a video project and need the more or less "stock" animation
of a camera in outer space zooming into the earth.  It didn't sound like a
difficult problem so I decided to give Windows Povray 3.6 a try and worked
up my first .POV file:

//============================

#include "colors.inc"

background { color Black }

camera {
  location <0, 0, 300>
  look_at  <0, 0,  0>
}

sphere {

    <0, 1, 2>, 100
    texture
    {
      //pigment { color Yellow }

      pigment{ image_map { tiff "land_ocean_ice_8192.tif" map_type 1 } }

      //pigment{ image_map { tga "land_ocean_ice_8192.tga" map_type 1 } }

      finish { ambient 0.6  phong 0.3 diffuse 1 }
    }
    rotate y*230 rotate x*23.45
}

light_source { <0, 150, 150> color White}

//=================================

For the image map, it comes from NASA's blue marble website:

http://visibleearth.nasa.gov/images/2430/land_ocean_ice_8192.tif


Problem:

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

2) So I load Photoshop 7.0 and convert the image to a .PNG file with an
alpha channel.  Still doesn't work.

So I convert the image to a .TGA file and it renders correctly, except I was
trying to use the alpha channel to properly render specularity:

a. render a globe of the earth with full specularity
b. render a slightly larger sphere with no specularity but with the alpha
allowing the oceans to shine through
c. add some cloud layers, etc.

Converting to an indexed color format is not a good solution to me as the
color banding when the video is processed by my mpeg encoder makes the
image rather useless.

Is there something special about using images with alpha channels?  Is there
a bug with POVRAY and handling .TGA / .PNG files with alpha channels?

Thanks for any help you can give me.  What sounds like a simple job has
turned out to be a severe annoyance.

Aloha!!!!!

Tim Otholt


Post a reply to this message

From: Mike Williams
Subject: Re: PovRay 3.6 + WinXP - is "image_map" with alpha channels borked?
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

From: Thomas de Groot
Subject: Re: PovRay 3.6 + WinXP - is "image_map" with alpha channels borked?
Date: 1 Apr 2005 02:01:33
Message: <424cf1cd@news.povray.org>
"Mike Williams" <nos### [at] econymdemoncouk> schreef in bericht
news:uZe### [at] econymdemoncouk...
> 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.
>
Yes, it does work! I make png image_maps with the transparant parts in the
alpha channel, then uv map it on a surface. Works perfectly! Works also for
tga by the way. I don't know about tif though.

Thomas


Post a reply to this message

From: Slime
Subject: Re: PovRay 3.6 + WinXP - is "image_map" with alpha channels borked?
Date: 1 Apr 2005 03:22:31
Message: <424d04c7$1@news.povray.org>
> 1) When I render the picture, the image is almost completely black.  It
> appears POVRAY doesn't work with .TIF files with alpha channels?

Did you try a tif or png file without alpha channels? Could this simply be a
gamma correction issue?

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

From: Tim Otholt
Subject: Re: PovRay 3.6 + WinXP - is "image_map" with alpha channels borked?
Date: 1 Apr 2005 05:10:01
Message: <web.424d1cd2e49383888aba4fb0@news.povray.org>
"Slime" <fak### [at] emailaddress> 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?
>
> Did you try a tif or png file without alpha channels? Could this simply be a
> gamma correction issue?
>
>  - Slime
>  [ http://www.slimeland.com/ ]

I'm pretty sure it is not a gamma correction issue.  In one of my test
renders, I placed a solid yellow sphere below the .TIF with an alpha
channel, and the planet was rendered completely yellow.

My suspicion is that the .TIF loader bombed out without an error of some
sort . . . basically when I have a .TIF file w/o alpha channel, the loading
of the .TIF file may take 30 seconds (about a hundred megabytes in size).
When the .TIF loader bombs out (alpha channel present), the loading of the
..TIF file is instantaneous.


Post a reply to this message

From: PM 2Ring
Subject: Re: PovRay 3.6 + WinXP - is "image_map" with alpha channels borked?
Date: 7 Apr 2005 10:50:00
Message: <web.42554732e4938383d6ca37a0@news.povray.org>
"Tim Otholt" <nomail@nomail> wrote:
     texture
>     {
>       pigment{ image_map { tiff "land_ocean_ice_8192.tif" map_type 1 } }
>       finish { ambient 0.6  phong 0.3 diffuse 1 }
>     }
> //=================================
>
> For the image map, it comes from NASA's blue marble website:

I'm trying to replicate the Blue Marble image itself, but I need help with
lighting/finish.

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

> Converting to an indexed color format is not a good solution to me as the
> color banding when the video is processed by my mpeg encoder makes the
> image rather useless.
>
> Is there something special about using images with alpha channels?  Is there
> a bug with POVRAY and handling .TGA / .PNG files with alpha channels?

You can use the filter all & transmit all arguments with all image files,
not just palette-mapped images. For example (from my Blue Marble stuff):

#declare TOcean =
texture {
  pigment{
    image_map {
      jpeg "land_shallow_topo_2048.jpg"

      filter all 2.675
      transmit all 0.175

      map_type 1
      interpolate 2
    }
  }
  finish{
    Reflective
    ambient  rgb<0,0,0.5>
    diffuse 0.1
  }
}

#declare TLand =
texture{
  pigment {
    image_map {
      jpeg "land_shallow_topo_2048.jpg"
      filter all 0.15
      transmit all 0.075

      map_type 1
      interpolate 2
    }
  }
  finish{
    Reflective
    ambient 0 diffuse  0.7
  }
}

#declare TPlanet =
texture {
  image_pattern{
    sys "EAlpha.bmp"
    map_type 1
    interpolate 2
  }
  texture_map
  {
   [.5 TOcean]
   [.5 TLand]
 }
}

//-----------------------------

I created EAlpha.bmp (a black&white mask) using the free Netpbm programs.


Post a reply to this message

From: PM 2Ring
Subject: Re: PovRay 3.6 + WinXP - is "image_map" with alpha channels borked?
Date: 7 Apr 2005 11:00:00
Message: <web.425549d3e4938383d6ca37a0@news.povray.org>
Mike Williams <nos### [at] econymdemoncouk> wrote:

> 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.

I hadn't thought of that trick.
>
> #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]
>   }
> }

Wouldn't it also save memory by declaring the pigment separately, since the
water & earth pigments are identical?

PS. Love your work, Mike; thanks for the isosurface tutorials!


Post a reply to this message

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