POV-Ray : Newsgroups : povray.binaries.images : Copying pigments with crackle (124k jpg) : Re: Copying pigments with crackle (124k jpg) Server Time
1 Aug 2024 12:27:26 EDT (-0400)
  Re: Copying pigments with crackle (124k jpg)  
From: Blue Herring
Date: 29 Jul 2008 09:40:20
Message: <488f1dc4$1@news.povray.org>
This is really nifty, I'm trying to bend my brain around how it works :)

This reminds me of something I ran into a while back that Rune Johansen 
did with pigments, though I think the methods are different: 
http://runevision.com/3d/povgoodies/#216

I haven't tried it, but it might be slightly faster if you eliminate 
some interim pigments and some of the grayscale conversions, and return 
the function:

#macro pcc(pgmt, Mod)
   #local pgmt2 =
     function{
       pattern {
         pigment_pattern {pgmt}
       }
     }

   #local pg1=
     function{
       pattern {
         crackle form x
         scale .25
       }
     }

   function{
     pgmt2(
      (pow(pg1(x+Mod,y,z),2)-pow(pg1(x-Mod,y,z),2))/(Mod*64),
      (pow(pg1(x,y+Mod,z),2)-pow(pg1(x,y-Mod,z),2))/(Mod*64),
      z
     )
   }

#end

Just a possibility.

-- 
-The Mildly Infamous Blue Herring


Post a reply to this message

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