POV-Ray : Newsgroups : povray.unofficial.patches : new pattern help : Re: new pattern help Server Time
1 Sep 2024 16:17:26 EDT (-0400)
  Re: new pattern help  
From: Christoph Hormann
Date: 7 Mar 2001 13:31:57
Message: <3AA67E9B.9E86ACBD@gmx.de>
> 
> Tom Melly wrote:
> >
> > I am feeling vaguely inspired to try making a new pattern type.
> >
> > It would be almost indentical to "average" but would add values rather than
> > average them.
> >

I forgot to mention that such a thing is already possible for pigments if
you use pigment functions.  Although it's a bit more complicated, it is
more universal, because you can also use other functions than simple
addition.

try:

#macro Add_Pigment(Pig_1, Pig_2)

  #local fn_1=function { pigment { Pig_1 color_map { [0 rgb 0][1 rgb 1] }
} }
  #local fn_2=function { pigment { Pig_2 color_map { [0 rgb 0][1 rgb 1] }
} }

  function { fn_1(x, y, z) + fn_2(x, y, z) }

#end

#declare Pigm=
pigment {
  Add_Pigment( Pigment_1, Pigment_2 )
  ...
}

(not tested, but it should work)

Christoph

-- 
Christoph Hormann <chr### [at] gmxde>
IsoWood include, radiosity tutorial, TransSkin and other 
things on: http://www.schunter.etc.tu-bs.de/~chris/


Post a reply to this message

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