POV-Ray : Newsgroups : povray.general : This Human Hair Tutorial Server Time
2 Aug 2024 12:22:32 EDT (-0400)
  This Human Hair Tutorial (Message 1 to 4 of 4)  
From: ShiJie
Subject: This Human Hair Tutorial
Date: 15 Nov 2004 02:35:00
Message: <web.41985b2199814a1a174727610@news.povray.org>
Dear NG,

I lack much knowledge on many of the features of PovRay. So I better ask the
people here who are more knowledgeable than me, before I try this out.

Is this
http://www.comet-cartoons.com/toons/3ddocs/hair/
possible on PovRay?
(I didn't understand it 100%) but it seems to be only UV-mapping..
(uh..uhm.. I'm not sure if Texture-mapping is also a UV-mapping.. in fact I
don't know what UV-mapping exactly is..) but there is also opacity mapping
(sorry if this is also a UV-mapping.. but I have the feeling that it is
not)

Sorry for my stupidity, I'll read more on UV-mapping when I get the time.

Is there a way one can make the tutorial above PovRayable?

Thanks in advance

Sincerely,
Jose Capco


Post a reply to this message

From: Mike Williams
Subject: Re: This Human Hair Tutorial
Date: 15 Nov 2004 10:27:15
Message: <ES0poAAJoMmBFwOK@econym.demon.co.uk>
Wasn't it ShiJie who wrote:
>Dear NG,
>
>I lack much knowledge on many of the features of PovRay. So I better ask the
>people here who are more knowledgeable than me, before I try this out.
>
>Is this
>http://www.comet-cartoons.com/toons/3ddocs/hair/
>possible on PovRay?
>(I didn't understand it 100%) but it seems to be only UV-mapping..
>(uh..uhm.. I'm not sure if Texture-mapping is also a UV-mapping.. in fact I
>don't know what UV-mapping exactly is..) but there is also opacity mapping
>(sorry if this is also a UV-mapping.. but I have the feeling that it is
>not)
>
>Sorry for my stupidity, I'll read more on UV-mapping when I get the time.
>
>Is there a way one can make the tutorial above PovRayable?

Opacity mapping is something slightly different. You achieve it in POV
something like this:

#declare HairTex = texture {
  pigment_pattern {image_map {png "opacity.png" interpolate 2}}
  texture_map {
     [0 pigment {rgbt <0,0,0,1>}]
     [1 pigment {image_map {png "texture.png" interpolate 2}}]
  }      
}

What happens with this code is that you use two image maps. The first
one is your opacity map and the second contains a conventional pigment
map.

The opacity map is a greyscale image. Where it is black (value 0) we've
told POV to use the texture {pigment {rgbt <0,0,0,1>}} which is
completely transparent. Where the opacity map is white (value 1) we've
told POV to use texture {pigment {image_map {jpeg "texture.jpg"
interpolate 2}}}. Where the opacity map is grey, POV produces a blend of
the two textures.

The tutorial also uses a specularity map. The main purpose of this is to
ensure that the transparent bits don't have highlights. I suggest using
the same map for opacity and specularity, which makes things much easier
in POV. All you have to do is to ensure that the invisible texture has a
finish that is completely matt (which is the default) and the visible
texture contains shiny finish parameters.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: ShiJie
Subject: Re: This Human Hair Tutorial
Date: 18 Nov 2004 12:30:00
Message: <web.419cdb8ab36d504174727610@news.povray.org>
Thanks for your help! I wrote a pov with this code

#declare HairTex = texture {
  pigment_pattern {image_map {jpeg "Hair-Opa.jpg" interpolate 2}}
  texture_map {
     [0 pigment {rgbt <0,0,0,1>}]
     [1 pigment {image_map {jpeg "Hair.jpg" interpolate 2 }}]
  }
}


#declare strands =
intersection {
    sphere { <0, 0, 0> 1 }
    sphere { <0, 0, 0> .99 inverse}
    box{ <-1.5, 0, 1.5> < 1.5,  1.5, -1.5> rotate x*-10}
    box{ <-1.5, 0, 1.5> < 1.5, -1.5, -1.5> rotate x*10}
    plane{x, 0}
   rotate z*90
   //scale .5
   }
object {strands texture{HairTex} scale 2 translate y*2 }

and it looked like this
http://www.fmi.uni-passau.de/~capco/temp.jpg

(I didn't render it with anti-alias and good resolution, but it looks fine)

I didn't get to make it a little more shinier (I guess that's where the
specularity map comes to play.. ). I don't exactly know how this is done, I
can't call a "finish" in the texture if I already have a texture_map. Any
advises? Thanks again. The hair is perfect for the character I am about to
finish I just have to produce copy of the strands around the scalp and I
have a nice hair and I can even make styles out of it.


Sincerely,
Jose Capco


Post a reply to this message

From: Mike Williams
Subject: Re: This Human Hair Tutorial
Date: 18 Nov 2004 15:16:47
Message: <luvhXKAjLQnBFwhG@econym.demon.co.uk>
Wasn't it ShiJie who wrote:
>
>#declare HairTex = texture {
>  pigment_pattern {image_map {jpeg "Hair-Opa.jpg" interpolate 2}}
>  texture_map {
>     [0 pigment {rgbt <0,0,0,1>}]
>     [1 pigment {image_map {jpeg "Hair.jpg" interpolate 2 }}]
>  }
>}
...
>I didn't get to make it a little more shinier (I guess that's where the
>specularity map comes to play.. ). I don't exactly know how this is done, I
>can't call a "finish" in the texture if I already have a texture_map. Any
>advises?

The thing is that you don't want the {rgbt <0,0,0,1>} bit to be shiny
because there'd be shininess in the gaps between the hairs. So what you
do is only apply your shiny finish{} to the visible bits, thus using the
same map to control opacity and shininess. Something like this:

#declare HairTex = texture {
 pigment_pattern {image_map {jpeg "Hair-Opa.jpg" interpolate 2}}
 texture_map {
     [0 pigment {rgbt <0,0,0,1>}]
     [1 texture {
          pigment {image_map {jpeg "Hair.jpg" interpolate 2 }}
          finish {phong 1 phong_size 10}
        }
     ]
  }
}


-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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