POV-Ray : Newsgroups : povray.advanced-users : shadows and transparent textures (transparency map) Server Time
28 Jul 2024 18:24:57 EDT (-0400)
  shadows and transparent textures (transparency map) (Message 3 to 12 of 12)  
<<< Previous 2 Messages Goto Initial 10 Messages
From: Chris B
Subject: Re: shadows and transparent textures (transparency map)
Date: 8 Mar 2005 05:36:13
Message: <422d801d$1@news.povray.org>
"Slime" <fak### [at] emailaddress> wrote in message
news:422cbb32$1@news.povray.org...
> > however, the shadows are not affected by the image map. the shadows are
> > those cast by the underlying object.
>
>
> If you can see through it, then it should not cast a shadow. Perhaps your
> max_trace_level is too low?
>

It also depends on how much of the surface is opaque and whether the light
lines up with the bits of the image on the front and back surfaces.
It's probably stating the obvious, but a ray will only shine through if both
the point where it enters and the point where it leaves the object are
transparent.

Chris.


Post a reply to this message

From: uwe
Subject: Re: shadows and transparent textures (transparency map)
Date: 8 Mar 2005 07:05:02
Message: <web.422d943651916273b054365e0@news.povray.org>
The object is a box. the texture (pigment image map) is an image of a numer
"35" the 35 is solid, everything else is 100% transparent. the shadow is
clearly cast by the entire box. no silouhette of a number 35is visible.

i did some more testing, without texture map. i set the transmit of the box
to 100%. still it casts a shadow. strange, isn't it?

kind regards, uwe



"Chris B" <c_b### [at] btconnectcom> wrote:
> "Slime" <fak### [at] emailaddress> wrote in message
> news:422cbb32$1@news.povray.org...
> > > however, the shadows are not affected by the image map. the shadows are
> > > those cast by the underlying object.
> >
> >
> > If you can see through it, then it should not cast a shadow. Perhaps your
> > max_trace_level is too low?
> >
>
> It also depends on how much of the surface is opaque and whether the light
> lines up with the bits of the image on the front and back surfaces.
> It's probably stating the obvious, but a ray will only shine through if both
> the point where it enters and the point where it leaves the object are
> transparent.
>
> Chris.


Post a reply to this message

From: Chris B
Subject: Re: shadows and transparent textures (transparency map)
Date: 8 Mar 2005 10:14:45
Message: <422dc165$1@news.povray.org>
"uwe" <nomail@nomail> wrote in message
news:web.422d943651916273b054365e0@news.povray.org...
> "Chris B" <c_b### [at] btconnectcom> wrote:
> > "Slime" <fak### [at] emailaddress> wrote in message
> > news:422cbb32$1@news.povray.org...
> > > > .. the shadows are not affected by the image map. the shadows are
> > > > those cast by the underlying object.
> > >
> > > If you can see through it, then it should not cast a shadow. Perhaps
your
> > > max_trace_level is too low?
> >
> > It also depends on how much of the surface is opaque and whether the
light
> > lines up with the bits of the image on the front and back surfaces...
> >
> The object is a box. the texture (pigment image map) is an image of a
number
> "35" the 35 is solid, everything else is 100% transparent. the shadow is
> clearly cast by the entire box. no silouhette of a number 35is visible.
>
> i did some more testing, without texture map. i set the transmit of the
box
> to 100%. still it casts a shadow. strange, isn't it?
>

Have you tried Slime's suggestion and adjusted the max_trace_level?
Otherwise I suggest reducing the scene to the minimum number of elements
(comment out the rest) to make sure nothing else is causing the effect.
If you're saying that without the texture map you get something like box
{0,1, pigment {color rgbt 1}} casting a shadow on plane {y,-1 pigment {color
rgb 1}} then yes that's something very strange.
If you reduce it to the minimum and still see a problem then why not post a
short code snippet.

Chris.


Post a reply to this message

From: uwe
Subject: Re: shadows and transparent textures (transparency map)
Date: 13 Mar 2005 07:35:00
Message: <web.423432ad51916273f00afe800@news.povray.org>
max_trace_level makes no difference in this case.

consider this example:



global_settings { max_trace_level 10 }

camera {
  perspective
  location  <1, 1.5, 2>
  look_at   <0.5, 0.5, 0>
  angle     45
}

light_source {
  <10, 10, 10>,
  color rgb <1, 1, 1>
}

object {
 polygon { 4, <0, 0>, <1, 0>, <1, 1>, <0, 1> }
  texture {
    finish { ambient 1.000000 diffuse 1.000000 }
// 35.tga is an image with alpha channel of the number "35" on a fully
transparent background.
    pigment { uv_mapping image_map { tga "35.tga" interpolate 2 } }
  }
}

object {
  plane { <0.000000, 1.000000, 0.000000>, 0.000000 }
  texture {
    finish { ambient 1.000000 diffuse 1.000000 }
    pigment { color rgbft <0.400000, 0.400000, 1.000000, 0.000000, 0.000000>
}
  }
}

// note that the shadow cast by the polygon on the plane is the outline of
the polygon, not the outline of the number "35"


Post a reply to this message

From: Slime
Subject: Re: shadows and transparent textures (transparency map)
Date: 13 Mar 2005 15:06:40
Message: <42349d50@news.povray.org>
> max_trace_level makes no difference in this case.
>
> consider this example:

Yeah, you're right (tested with my own transparent PNG). The problem doesn't
happen if you remove the uv_mapping keyword.

I also get some weird results trying to rotate the polygon when uv_mapping
is there.

Oh, according to "3.5.7.1  Supported Objects" in the docs, uv_mapping isn't
supported for polygons. And if it *did* work for a polygon, you'd probably
have to put the texture block inside the polygon object instead of inside an
object{} wrapper. Do you really even need it for a polygon (which is 2D)?
What are you trying to do?

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


Post a reply to this message

From: uwe
Subject: Re: shadows and transparent textures (transparency map)
Date: 15 Mar 2005 04:45:00
Message: <web.4236adbb5191627373b827db0@news.povray.org>
> What are you trying to do?
>
>  - Slime
>  [ http://www.slimeland.com/ ]


i write a program that reads .3DS meshes and renders them using POV-Ray. so
i have a lot of uv-mapped meshes.

here is my example rewritten with mesh2: same result!



global_settings { max_trace_level 10 }

camera {
  perspective
  location  <2, 3, 4>
  look_at   <1, 1, 0>
  angle     45
}

light_source {
  <10, 10, 10>,
  color rgb <1, 1, 1>
}

object {
  mesh2 {
    vertex_vectors { 4,
      <0, 0, 0>,
      <2, 0, 0>,
      <0, 2, 0>,
      <2, 2, 0>
    }
    normal_vectors { 1,
      <0, 0, 1>
    }
    uv_vectors { 4,
      <0, 0>,
      <1, 0>,
      <0, 1>,
      <1, 1>
    }
    face_indices { 2,
      <0, 1, 2>,
      <1, 2, 3>
    }
    normal_indices { 2,
      <0, 0, 0>,
      <0, 0, 0>
    }
    uv_indices { 2,
      <0, 1, 2>,
      <1, 2, 3>
    }
  }
  texture {
    finish { ambient 1 diffuse 1 }
// 35.tga is an image with alpha channel of the number "35" on a fully
transparent background.
    pigment { uv_mapping image_map { tga "35.tga" interpolate 2 }  }
  }
}

object {
  plane { <0, 1, 0>, 0 }
  texture {
    finish { ambient 1 diffuse 1 }
    pigment { color rgbft <0.4, 0.4, 1, 0, 0> }
  }
}

// note that the shadow cast by the mesh2 on the plane is the outline of the
mesh2, not the outline of the number "35"
// note if you remove the "uv_mapping" modifier the shadow will be correct
but the texture will not be mapped correctly


Post a reply to this message

From: Slime
Subject: Re: shadows and transparent textures (transparency map)
Date: 15 Mar 2005 13:12:25
Message: <42372589$1@news.povray.org>
> here is my example rewritten with mesh2: same result!

Oh, ok. You're doing the same thing:

object {
    mesh {
        (mesh data)
    }
    texture {...}
}

You should be doing this:

mesh {
    (mesh data)
    uv_mapping
    texture {...}
}

When you're UV-Mapping an object, the texture must be on the very object
being UV-mapped or else it can't be evaluated properly. I'm not sure why
POV-Ray even lets you get away with the former.

Note that you have to add the uv_mapping keyword to the mesh itself and not
the pigment; I'm not sure why this is, and it does seem contrary to what
"3.5.7  UV Mapping" suggests. Maybe someone else can step in and explain
this...

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


Post a reply to this message

From: uwe
Subject: Re: shadows and transparent textures (transparency map)
Date: 15 Mar 2005 14:10:00
Message: <web.423732db5191627373b827db0@news.povray.org>
> Note that you have to add the uv_mapping keyword to the mesh itself and not
> the pigment; I'm not sure why this is, and it does seem contrary to what
> "3.5.7  UV Mapping" suggests. Maybe someone else can step in and explain
> this...
>
>  - Slime
>  [ http://www.slimeland.com/ ]

thanks for pointing this out to me! this works really well. GREAT!

have you got any idea of how to implement specular maps and shininess maps?
3DS materials can have both of them.

uwe


Post a reply to this message

From: Slime
Subject: Re: shadows and transparent textures (transparency map)
Date: 15 Mar 2005 14:54:59
Message: <42373d93@news.povray.org>
> have you got any idea of how to implement specular maps and shininess
maps?
> 3DS materials can have both of them.

Specularity/reflection are properties specified in the finish{} block. Since
you can't have a finish map in the official version of POV-Ray, you have to
use a texture_map. So you might want to predefine your pigment and use it in
each entry of the texture_map:

#declare thepigment = pigment {...}
texture {
    tga "finishmap.tga"
    texture_map {
        [0 pigment{thepigment} finish{specular 0}]
        [0 pigment{thepigment} finish{specular 1}]
    }
}

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


Post a reply to this message

From: Peter Duthie
Subject: Re: shadows and transparent textures (transparency map)
Date: 15 Mar 2005 17:52:49
Message: <42376741$1@news.povray.org>
Or alternatively you can use MLPov:

http://pov.monde.free.fr/mael/mlpov083.html

Although I have no idea whether the finish maps in MLPov will work with 
UV-Mapping.  Probably worth a try if the alternative is huge trees of 
texture_maps where all you want is a different mapping for each finish 
attribute.

Note that this is not an officially supported version of Pov, so 
questions about it are best posted to povray.unofficial.patches, 
otherwise some people around here might object to posts in the main 
newsgroups about it.

Also, the documentation is in French, so it helps if you can read 
French.  Babelfish is helpful, a little (http://world.altavista.com/).

Peter D.

Slime wrote:
>>have you got any idea of how to implement specular maps and shininess
> 
> maps?
> 
>>3DS materials can have both of them.
> 
> 
> Specularity/reflection are properties specified in the finish{} block. Since
> you can't have a finish map in the official version of POV-Ray, you have to
> use a texture_map. So you might want to predefine your pigment and use it in
> each entry of the texture_map:
> 
> #declare thepigment = pigment {...}
> texture {
>     tga "finishmap.tga"
>     texture_map {
>         [0 pigment{thepigment} finish{specular 0}]
>         [0 pigment{thepigment} finish{specular 1}]
>     }
> }
> 
>  - Slime
>  [ http://www.slimeland.com/ ]
> 
>


Post a reply to this message

<<< Previous 2 Messages Goto Initial 10 Messages

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