POV-Ray : Newsgroups : povray.general : pigment_pattern vs. "regular" pattern Server Time
3 Aug 2024 18:16:03 EDT (-0400)
  pigment_pattern vs. "regular" pattern (Message 1 to 5 of 5)  
From: Steely
Subject: pigment_pattern vs. "regular" pattern
Date: 2 Jan 2004 14:56:25
Message: <pan.2004.01.02.20.01.48.470379@hamburg.de>
A happy new year to all!

I am trying to figure out what "special" things are possible with a
pigment_pattern but I don't get it. Whatever I do, when compared with the
corresponding "regular" pattern there is no difference to see.

Taking for example a snip out of the Docs:
pigment { 
pigment_pattern { 
checker [and so on ...]

instead of:
pigment {
checker [and so on ...]

has no visible differences in the pictures (except the colours, of
course).

Do I expect too much from this feature? Or is there some "magic thing" for
working with it, and I didn't found it?

TIA

Rm


Post a reply to this message

From: Shay
Subject: Re: pigment_pattern vs. "regular" pattern
Date: 2 Jan 2004 15:25:28
Message: <3ff5d3b8$1@news.povray.org>
"Steely" <rob### [at] hamburgde> wrote in message
news:pan### [at] hamburgde...
|
| Do I expect too much from this feature (pigment functions)?
| Or is there some "magic thing" for working with it, and I
| didn't found it?

The power comes when you combine two or more function pigments or a
function pigment along with float functions together.

a simple example:
#local f_bozo=function{
  pigment{
    bozo
  }
}

#local f_bozo2=function{
  f_bozo(sin(x),y*x,cos(z)).gray
}

#local Pig = pigment{
  function{
    f_bozo2(x,y,z)
  }
  scale .1
}

<insert (menu) the orthographic camera scene and apply this pigment to
the box to see it>

 -Shay


Post a reply to this message

From: Christoph Hormann
Subject: Re: pigment_pattern vs. "regular" pattern
Date: 2 Jan 2004 16:02:06
Message: <0c2hc1-dve.ln1@triton.imagico.de>
Steely wrote:
> A happy new year to all!
> 
> I am trying to figure out what "special" things are possible with a
> pigment_pattern but I don't get it. Whatever I do, when compared with the
> corresponding "regular" pattern there is no difference to see.
> 
> Taking for example a snip out of the Docs:
> pigment { 
> pigment_pattern { 
> checker [and so on ...]
> 
> instead of:
> pigment {
> checker [and so on ...]
> 
> has no visible differences in the pictures (except the colours, of
> course).

pigment_pattern is a very useful method to apply pattern modifiers (like 
warps, transforms, etc.) only to the pattern and not to the map 
components.  If you only use plain colors in checker (or a color_map on 
other patterns) this won't make any difference of course.  Megapov 0.x 
had another feature (the 'reset_children' warp) for this purpose but it 
was more ugly and more limited.

Example:

pigment {
   gradient x
   pigment_map { [0.5 P_1][0.5 P_2] }
   warp { turbulence 0.5 }
}

pigment {
   pigment_pattern {
     gradient x
     warp { turbulence 0.5 }
   }
   pigment_map { [0.5 P_1][0.5 P_2] }
}

Another thing is of course you can apply an arbitrary color_map in 
pigment_pattern and this way create something like a custom waveform 
modifier.

Christoph

-- 
POV-Ray tutorials, include files, Sim-POV,
HCR-Edit and more: http://www.tu-bs.de/~y0013390/
Last updated 25 Oct. 2003 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: Warp
Subject: Re: pigment_pattern vs. "regular" pattern
Date: 2 Jan 2004 23:20:37
Message: <3ff64315@news.povray.org>
Suppose that you want to create a wood texture using eg. the 'wood'
pattern with turbulence and uneven scale (to elongate the whirls of
the wood in a certain direction).
  But suppose that you don't want to use this pattern to create a color
map but for example a texture map. That is, instead of making a wood
which uses different colors from eg red to yellow, you want it to use
different pre-defined textures.

  The basic problem which you had in POV-Ray 3.1 with this is that the
only way of doing this is to use the 'wood' pattern to create a texture_map
(which uses the pre-defined textures) and apply the turbulence and uneven
scale to the whole thing. This has the problem that it will also apply
the turbulence and the scale to those sub-textures.
  Suppose that you just want the *pattern* to look like an elongated
turbulented wood, not the textures it uses. You need some way to apply
the transformations to the pattern only but not to the textures inside
the texture_map.

  pigment_pattern is one way of achieving this. With it you can create
a *pattern* which is transformed in any way you like and then use that
to create your texture_map. The transformations you apply inside the
pigment_pattern will affect the pattern only, not anything else. That
is, the textures in the texture_map will be unaffected by these
transformations.

  However, using the function pattern (ie. "function { pattern { ... } }")
is more stylish because you don't need to create an obsolete color map
which you need in your pigment_pattern.

  I don't really know why pigment_pattern exists at all since usually
the function pattern does anything pigment_pattern does and even more.
  Perhaps creating a pattern from an image_map is easier with pigment_pattern
(I haven't really ever looked at that).

-- 
plane{-x+y,-1pigment{bozo color_map{[0rgb x][1rgb x+y]}turbulence 1}}
sphere{0,2pigment{rgbt 1}interior{media{emission 1density{spherical
density_map{[0rgb 0][.5rgb<1,.5>][1rgb 1]}turbulence.9}}}scale
<1,1,3>hollow}text{ttf"timrom""Warp".1,0translate<-1,-.1,2>}//  - Warp -


Post a reply to this message

From: Steely
Subject: Re: pigment_pattern vs. "regular" pattern - thanks
Date: 4 Jan 2004 18:13:38
Message: <3ff89e22@news.povray.org>
Thanks boys,

I think I've got it now :-)

Rm


Post a reply to this message

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