POV-Ray : Newsgroups : povray.general : having trouble with a texture... Server Time
31 Jul 2024 16:27:48 EDT (-0400)
  having trouble with a texture... (Message 1 to 10 of 10)  
From: Shark
Subject: having trouble with a texture...
Date: 21 Oct 2006 06:40:00
Message: <web.4539f7dc109ce1af34d33b330@news.povray.org>
I'm trying to recreate this object in POV-Ray:

http://en.wikipedia.org/wiki/Image:HSLSphere1.png

What I'm having trouble with is creating a single texture for the entire
object.
I can do the Hue and Saturation paramaters, but can't quite get the
Saturation parameter. Using a slope map for the Saturation parameter works
OK, except when I create the cut-away the slope reverts to 100% or 0% at
those sections.

Is there a pattern I can use that mimics the way the Saturation parameter
works in the above image?

Thanks.


Post a reply to this message

From: Slime
Subject: Re: having trouble with a texture...
Date: 21 Oct 2006 15:50:32
Message: <453a7a08$1@news.povray.org>
Ideal here would be these three functions:

function{ f_th(x,y,z) }
function{ f_ph(x,y,z) }
function{ f_r(x,y,z) }

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


Post a reply to this message

From: Shark
Subject: Re: having trouble with a texture...
Date: 21 Oct 2006 22:35:00
Message: <web.453ad8cecc2493de473080560@news.povray.org>
"Slime" <fak### [at] emailaddress> wrote:
> Ideal here would be these three functions:
>
> function{ f_th(x,y,z) }
> function{ f_ph(x,y,z) }
> function{ f_r(x,y,z) }
>
>  - Slime
>  [ http://www.slimeland.com/ ]

I've never used functions as pigments. I would appreciate some assistence.
Thanks!


Post a reply to this message

From: Slime
Subject: Re: having trouble with a texture...
Date: 22 Oct 2006 00:56:48
Message: <453afa10$1@news.povray.org>
> I've never used functions as pigments. I would appreciate some assistence.
> Thanks!

Just use it like a pattern:

pigment
{
function{f_th(x,y,z)}
pigment_map
{
[0 rgb 0]
[1 rgb 1]
}
}

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


Post a reply to this message

From: Shark
Subject: Re: having trouble with a texture...
Date: 22 Oct 2006 01:35:01
Message: <web.453b026fcc2493de97b9615b0@news.povray.org>
"Slime" <fak### [at] emailaddress> wrote:
> > I've never used functions as pigments. I would appreciate some assistence.
> > Thanks!
>
> Just use it like a pattern:
>
> pigment
> {
> function{f_th(x,y,z)}
> pigment_map
> {
> [0 rgb 0]
> [1 rgb 1]
> }
> }
>
>  - Slime
>  [ http://www.slimeland.com/ ]

I wouldn't know how to define the function... The math is a bit beyond me.
:(


Post a reply to this message

From: Shark
Subject: Re: having trouble with a texture...
Date: 22 Oct 2006 02:35:00
Message: <web.453b0feacc2493de97b9615b0@news.povray.org>
Oops! In the first message I meant to say that I was having trouble with the
luminence parameter--not the saturation parameter!


Post a reply to this message

From: Slime
Subject: Re: having trouble with a texture...
Date: 22 Oct 2006 03:08:18
Message: <453b18e2$1@news.povray.org>
> I wouldn't know how to define the function... The math is a bit beyond me.

You should be able to just use the functions I gave you, with pigment maps.
For instance, if you apply the pigment I provided to a sphere, you should
see how the f_th function looks and then you can make a pigment map to work
with it.

Or, if you want to use three functions to describe the R, G, and B color
components and combine them, you can do it like this:

pigment
{
average
pigment_map
{
[1 function{redfunc(x,y,z)} color_map{[0 rgb 0][1 rgb <3,0,0>]}]
[1 function{greenfunc(x,y,z)} color_map{[0 rgb 0][1 rgb <0,3,0>]}]
[1 function{bluefunc(x,y,z)} color_map{[0 rgb 0][1 rgb <0,0,3>]}]
}
}

If you just use f_th, f_r, and f_ph for the red/green/blue functions, you
will already have an interesting pigment.

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


Post a reply to this message

From: Shark
Subject: Re: having trouble with a texture...
Date: 22 Oct 2006 05:20:00
Message: <web.453b3698cc2493de2670f2cf0@news.povray.org>
Oh! I didn't realize these functions existed in functions.inc.
I thought you were just making them up as an example.

Thanks!

One more thing: what is the proper way of scaling the pigments or functions?
Their frequency is so high that the pattern occurs more than once on a
single sphere.

"Slime" <fak### [at] emailaddress> wrote:
> > I wouldn't know how to define the function... The math is a bit beyond me.
>
> You should be able to just use the functions I gave you, with pigment maps.
> For instance, if you apply the pigment I provided to a sphere, you should
> see how the f_th function looks and then you can make a pigment map to work
> with it.
>
> Or, if you want to use three functions to describe the R, G, and B color
> components and combine them, you can do it like this:
>
> pigment
> {
> average
> pigment_map
> {
> [1 function{redfunc(x,y,z)} color_map{[0 rgb 0][1 rgb <3,0,0>]}]
> [1 function{greenfunc(x,y,z)} color_map{[0 rgb 0][1 rgb <0,3,0>]}]
> [1 function{bluefunc(x,y,z)} color_map{[0 rgb 0][1 rgb <0,0,3>]}]
> }
> }
>
> If you just use f_th, f_r, and f_ph for the red/green/blue functions, you
> will already have an interesting pigment.
>
>  - Slime
>  [ http://www.slimeland.com/ ]


Post a reply to this message

From: Slime
Subject: Re: having trouble with a texture...
Date: 22 Oct 2006 17:43:41
Message: <453be60d$1@news.povray.org>
> One more thing: what is the proper way of scaling the pigments or
functions?
> Their frequency is so high that the pattern occurs more than once on a
> single sphere.

f_ph probably returns an angle from -pi/2 to pi/2. You can use f_ph(x,y,z) /
pi + .5 to get that between 0 and 1.
f_th probably returns an angle from 0 to 2*pi. You can use
f_th(x,y,z)/(2*pi) to get that between 0 and 1.
f_th might actually return an angle from -pi to pi, in which case
f_th(x,y,z)/(2*pi) + 1 will work.

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


Post a reply to this message

From: Shark
Subject: Re: having trouble with a texture...
Date: 22 Oct 2006 19:30:00
Message: <web.453bfe36cc2493de1bce5b0e0@news.povray.org>
"Slime" <fak### [at] emailaddress> wrote:
> > One more thing: what is the proper way of scaling the pigments or
> functions?
> > Their frequency is so high that the pattern occurs more than once on a
> > single sphere.
>
> f_ph probably returns an angle from -pi/2 to pi/2. You can use f_ph(x,y,z) /
> pi + .5 to get that between 0 and 1.
> f_th probably returns an angle from 0 to 2*pi. You can use
> f_th(x,y,z)/(2*pi) to get that between 0 and 1.
> f_th might actually return an angle from -pi to pi, in which case
> f_th(x,y,z)/(2*pi) + 1 will work.
>
>  - Slime
>  [ http://www.slimeland.com/ ]

Thank you. FYI, the angle returned by f_ph is between 0 and pi.


Post a reply to this message

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