POV-Ray : Newsgroups : povray.binaries.images : Simple Patina Macro (7kb jpg) Server Time
19 Nov 2024 10:36:35 EST (-0500)
  Simple Patina Macro (7kb jpg) (Message 1 to 10 of 10)  
From: Rune
Subject: Simple Patina Macro (7kb jpg)
Date: 28 Nov 2003 08:28:36
Message: <3fc74d84@news.povray.org>
In the thread "Subsurface Scattering: macro now available (21kb jpeg)"
Gilles Tran wrote this:

> Also: could a trick like this be used to create patina effects?

I don't know that much about how patina should look, but I've got the
impression that it's not dependent on light source location, like
subsurface scattering is? If it's more a matter of curvature of the
surface and nearby surfaces, then this macro might be sufficient:


#macro patina_pattern(Obj,Blur,Samples,Stream)
   // by Rune S. Johansen 2003
   #local FN =
   function {
      pigment {
         average
         pigment_map {
            #local C = 0;
            #while (C<Samples)
               [1
                  object{Obj rgb 0, rgb 1}
                  translate <
                     rand(Stream)-rand(Stream),
                     rand(Stream)-rand(Stream),
                     rand(Stream)-rand(Stream)
                  >*Blur
               ]
               #local C = C+1;
            #end
         }
      }
   }
   function {FN(x,y,z).red}
#end


Here's a simple sample scene which produces the attached image:


#declare Object =
union {
   plane {y,0}
   box {-1,1 scale <3.2,1.0,0.7> translate y}
   box {-1,1 scale <1.0,1.0,3.0> translate y}
   box {-1,1 scale <1.0,2.0,1.0> translate 2*y}
   box {-1,1 scale <0.5,0.7,3.5> translate 0.7*y}
   sphere {4*y, 1}
   torus {2.4, 0.5 translate y}
   scale 2
}
object {
   Object
   pigment {
      patina_pattern(Object, 2, 256, seed(0) )
      color_map {
         [0.1, rgb 1][0.9, rgb 0]
      }
   }
}
light_source {< 2, 3,-1>*100, color rgb <1.2,1.2,0.9> shadowless}
light_source {<-2, 3,-2>*100, color rgb <0.5,0.5,0.8> shadowless}
camera {location <9,12,-13> look_at 3*y}


Let me know if this is any useful...

Rune
--
3D images and anims, include files, tutorials and more:
rune|vision:  http://runevision.com **updated Sep 28**
POV-Ray Ring: http://webring.povray.co.uk


Post a reply to this message


Attachments:
Download 'patina.jpg' (7 KB)

Preview of image 'patina.jpg'
patina.jpg


 

From: Mike Andrews
Subject: Re: Simple Patina Macro (7kb jpg)
Date: 28 Nov 2003 10:30:01
Message: <web.3fc76919d96c42012e746c9a0@news.povray.org>
Hi Rune,

I used a similar technique, based on a macro by ABX, in my 'Death of a
Cliche' image:

code : http://news.povray.org/povray.binaries.scene-files/23889/
image: http://news.povray.org/povray.binaries.images/23788/

Mike.

Rune wrote:
>In the thread "Subsurface Scattering: macro now available (21kb jpeg)"
>Gilles Tran wrote this:
>
>> Also: could a trick like this be used to create patina effects?
>
>I don't know that much about how patina should look, but I've got the
>impression that it's not dependent on light source location, like
>subsurface scattering is? If it's more a matter of curvature of the
>surface and nearby surfaces, then this macro might be sufficient:
>
>
>#macro patina_pattern(Obj,Blur,Samples,Stream)
>   // by Rune S. Johansen 2003
>   #local FN =
>   function {
>      pigment {
>         average
>         pigment_map {
>            #local C = 0;
>            #while (C<Samples)
>               [1
>                  object{Obj rgb 0, rgb 1}
>                  translate <
>                     rand(Stream)-rand(Stream),
>                     rand(Stream)-rand(Stream),
>                     rand(Stream)-rand(Stream)
>                  >*Blur
>               ]
>               #local C = C+1;
>            #end
>         }
>      }
>   }
>   function {FN(x,y,z).red}
>#end

[snip]

>Let me know if this is any useful...
>
>Rune
>--
>3D images and anims, include files, tutorials and more:
>rune|vision:  http://runevision.com **updated Sep 28**
>POV-Ray Ring: http://webring.povray.co.uk
>


Post a reply to this message

From: Samuel Benge
Subject: Re: Simple Patina Macro (7kb jpg)
Date: 28 Nov 2003 12:30:25
Message: <3FC7862B.8050603@hotmail.com>
Hey Rune. I'm sure this concept will be useful, but somebody needs to 
produce a model worthy of diplaying its properties. That buddha statue 
ought to work. This technique could be used to simulate oxidation or 
paint that has been partially worn off by excessive handling.

By the way, isn't this kind of like the proximity pattern? (I never used 
it, so I don't know).

Rune wrote:

> 
> I don't know that much about how patina should look, but I've got the
> impression that it's not dependent on light source location, like
> subsurface scattering is? If it's more a matter of curvature of the
> surface and nearby surfaces, then this macro might be sufficient:
> 


-- 
Samuel Benge

stb### [at] hotmailcom
See my website@: http://www.goldrush.com/~abenge/Top/index.html


Post a reply to this message

From: ABX
Subject: Re: Simple Patina Macro (7kb jpg)
Date: 28 Nov 2003 12:39:36
Message: <7p1fsvsbj4ogagbdd02sisa8l7rja7onub@4ax.com>
On Fri, 28 Nov 2003 09:30:19 -0800, Samuel Benge <sbe### [at] hotmailcom>
wrote:
> By the way, isn't this kind of like the proximity pattern? (I never used 
> it, so I don't know).

I could say it's KIND of proximity pattern but more to refresh associations to
old long discussion in one of groups than to really express something. ;-)

ABX


Post a reply to this message

From: Christopher James Huff
Subject: Re: Simple Patina Macro (7kb jpg)
Date: 28 Nov 2003 22:31:41
Message: <cjameshuff-13E0AD.22314528112003@netplex.aussie.org>
In article <3FC### [at] hotmailcom>,
 Samuel Benge <sbe### [at] hotmailcom> wrote:

> Hey Rune. I'm sure this concept will be useful, but somebody needs to 
> produce a model worthy of diplaying its properties. That buddha statue 
> ought to work. This technique could be used to simulate oxidation or 
> paint that has been partially worn off by excessive handling.

I agree...this looks like it may be a very useful effect. Maybe I should 
revive my blurred pattern patch...I'll have more time to do that after 
this semester is over.
(Didn't someone else also do a blurred pattern patch?)


> By the way, isn't this kind of like the proximity pattern? (I never used 
> it, so I don't know).

Not really, though it can resemble it in shape. The proximity pattern 
was based on distance to the surface. This is based on the proportion of 
nearby space taken up by the volume of the object. It is basically a 
blurred object pattern.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: Christopher James Huff
Subject: Re: Simple Patina Macro (7kb jpg)
Date: 28 Nov 2003 22:34:18
Message: <cjameshuff-779B4C.22342228112003@netplex.aussie.org>
In article <3fc74d84@news.povray.org>, "Rune" <run### [at] runevisioncom> 
wrote:

> I don't know that much about how patina should look, but I've got the
> impression that it's not dependent on light source location, like
> subsurface scattering is? If it's more a matter of curvature of the
> surface and nearby surfaces, then this macro might be sufficient:

It is a matter of curvature, or more precisely, accessibility. Oxidation 
and weathering that gets rubbed off of exposed surfaces while 
accumulating on more protected surfaces.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: Christoph Hormann
Subject: Re: Simple Patina Macro (7kb jpg)
Date: 29 Nov 2003 05:32:05
Message: <s88m91-cp2.ln1@triton.imagico.de>
Christopher James Huff wrote:
> [...]
> 
> I agree...this looks like it may be a very useful effect. Maybe I should 
> revive my blurred pattern patch...I'll have more time to do that after 
> this semester is over.
> (Didn't someone else also do a blurred pattern patch?)

http://www.tu-bs.de/%7Ey0013390/povcyg/docu/docu_pattern01.html#BLUR

I used a relative grid which does not lead to a completely smooth 
pattern while you used an absolute grid.  Both metods hve their use i think.

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: Mael
Subject: Re: Simple Patina Macro (7kb jpg)
Date: 29 Nov 2003 05:44:43
Message: <3fc8789b$1@news.povray.org>
> > Also: could a trick like this be used to create patina effects?
> I don't know that much about how patina should look,

me neither but I've done some attempts 2 years ago (woh, time passed fast..)
with the projection pattern , creating a kind of accessibility pattern :
http://news.povray.org/povray.binaries.images/18641/
(The source for this example is in the mlpov documentation)

M


Post a reply to this message

From: Christopher James Huff
Subject: Re: Simple Patina Macro (7kb jpg)
Date: 29 Nov 2003 09:13:41
Message: <cjameshuff-26C5BF.09134629112003@netplex.aussie.org>
In article <s88### [at] tritonimagicode>,
 Christoph Hormann <chr### [at] gmxde> wrote:

> > I agree...this looks like it may be a very useful effect. Maybe I should 
> > revive my blurred pattern patch...I'll have more time to do that after 
> > this semester is over.
> > (Didn't someone else also do a blurred pattern patch?)
> 
> http://www.tu-bs.de/%7Ey0013390/povcyg/docu/docu_pattern01.html#BLUR
> 
> I used a relative grid which does not lead to a completely smooth 
> pattern while you used an absolute grid.  Both metods hve their use i think.

I did a patch using a relative grid first. The "smooth" blur version was 
specifically intended for isosurfaces, which benefited from the 
continuity of that version. I never got anything polished enough for 
release though...seem to have some trouble doing that. ;-)

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: Christopher James Huff
Subject: Re: Simple Patina Macro (7kb jpg)
Date: 29 Nov 2003 14:29:55
Message: <cjameshuff-1FAF24.14300129112003@netplex.aussie.org>
In article <cja### [at] netplexaussieorg>,
 Christopher James Huff <cja### [at] earthlinknet> wrote:

> > By the way, isn't this kind of like the proximity pattern? (I never used 
> > it, so I don't know).
> 
> Not really, though it can resemble it in shape. The proximity pattern 
> was based on distance to the surface. This is based on the proportion of 
> nearby space taken up by the volume of the object. It is basically a 
> blurred object pattern.

BTW, the "sub-surface scattering" pattern using the projection pattern 
is quite similar to a "visibility" pattern I was working on, which was a 
very close relative of the proximity pattern and was intended to be used 
for patinas. It could be a bit closer to a proximity pattern if the 
projection pattern depended on distance...

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

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