POV-Ray : Newsgroups : povray.beta-test : v3.8+ crackle instability (facets?) with >1 uses per thread. Server Time
27 Dec 2024 13:48:35 EST (-0500)
  v3.8+ crackle instability (facets?) with >1 uses per thread. (Message 19 to 28 of 28)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Bald Eagle
Subject: Re: v3.8+ crackle instability (facets?) with >1 uses per thread.
Date: 7 Nov 2024 09:15:00
Message: <web.672ccaac18b34e673bc22bca25979125@news.povray.org>
William F Pokorny <ano### [at] anonymousorg> wrote:

> With this I think the code is the best answer. In my re-write, I
> flattened the code so there is little (no?) jumping around in the
> overall code base required to see what is going on. Last time I counted,
> yuqk's crackle was roughly 400 lines of code or so. See:
>
> CracklePattern::EvaluateRaw() in source/core/material/pattern.cpp

Excellent.
Thanks - I hope I get the opportunity to download that and spend some
uninterrupted time reading and understanding it.

So much to do!


Post a reply to this message

From: Bald Eagle
Subject: Re: v3.8+ crackle instability (facets?) with >1 uses per thread.
Date: 11 Nov 2024 10:50:00
Message: <web.6732268f18b34e67a911b6e125979125@news.povray.org>
William F Pokorny <ano### [at] anonymousorg> wrote:

> With this I think the code is the best answer. In my re-write, I
> flattened the code so there is little (no?) jumping around in the
> overall code base required to see what is going on. Last time I counted,
> yuqk's crackle was roughly 400 lines of code or so. See:
>
> CracklePattern::EvaluateRaw() in source/core/material/pattern.cpp


It's probably going to take me a bit of time to translate from c++ to something
I can more easily follow.

However, let me offer the following for your consideration:
(inspired by recent scenes, and some long-standing & recurring challenges, plus
you comment: "// TODO. Idea here is maybe return largest fitting spheres, etc...
")

The Appolonian Gasket code returns the largest fitting circles, and in 3D - the
largest fitting spheres.
Perhaps if "crackle" were to be approached from the standpoint of Voronoi and
Appolonian sharing common ground, then the triangles or tetrahedra containing
the inscribed circles or spheres would be more easily generated, and we could
get both for (a little more than) the price of one?

This would be the/a solution to the long-desired ability to pack a region with
non-overlapping circles/spheres.

A similar and directly related pattern would be the Malfatti circles.

Do we presently have the capability to simply "draw the outline" of the Voronoi
cells?

Do we have any idea what would be required to be able to generate the Dual
pattern - the Delaunay triangulation?

- BW


Post a reply to this message

From: Bald Eagle
Subject: Re: v3.8+ crackle instability (facets?) with >1 uses per thread.
Date: 11 Nov 2024 15:35:00
Message: <web.6732695418b34e67a911b6e125979125@news.povray.org>
Relevant search results and further reading:

Stephane Laurent (stla)
https://github.com/stla/Apollonius

Inigo Quilez
https://www.shadertoy.com/view/4sd3D7

Voronoi Diagram Research Center
http://voronoi.hanyang.ac.kr/c3_voronoiDiagrams.htm

Need to further look into:
Johnson-Mehl tessellation


Post a reply to this message

From: William F Pokorny
Subject: Re: v3.8+ crackle instability (facets?) with >1 uses per thread.
Date: 12 Nov 2024 03:17:16
Message: <67330f0c$1@news.povray.org>
On 11/11/24 15:30, Bald Eagle wrote:
> Relevant search results and further reading:
> 
> Stephane Laurent (stla)
> https://github.com/stla/Apollonius
> 
> Inigo Quilez
> https://www.shadertoy.com/view/4sd3D7
> 
> Voronoi Diagram Research Center
> http://voronoi.hanyang.ac.kr/c3_voronoiDiagrams.htm
> 
> Need to further look into:
> Johnson-Mehl tessellation
> 

Thanks for the references. IIRC shadertoy has a distance method to draw 
the outline of cells, but I don't recalled the particulars at the 
moment. I have ideas for how to do it in C++, but I also wonder if in 
yuqk it cannot already 'mostly' be done. Stuff like this why I added the 
ip_raw_return as a yuqk crackle option. Maybe I'll take a 'crack' at it 
in a bit.

I see a path to something like a the Delaunay dual for which performance 
might be acceptable, but due the current limits to the three closest 
measures it would be limited / degenerate in a strict sense.

As for other extensions, some might be worth a try.

With a lot of this voronoi like stuff, 2d is a lot easier than three. 
General, solid 3D solutions likely requires stand alone dedicated code. 
We are working under the constraint that we want a reasonably performant 
pattern in the end - as you know :-).

Bill P.


Post a reply to this message

From: Bald Eagle
Subject: Re: v3.8+ crackle instability (facets?) with >1 uses per thread.
Date: 12 Nov 2024 09:20:00
Message: <web.673362f118b34e6725b4de9225979125@news.povray.org>
William F Pokorny <ano### [at] anonymousorg> wrote:

> IIRC shadertoy has a distance method to draw
> the outline of cells, but I don't recalled the particulars at the
> moment. I have ideas for how to do it in C++, but I also wonder if in
> yuqk it cannot already 'mostly' be done. Stuff like this why I added the
> ip_raw_return as a yuqk crackle option. Maybe I'll take a 'crack' at it
> in a bit.

Perhaps you are thinking of this article:
https://iquilezles.org/articles/voronoilines/

> I see a path to something like a the Delaunay dual for which performance
> might be acceptable, but due the current limits to the three closest
> measures it would be limited / degenerate in a strict sense.

I'm not sure where we are with libraries, but I'm pretty sure CGAL has all of
this stuff, plus a bewildering pile more.


> With a lot of this voronoi like stuff, 2d is a lot easier than three.
> General, solid 3D solutions likely requires stand alone dedicated code.
> We are working under the constraint that we want a reasonably performant
> pattern in the end - as you know :-).

Maybe?
I don't really know that that's true, if we exclude the fancy stuff.
A dirt-simple min (distance-of-pixel-from-all-seeds) ought to work just as well
in 3D as it does in 2.
I'll bet that visualizing that with a black-to-clear gradient or media would be
a quick and easy test.

- BW


Post a reply to this message

From: William F Pokorny
Subject: Re: v3.8+ crackle instability (facets?) with >1 uses per thread.
Date: 17 Nov 2024 06:51:35
Message: <6739d8c7$1@news.povray.org>
On 11/12/24 03:17, William F Pokorny wrote:
> Thanks for the references. IIRC shadertoy has a distance method to draw 
> the outline of cells, but I don't recalled the particulars at the 
> moment. I have ideas for how to do it in C++, but I also wonder if in 
> yuqk it cannot already 'mostly' be done. Stuff like this why I added the 
> ip_raw_return as a yuqk crackle option. Maybe I'll take a 'crack' at it 
> in a bit.

I didn't spend much time on it, but the top of the attached image shows 
outlines as a pigment just slightly red (negative) by allowing raw value 
returns after changing ip_form to: 'ip_form <-0.1,0.08,0> - the default 
is <-1,1,0>.

The bottom of the image is an isosurface where a cylindrical shell is 
intersected with a similar crackle pattern in space. No attempt wrap the 
cylinder - just punching out a thin part of the crackle cell outlines.

The isosurface functions are:

// yuqk required
#declare Fn00 = function (x,y,z) {
     f_planar(f_cylinder(x,y,z,0.9),0.01,1)
}
#declare FnCrk = function {
     pattern {
         crackle
         ip_form <-0.1,0.097,0>
         ip_strength <0.25,0.25,0.25>
         ip_raw_return
         raw_wave
         translate <0,0,0.25>
         scale 1/5
     }
}
#declare Fn01 = function (x,y,z) { max(Fn00(x,y,z),FnCrk(x,y,z)) }

Yes, The outline / cell-walls vary some due differences in gradients - 
but more due how the slices catch the cell wall. For practical purposes, 
expect an approach like this often OK for cell outlines.

Bill P.


Post a reply to this message


Attachments:
Download 'be_crk.jpg' (124 KB)

Preview of image 'be_crk.jpg'
be_crk.jpg


 

From: William F Pokorny
Subject: Re: v3.8+ crackle instability (facets?) with >1 uses per thread.
Date: 17 Nov 2024 07:53:18
Message: <6739e73e$1@news.povray.org>
On 11/17/24 06:51, William F Pokorny wrote:
> No attempt wrap the cylinder - just punching out a thin part of the 
> crackle cell outlines.

Got some coffee in me and gave the cylindrical warp a go. The crackle 
function becomes:

#declare FnCrk = function {
     pattern {
         crackle
         ip_form <-0.1,0.080,0>
         ip_strength <0.25,0.25,0.25>
         ip_repeat <5,0,0>
         ip_raw_return
         raw_wave
         scale 1/5
         scale <1/5,1,1>
         warp { cylindrical }
     }
}

(And I fattened up the cell walls for a better gradient)

Aside: I think there is a slight stretch in the wrap because the warp{} 
mapping warps often seems to want radian measures - 'scale <1/tau,1,1>' 
for best geometric mapping.

Anyhow. Image attached.

Bill P.


Post a reply to this message


Attachments:
Download 'tmpiso_wrp.png' (178 KB)

Preview of image 'tmpiso_wrp.png'
tmpiso_wrp.png


 

From: William F Pokorny
Subject: Re: v3.8+ crackle instability (facets?) with >1 uses per thread.
Date: 17 Nov 2024 18:13:28
Message: <673a7898@news.povray.org>
On 11/17/24 07:53, William F Pokorny wrote:
> Got some coffee in me and gave the cylindrical warp a go.

While playing, created attached images. The right one by accident...

Last part of the function { pattern {crackle ...} } used was:

         warp {
             it_amount <1/3,1/3,1/3>
             it_omega 0.87 it_lambda 4.7 it_scale 1/5
         }
         scale <1/6,1,1>
         warp { cylindrical }
         warp { spherical }    // Oops

Aiming again for shapes that are not really shapes in a usual way. 
Suppose yesbird's recent gravity toy post in the same vein.

The isosurface gradient set low (1.3), accuracy really rough at 0.05, 
but with isosurface jitter (jittering within accuracy range) on - and 
aggressive AA (antialias_min_depth=2 +r4) sampling. yuqk only features 
are involved.

Bill P.


Post a reply to this message


Attachments:
Download 'morecracks.jpg' (251 KB)

Preview of image 'morecracks.jpg'
morecracks.jpg


 

From: Bald Eagle
Subject: Re: v3.8+ crackle instability (facets?) with >1 uses per thread.
Date: 17 Nov 2024 21:55:00
Message: <web.673aabfc18b34e671f9dae3025979125@news.povray.org>
William F Pokorny <ano### [at] anonymousorg> wrote:
> On 11/17/24 06:51, William F Pokorny wrote:
> > No attempt wrap the cylinder - just punching out a thin part of the
> > crackle cell outlines.

Huh.  And what happens if you do the same sort of thing with something like the
Stanford bunny?

- BW


Post a reply to this message

From: William F Pokorny
Subject: Re: v3.8+ crackle instability (facets?) with >1 uses per thread.
Date: 18 Nov 2024 06:51:54
Message: <673b2a5a@news.povray.org>
On 11/17/24 21:52, Bald Eagle wrote:
> William F Pokorny <ano### [at] anonymousorg> wrote:
>> On 11/17/24 06:51, William F Pokorny wrote:
>>> No attempt wrap the cylinder - just punching out a thin part of the
>>> crackle cell outlines.
> 
> Huh.  And what happens if you do the same sort of thing with something like the
> Stanford bunny?
> 

If the aim is seeing the outlines rather than creating an isosurface 
shape from them, the quick thing would be to create a pigment from the 
crackle pattern set up to show outlines - the parts of the pattern not 
outlines would be set transparent. Ignoring that we can define an inside 
vector for a well formed / closed mesh, a mesh surface is already 
infinitely thin for the purposes of sampling.

If you want to play with isosurfaces based upon a mesh, one of the 
techniques to turn them into value fields would be the up front 
approach. There are a couple SDL only ones. A method I posted in the mid 
to late 2000s and one Sam B posted in the early 2010s. The yuqk fork has 
hard_object{} and soft_object{} inbuilt features for turning shapes into 
value fields / patterns.

The recent filling a shape with random noise approach might work for a 
noisier result. There is too a way to pre-sample a shapes interior 
saving the result as a df3 file which can then be used as a value 
pattern suitable for an isosurface.

A straight intersection with a mesh having a clean inside region or any 
object with an defined inside is an option too. The gradients will be 
bad and the result, visually, less interesting as the outer layer of 
cell outlines will hide everything to the interior.

Bill P.

Aside: I've wondered some what an intersection of two crackle value 
pattern intersected might look like - where one crackle changes ip_seed, 
is rotated or scaled differently such that the cells walls intersect 
sparsely.

With the ip_strength option set up asymmetrically we might also be able 
to define certain patterns or shapes. One crackle ip_repeat, repeating 
differently than the other where both have identical ip_seed, seeds...


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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