POV-Ray : Newsgroups : povray.binaries.scene-files : Update Patina Macro Server Time
1 Sep 2024 16:19:41 EDT (-0400)
  Update Patina Macro (Message 1 to 1 of 1)  
From: James A Coons
Subject: Update Patina Macro
Date: 29 Oct 2004 22:20:01
Message: <web.4182fa123767914bd3c06d7b0@news.povray.org>
I took the original Patina Macro by Rune S. Johansen 2003 and used it
with textures instead of pigments. I couldn't find the original thread
to respond there, so instead, I will start a new one. His original macro
is included below. I simply wanted to post an image I created with a
modified version of the macro. First, his macro and his image, then I
will add mine ...

--- James Coons


Rune S. Johansen's original "patina_pattern" macro and scene file:

=====
// 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:
//    by Rune S. Johansen 2003

#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 to demo the Function:
#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}

=====


Post a reply to this message


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

Preview of image 'patina_00.jpg'
patina_00.jpg


 

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