POV-Ray : Newsgroups : povray.general : slope pattern bug? Server Time
1 Aug 2024 10:12:27 EDT (-0400)
  slope pattern bug? (Message 1 to 10 of 13)  
Goto Latest 10 Messages Next 3 Messages >>>
From: Kenneth
Subject: slope pattern bug?
Date: 16 Jan 2006 22:05:00
Message: <web.43cc5cf4e3732dd0484f30@news.povray.org>
I'm not sure, but the slope pattern may not be working correctly(?).
I went back through the postings in several newsgroups, but didn't see
anything about it.

Using slope {0,-1,0} and without choosing Lo_slope and Hi_slope values, the
pattern does what is expected....covering the object "fully" with a
color_map or texture from top to bottom (that is, assigning the color_map
to the full 0-to-1 "slope"...all the object's normals.)

But sticking in Lo_slope and Hi_slope values ...like 0, .5
respectively...doesn't *seem* to do what the docs say:

"By specifying Lo_slope and Hi_slope you get more control:
  slope { <Direction>, Lo_slope, Hi_slope }
Lo_slope and Hi_slope specifies which range of slopes are used, so you can
control which slope values return which pattern values. Lo_slope is the
slope value that returns 0.0 and Hi_slope is the slope value that returns
1.0."

The way I read it, if I choose Lo_slope and Hi_slope to be 0 and .5, then
the function should completely ignore any object normals outside that range
and should map the full color_map only to the specified normals, nowhere
else. But the color map repeats at slope .5 and continues down to slope
1.0. ...in other words, it's re-applied to the object's
normals that are outside the range.
 If I make Hi_slope something like .2, then the visual result is
exactly the same as if I had used the frequency keyword on a typical
pattern: the color map repeats five times.

Is it meant to work this way? It would be much more useful (to me) if the
colors were mapped ONLY to the object's specified normals range. For
example, for "partially" texturing an object that already has another,
earlier texture applied to it. Using <altitude> along with Lo-alt and Hi_alt
is a cumbersome way to go about that, with a somewhat different result (and
the color_map still repeats.)

Ken Walker


Post a reply to this message

From: "Jérôme M. Berger"
Subject: Re: slope pattern bug?
Date: 17 Jan 2006 16:18:03
Message: <43cd5f0b$1@news.povray.org>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Kenneth wrote:
> I'm not sure, but the slope pattern may not be working correctly(?).
> I went back through the postings in several newsgroups, but didn't see
> anything about it.
> 
> Using slope {0,-1,0} and without choosing Lo_slope and Hi_slope values, the
> pattern does what is expected....covering the object "fully" with a
> color_map or texture from top to bottom (that is, assigning the color_map
> to the full 0-to-1 "slope"...all the object's normals.)
> 
> But sticking in Lo_slope and Hi_slope values ...like 0, .5
> respectively...doesn't *seem* to do what the docs say:
> 
> "By specifying Lo_slope and Hi_slope you get more control:
>   slope { <Direction>, Lo_slope, Hi_slope }
> Lo_slope and Hi_slope specifies which range of slopes are used, so you can
> control which slope values return which pattern values. Lo_slope is the
> slope value that returns 0.0 and Hi_slope is the slope value that returns
> 1.0."
> 
> The way I read it, if I choose Lo_slope and Hi_slope to be 0 and .5, then
> the function should completely ignore any object normals outside that range
> and should map the full color_map only to the specified normals, nowhere
> else. But the color map repeats at slope .5 and continues down to slope
> 1.0. ...in other words, it's re-applied to the object's
> normals that are outside the range.
>  If I make Hi_slope something like .2, then the visual result is
> exactly the same as if I had used the frequency keyword on a typical
> pattern: the color map repeats five times.
> 
	Have you tried adding the "ramp_wave" keyword to your pigment
definition? http://www.povray.org/documentation/view/3.6.1/404/

		Jerome

- --
******************************
*      Jerome M. Berger      *
*  mailto:jeb### [at] freefr   *
*  http://jeberger.free.fr/  *
******************************
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFDzV8Ld0kWM4JG3k8RAm8pAJ4uCSsE8wMGuRVQif75dVQ2XcOz0wCggLxQ
TPdvNwiHsHf0aQNo+hH39mA=
=14+f
-----END PGP SIGNATURE-----


Post a reply to this message

From: Trevor G Quayle
Subject: Re: slope pattern bug?
Date: 17 Jan 2006 18:16:29
Message: <43cd7acd$1@news.povray.org>
"Kenneth" <kdw### [at] earthlinknet> wrote in message 
news:web.43cc5cf4e3732dd0484f30@news.povray.org...
> I'm not sure, but the slope pattern may not be working correctly(?).
> I went back through the postings in several newsgroups, but didn't see
> anything about it.
>
> Using slope {0,-1,0} and without choosing Lo_slope and Hi_slope values, 
> the
> pattern does what is expected....covering the object "fully" with a
> color_map or texture from top to bottom (that is, assigning the color_map
> to the full 0-to-1 "slope"...all the object's normals.)
>
> But sticking in Lo_slope and Hi_slope values ...like 0, .5
> respectively...doesn't *seem* to do what the docs say:
>
> "By specifying Lo_slope and Hi_slope you get more control:
>  slope { <Direction>, Lo_slope, Hi_slope }
> Lo_slope and Hi_slope specifies which range of slopes are used, so you can
> control which slope values return which pattern values. Lo_slope is the
> slope value that returns 0.0 and Hi_slope is the slope value that returns
> 1.0."
>
> The way I read it, if I choose Lo_slope and Hi_slope to be 0 and .5, then
> the function should completely ignore any object normals outside that 
> range
> and should map the full color_map only to the specified normals, nowhere
> else. But the color map repeats at slope .5 and continues down to slope
> 1.0. ...in other words, it's re-applied to the object's
> normals that are outside the range.
> If I make Hi_slope something like .2, then the visual result is
> exactly the same as if I had used the frequency keyword on a typical
> pattern: the color map repeats five times.
>
> Is it meant to work this way? It would be much more useful (to me) if the
> colors were mapped ONLY to the object's specified normals range. For
> example, for "partially" texturing an object that already has another,
> earlier texture applied to it. Using <altitude> along with Lo-alt and 
> Hi_alt
> is a cumbersome way to go about that, with a somewhat different result 
> (and
> the color_map still repeats.)
>
> Ken Walker
>

You seem to be misinterpreting the way lo_slope and hi_slope work.  In the 
POV 3D world slopes between 0 and 1 are possible, with 0 being horizontal 
down, 0.5 being 90 deg vertical and 1 being horizontal up (relative to the 
direction vector).  The indexes in the slope map that the slope pattern uses 
will correspond to these (according to their waveform).  However, certain 
objects in POV like heightfields only have slopes from 0.5 to 1.0 with a 
direction vector of <0,1,0> (the docs use direction <0,-1,0> which makes it 
confusing if you don't catch that), so anything in the slope map outside 
that range is useles, so to give more control (read: finer control) the 
lo_slope and hi_slope can be redifined as 0.5 and 1.0, so that in the slope 
map, items with index 0.0 corespond to a slope of 0.5, and items with an 
index of 1.0 correspond to slopes of 1.0.  However, outside the hi and lo 
slope values, the pattern repeats as would any pattern type according to its 
waveform.  If, as I understand it, you want a texture only on the top half, 
you wouldn't use the hi_slope and lo_slope, instead, in the slope map, you 
would have no texture from index 0 to 0.5, and texture from 0.5 to 1.0.

hope this helps clear it up for you

-tgq


Post a reply to this message

From: Kenneth
Subject: Re: slope pattern bug?
Date: 17 Jan 2006 23:25:00
Message: <web.43cdc300e7742b9117cd4fde0@news.povray.org>
> Hash: SHA1
>

> >
>  Have you tried adding the "ramp_wave" keyword to your pigment
> definition? http://www.povray.org/documentation/view/3.6.1/404/
>
>   Jerome

Actually, no. But I do see now what the various waveform types do.  Thanks.
But the "problem" (for me) is still there, with the repeating patterns. I
was hoping the slope pattern would do what I had wanted, but my conception
of it seems to be wrong.

Ken


Post a reply to this message

From: Kenneth
Subject: Re: slope pattern bug?
Date: 17 Jan 2006 23:50:00
Message: <web.43cdc878e7742b9117cd4fde0@news.povray.org>
"Trevor G Quayle" <Tin### [at] hotmailcom> wrote:
> "Kenneth" <kdw### [at] earthlinknet> wrote in message

>
> You seem to be misinterpreting the way lo_slope and hi_slope work...

Yes, it does seem so. But I've re-read the slope pattern definition a bunch
of times, and still keeping coming up with  my *own* (wrong) conclusion
about how it operates.  :-[

> If, as I understand it, you want a texture only on the top half,
> you wouldn't use the hi_slope and lo_slope, instead, in the slope map, you
> would have no texture from index 0 to 0.5, and texture from 0.5 to 1.0.

Yes, I agree, that does work beautifully. That's exactly the way I finally
textured my object. But what I as *hoping* was that I could "restrict" the
full color_map colors to only a portion of the object...based on the
object's normals (using a sphere as a simple example.) Alas, no.

Your tip about the <0,-1,0> mistake in the docs has me scratching my
head...I thought I fairly well understood it as written! Egads, time to go
back over the docs once again....

Thanks for your response.


Post a reply to this message

From: Kenneth
Subject: Re: slope pattern bug?
Date: 18 Jan 2006 02:15:01
Message: <web.43cde912e7742b911f99adeb0@news.povray.org>
"Kenneth" <kdw### [at] earthlinknet> wrote:
> "Trevor G Quayle" <Tin### [at] hotmailcom> wrote:

> > If, as I understand it, you want a texture only on the top half,
> > you wouldn't use the hi_slope and lo_slope, instead, in the slope map, you
> > would have no texture from index 0 to 0.5, and texture from 0.5 to 1.0.
>
> Yes, I agree, that does work beautifully....
>

I should qualify that: It worked beautifully, because I applied the slope
map pattern over a previous texture. But used by itself (as the only
texture), strange things happen, as I've since discovered.

Can someone p*l*e*a*s*e explain why the following two examples show
different slope pattern results? I have some theories, but they're all pure
wacky guesswork.

The first example shows the way the slope pattern worked succesfully for me
(and it makes sense) :  The pattern is applied over a previous (white)
texture, and its red color fades to transparency as it reaches the opposite
side of the sphere.  Just what I wanted! But the second example--using the
slope pattern alone--shows the red color appearing on BOTH sides of the
sphere. Why so?

Help!!!

FIRST EXAMPLE:
sphere {0, 1
// 1st texture
 texture{pigment{color rgb 1} // WHITE
     finish{
    ambient .3
    diffuse .7
               }
             }

// 2nd texture
  texture {
    pigment {
        slope {<1,0,0>}
       color_map {
                        [0 color rgb <1,0,0>] // RED
                        [.2 color rgb <1,0,0>]
                        [.5 color rgbt 1]
                        [1 color rgbt 1] // TRANSPARENT
                            }
                    }
       finish{
          ambient .3
          diffuse .7
                 }
               }
           } // end of sphere


2nd EXAMPLE:
sphere {0, 1
  texture {
    pigment {
        slope {<1,0,0>}
       color_map {
                        [0 color rgb <1,0,0>] // RED
                        [.2 color rgb <1,0,0>]
                        [.5 color rgbt 1]
                        [1 color rgbt 1] // TRANSPARENT
                            }
                    }
       finish{
         ambient .3
         diffuse .7
                }
               }
              } // end of sphere


Post a reply to this message

From: Christian Walther
Subject: Re: slope pattern bug?
Date: 18 Jan 2006 05:08:06
Message: <43ce1386$1@news.povray.org>
Kenneth wrote:
> Can someone p*l*e*a*s*e explain why the following two examples show
> different slope pattern results? I have some theories, but they're all pure
> wacky guesswork.
> 
> The first example shows the way the slope pattern worked succesfully for me
> (and it makes sense) :  The pattern is applied over a previous (white)
> texture, and its red color fades to transparency as it reaches the opposite
> side of the sphere.  Just what I wanted! But the second example--using the
> slope pattern alone--shows the red color appearing on BOTH sides of the
> sphere. Why so?

What you're seeing on the right side in the second scene is the back 
surface of the sphere (through the transparent front surface). Its 
normal points inward, and therefore the slope pattern value is between 0 
and 0.5. Try replacing your sphere { 0, 1 } by a difference { sphere { 
0, 1 } plane { -z, 0 } }.

  -Christian


Post a reply to this message

From: Trevor G Quayle
Subject: Re: slope pattern bug?
Date: 18 Jan 2006 08:35:00
Message: <web.43ce43dce7742b916c4803960@news.povray.org>
>
> Yes, I agree, that does work beautifully. That's exactly the way I finally
> textured my object. But what I as *hoping* was that I could "restrict" the
> full color_map colors to only a portion of the object...based on the
> object's normals (using a sphere as a simple example.) Alas, no.



>
> Your tip about the <0,-1,0> mistake in the docs has me scratching my
> head...I thought I fairly well understood it as written! Egads, time to go
> back over the docs once again....
>

I didn't mean this was an actual mistake in the docs.  The docs makes sense
if you remember that they are using <0,-1,0>.  If you assume (as I did the
first time I went through) that "up" is <0,1,0>, then the docs seem wrong.
Hope I didn't confuse you any more than necessary...



-tgq


Post a reply to this message

From: Trevor G Quayle
Subject: Re: slope pattern bug?
Date: 18 Jan 2006 08:50:00
Message: <web.43ce46b3e7742b916c4803960@news.povray.org>
"Kenneth" <kdw### [at] earthlinknet> wrote:
> I should qualify that: It worked beautifully, because I applied the slope
> map pattern over a previous texture. But used by itself (as the only
> texture), strange things happen, as I've since discovered.
>
> Can someone p*l*e*a*s*e explain why the following two examples show
> different slope pattern results? I have some theories, but they're all pure
> wacky guesswork.
>
> The first example shows the way the slope pattern worked succesfully for me
> (and it makes sense) :  The pattern is applied over a previous (white)
> texture, and its red color fades to transparency as it reaches the opposite
> side of the sphere.  Just what I wanted! But the second example--using the
> slope pattern alone--shows the red color appearing on BOTH sides of the
> sphere. Why so?
>

That is a bit of a conundrum.  What happens is that as the rays hit the
sphere, they evaluate the slope and apply the pigment.  Now in areas where
the sphere is transparent or partially transparent, the rays continue
through and hit the back of the sphere from the *inside* and evaluate the
slope of the normal of this surface which gives opposite results of the
front surface. So the extra pigment you see is actually on the inside of
the opposite surface of the sphere as seen through the transparent texture
on the front surface.
Now how to get around this may be a tad more complex, I'll have to think
about that.

-tgq


Post a reply to this message

From: Trevor G Quayle
Subject: Re: slope pattern bug?
Date: 18 Jan 2006 09:00:00
Message: <web.43ce4926e7742b916c4803960@news.povray.org>
"Trevor G Quayle" <Tin### [at] hotmailcom> wrote:
> Now how to get around this may be a tad more complex, I'll have to think
> about that.

Ah, figured something out.  You can use interior_texture, which applies a
different texture to the interior of the object.  For the slope map
texture, you need it to basically be opposite the exterior texture as the
mormals of the inside are opposite.  Do this by using the same slope
pattern inside, but reverse the slope normal (ie, <1,0,0> becomes <-1,0,0>)


//START
sphere {0, 1
  texture{
    pigment{slope {<1,0,0>}
       color_map {[0.0 color rgb <1,0,0>] // RED
                  [0.2 color rgb <1,0,0>]
                  [0.5 color rgbt 1]
                  [1.0 color rgbt 1] // TRANSPARENT
        }
    }
    finish{ambient .3 diffuse .7}
  }
  interior_texture{
    pigment{slope {<-1,0,0>}
       color_map {[0.0 color rgb <1,0,0>] // RED
                  [0.2 color rgb <1,0,0>]
                  [0.5 color rgbt 1]
                  [1.0 color rgbt 1] // TRANSPARENT
        }
    }
    finish{ambient .3 diffuse .7}
  }
} // end of sphere
//END


-tgq


Post a reply to this message

Goto Latest 10 Messages Next 3 Messages >>>

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