POV-Ray : Newsgroups : povray.binaries.images : Copying pigments with crackle (124k jpg) Server Time
1 Aug 2024 18:21:52 EDT (-0400)
  Copying pigments with crackle (124k jpg) (Message 5 to 14 of 24)  
<<< Previous 4 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Tek
Subject: Re: Copying pigments with crackle (124k jpg)
Date: 29 Jul 2008 17:51:17
Message: <488f90d5$1@news.povray.org>
Awesome! I wanted something like that ages ago when I did my procedural 
crackle based city. I couldn't figure out how to do it. Now I'm just trying 
to understand your code!

Is there any way to make it work with metric 1?

-- 
Tek
http://evilsuperbrain.com


"stbenge" <THI### [at] hotmailcom> wrote in message 
news:488e5300@news.povray.org...
> Hi everyone,
>
> Years ago, somebody posted a swirly pigment. It resembled the swirls you
> see in clouds sometimes. I have tried looking for the code many times,
> but to no avail. The code has been lost.
>
> Every once in a while I try to recreate that code using pigment
> functions. Every time I've tried, I've failed. Until today.
>
> I based my work on the premise that the target pattern must be
> translated according to another pattern, in this case crackle form x.
> What I have arrived at must be different from the aforementioned
> poster's code, since his tended to have small gray boxes right at the
> center of each crackle cell. There is no such artifact in my code, and I
> can't be sure just how close my effect comes to his.
>
> Here is some code:
>
> #macro pcc(pgmt, Mod)
>  #local pgmt2=function{pigment{pgmt}}
>  #local pg1=
>  function{
>   pigment{
>    crackle form x
>    scale .25
>   }
>  }
>  pigment_pattern{
>   function{
>    pgmt2(
>     (pow(pg1(x+Mod,y,z).grey,2)-pow(pg1(x-Mod,y,z).grey,2))/(Mod*64),
>     (pow(pg1(x,y+Mod,z).grey,2)-pow(pg1(x,y-Mod,z).grey,2))/(Mod*64),
>     z
>    ).grey
>   }
>  }
> #end
>
> #declare my_pigment=
> pigment{
>  pcc(
>   pigment{
>    spiral1 1
>    sine_wave frequency 1
>    scale .125
>   }
>   ,.085
>  )
> }
>
> The macro takes two arguments. The first is the pigment you wish to have
> copied into each crackle cell. The second indicates how sharp you want
> the edges to be. Smaller values = sharper edges. The macro returns a
> pigment_pattern, so it can be used in any pattern block (pigment,
> normal, texture, etc.)
>
> I hope some of you find a use for this. I had hoped to use it for making
> height fields. I'll post any interesting results I might get.
>
> Sam
>


Post a reply to this message

From: stbenge
Subject: crystal mass (64k jpg)
Date: 29 Jul 2008 18:33:06
Message: <488f9aa2@news.povray.org>
Using the code modified to work in three dimensions, I applied a 
radiating crackle pattern to each cell. The resulting isosurface 
resembles aragonite.

Don't mind the really low-quality aa settings. Isosurfaces render very 
slowly...

Sam


Post a reply to this message


Attachments:
Download 'crystal_mass.jpg' (63 KB)

Preview of image 'crystal_mass.jpg'
crystal_mass.jpg


 

From: stbenge
Subject: Re: Copying pigments with crackle (124k jpg)
Date: 29 Jul 2008 18:36:13
Message: <488f9b5d@news.povray.org>
Tek wrote:
> Awesome! I wanted something like that ages ago when I did my procedural 
> crackle based city. I couldn't figure out how to do it. Now I'm just trying 
> to understand your code!

It pays off to keep trying. I can't tell you how many times I've tried 
to get this to work.

> Is there any way to make it work with metric 1?

Yes, you can get some interesting effects. Here, try this out:

#macro pcc(pgmt, Mod)
  #local pgmt2 =
   function{
    pattern{
     pigment_pattern {pgmt}
    }
   }
  #local pg1=
   function{
    pattern{
     crackle form x*.75
     metric 1
    }
   }
  function{
   pgmt2(
    (pow(pg1(x+Mod,y,z),2)-pow(pg1(x-Mod,y,z),2))/(Mod*1.2),
    (pow(pg1(x,y+Mod,z),2)-pow(pg1(x,y-Mod,z),2))/(Mod*1.2),
    (pow(pg1(x,y,z+Mod),2)-pow(pg1(x,y,z-Mod),2))/(Mod*1.2)
   )
  }
#end

plane{z,0
  pigment{
   pcc(
    pigment{
     radial rotate x*90+z*45
     triangle_wave frequency 2
     color_map{[0 rgb 0][1 rgb 1]}
    }
    ,.05
   )
  }
}

It makes rectangular masses all over the place. Nest a few of those with 
different translation values, and a cityscape might be possible.

Sam


Post a reply to this message

From: Tek
Subject: Re: Copying pigments with crackle (124k jpg)
Date: 29 Jul 2008 18:55:42
Message: <488f9fee$1@news.povray.org>
"stbenge" <THI### [at] hotmailcom> wrote in message 
news:488f9b5d@news.povray.org...
> Tek wrote:
>> Awesome! I wanted something like that ages ago when I did my procedural 
>> crackle based city. I couldn't figure out how to do it. Now I'm just 
>> trying to understand your code!
>
> It pays off to keep trying. I can't tell you how many times I've tried to 
> get this to work.
>
>> Is there any way to make it work with metric 1?
>
> Yes, you can get some interesting effects. Here, try this out:

Yeah but it distorts the pattern, one of the things that's great about your 
first post is that it duplicates my pattern into every cell, but with metric 
one it breaks it.

> It makes rectangular masses all over the place. Nest a few of those with 
> different translation values, and a cityscape might be possible.

I've already got the city: 
http://news.povray.org/povray.binaries.images/thread/%3C47e997a1%40news.povray.org%3E/?ttop=280683&toff=150
But I really need a perpendicular pattern to the crackle, something like the 
radial example in your original post, but perpendicular to metric 1.
I don't think it's possible though :(

-- 
Tek
http://evilsuperbrain.com


Post a reply to this message

From: Jan Dvorak
Subject: Re: crystal mass (64k jpg)
Date: 29 Jul 2008 19:32:56
Message: <488fa8a8$1@news.povray.org>
stbenge napsal(a):
> Using the code modified to work in three dimensions, I applied a 
> radiating crackle pattern to each cell. The resulting isosurface 
> resembles aragonite.
> 
> Don't mind the really low-quality aa settings. Isosurfaces render very 
> slowly...
> 
> Sam
> 
> ------------------------------------------------------------------------
> 
beautiful. There are a few disconnected speckles but these may be 
difficult to remove.

-- 
the ultimate time-killer:
+a0.0 +am2 +r9

Johnny D


Post a reply to this message

From: stbenge
Subject: Re: crystal mass (64k jpg)
Date: 30 Jul 2008 01:08:35
Message: <488ff753$1@news.povray.org>
Jan Dvorak wrote:
> beautiful. There are a few disconnected speckles but these may be 
> difficult to remove.

Thanks. Yeah, those disconnected parts are always hard to remove.

Sam


Post a reply to this message

From: Thomas de Groot
Subject: Re: crystal mass (64k jpg)
Date: 30 Jul 2008 04:07:33
Message: <48902145@news.povray.org>
"stbenge" <THI### [at] hotmailcom> schreef in bericht 
news:488f9aa2@news.povray.org...
> Using the code modified to work in three dimensions, I applied a
> radiating crackle pattern to each cell. The resulting isosurface
> resembles aragonite.
>

I am speachless, Sam...
I just now realize the potentiality of your code!

Thomas


Post a reply to this message

From: Paolo Gibellini
Subject: Re: crystal mass (64k jpg)
Date: 30 Jul 2008 04:31:22
Message: <489026da$1@news.povray.org>
Ah, Sam!
This is fascinating! It seems carved wood too.
;-)
Paolo

 >stbenge  on date 30/07/2008 00:32 wrote:
> Using the code modified to work in three dimensions, I applied a 
> radiating crackle pattern to each cell. The resulting isosurface 
> resembles aragonite.
> 
> Don't mind the really low-quality aa settings. Isosurfaces render very 
> slowly...
> 
> Sam
> 
> ------------------------------------------------------------------------
>


Post a reply to this message

From: Blue Herring
Subject: Re: crystal mass (64k jpg)
Date: 30 Jul 2008 09:44:32
Message: <48907040$1@news.povray.org>
Fantastic!!

-- 
-The Mildly Infamous Blue Herring


Post a reply to this message

From: Tek
Subject: Re: Copying pigments with crackle (124k jpg)
Date: 30 Jul 2008 14:31:53
Message: <4890b399@news.povray.org>
Here's something I made using Sam's techinique, slightly adapted to allow 
coloured pigments, and some photos I took of the london motorshow.

My version of the  code is *really* inefficient, it took 48 minutes to 
render at 1600x1200!

-- 
Tek
http://evilsuperbrain.com


"stbenge" <THI### [at] hotmailcom> wrote in message 
news:488e5300@news.povray.org...
> Hi everyone,
>
> Years ago, somebody posted a swirly pigment. It resembled the swirls you
> see in clouds sometimes. I have tried looking for the code many times,
> but to no avail. The code has been lost.
>
> Every once in a while I try to recreate that code using pigment
> functions. Every time I've tried, I've failed. Until today.
>
> I based my work on the premise that the target pattern must be
> translated according to another pattern, in this case crackle form x.
> What I have arrived at must be different from the aforementioned
> poster's code, since his tended to have small gray boxes right at the
> center of each crackle cell. There is no such artifact in my code, and I
> can't be sure just how close my effect comes to his.
>
> Here is some code:
>
> #macro pcc(pgmt, Mod)
>  #local pgmt2=function{pigment{pgmt}}
>  #local pg1=
>  function{
>   pigment{
>    crackle form x
>    scale .25
>   }
>  }
>  pigment_pattern{
>   function{
>    pgmt2(
>     (pow(pg1(x+Mod,y,z).grey,2)-pow(pg1(x-Mod,y,z).grey,2))/(Mod*64),
>     (pow(pg1(x,y+Mod,z).grey,2)-pow(pg1(x,y-Mod,z).grey,2))/(Mod*64),
>     z
>    ).grey
>   }
>  }
> #end
>
> #declare my_pigment=
> pigment{
>  pcc(
>   pigment{
>    spiral1 1
>    sine_wave frequency 1
>    scale .125
>   }
>   ,.085
>  )
> }
>
> The macro takes two arguments. The first is the pigment you wish to have
> copied into each crackle cell. The second indicates how sharp you want
> the edges to be. Smaller values = sharper edges. The macro returns a
> pigment_pattern, so it can be used in any pattern block (pigment,
> normal, texture, etc.)
>
> I hope some of you find a use for this. I had hoped to use it for making
> height fields. I'll post any interesting results I might get.
>
> Sam
>


Post a reply to this message


Attachments:
Download 'crackle_paternizedphoto.jpg' (242 KB)

Preview of image 'crackle_paternizedphoto.jpg'
crackle_paternizedphoto.jpg


 

<<< Previous 4 Messages Goto Latest 10 Messages Next 10 Messages >>>

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