POV-Ray : Newsgroups : povray.binaries.images : shadows don't honor image_map alpha channel : Re: shadows don't honor image_map alpha channel Server Time
31 Jul 2024 20:14:15 EDT (-0400)
  Re: shadows don't honor image_map alpha channel  
From: clipka
Date: 6 May 2009 07:00:01
Message: <web.4a016c9e440bdc7953a485b50@news.povray.org>
"Thomas de Groot" <tDOTdegroot@interDOTnlANOTHERDOTnet> wrote:
> That is strange... See my image: also a png image map.
>
> Thomas

Maybe we're using different ways to get the transparency into the shot, or
different objects or whatever? This is the code I used (boiled down to its
essence):

-------------------

#declare Entwined_Ivy_leaf_adult_=mesh2{
vertex_vectors{
4,
<-1,1,-1>,
<-1,1,1>,
<1,1,1>,
<1,1,-1>,
}
normal_vectors{
4,
<0,1,0>,
<0,1,0>,
<0,1,0>,
<0,1,0>,
}
uv_vectors{
4,
<0,0>,
<0,1>,
<1,1>,
<1,0>,
}
face_indices{
2,
<0,1,2>,
<2,3,0>,
}
uv_indices{
2,
<0,1,2>,
<2,3,0>,
}
normal_indices{
2,
<0,1,2>,
<2,3,0>,
}
inside_vector <0,0,1> }

#declare p_map22 = pigment { image_map { png "efeu1.png" interpolate 2 transmit
all 0 filter all 0 } }

#declare Ivy_leaf_adult_=
material{
  texture {pigment{ uv_mapping p_map22}
          finish{specular 0 roughness 0.09632328 ambient rgb <0.00,0.00,0.00>
diffuse 0.6   reflection{0 } conserve_energy}
  }
}

object{Entwined_Ivy_leaf_adult_  material{Ivy_leaf_adult_} hollow}

plane{y,0
  pigment { color rgb 1 }
  finish { diffuse 0.7 ambient 0 }
}

-------------------

As some keen-eyed person may guess, this is output from Thomas Luft's Ivy
Generator, converted to POV-Ray format using PoseRay (hand-edited to reduce the
mesh to a single, perfectly flat leaf).

When I use a texture_map instead - as in the following code - I get good results
as well, so it's a feasible workaround, but I'd expect PNG alpha to do the same
job on its own:

#declare Ivy_leaf_adult_=
material{
  texture {
    uv_mapping
    image_pattern { png "efeu1.png" use_alpha }
    texture_map {
      [0.0 pigment{ uv_mapping p_map22}
          finish{specular 0 roughness 0.09632328 ambient rgb <0.00,0.00,0.00>
diffuse 0.6   reflection{0 } conserve_energy} ]
      [1.0 pigment { transmit 1 } ]
    }
  }
}


Post a reply to this message

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