POV-Ray : Newsgroups : povray.advanced-users : Direct stochastic tiling Server Time
23 Nov 2024 21:12:35 EST (-0500)
  Direct stochastic tiling (Message 1 to 10 of 26)  
Goto Latest 10 Messages Next 10 Messages >>>
From: Bald Eagle
Subject: Direct stochastic tiling
Date: 20 Sep 2023 22:05:00
Message: <web.650ba428c90fe1dd1f9dae3025979125@news.povray.org>
Following through a long train of papers and references therein, I picked a part
of one that looked "simple" to implement.

The attached is a "Direct stochastic tiling" pattern that assigns any unit
square a random, but calculable Wang tile.  The edge color of any Wang tile
matches the edge of any adjacent Wang tile.

https://graphics.cs.kuleuven.be/publications/LD05PODF/LD05PODF_paper.pdf

Since it's a pattern, it's all functions.

Would you like to not lose your mind trying to figure out why patterns don't do
what you think they're supposed to do?  Especially across the origin?
Stop using mod (), and use the user-defined function:

#declare fmod = function (N, Modulo) {select (N, 1-mod(abs(N), Modulo), mod
(abs(N), Modulo))}

And use that wherever you need x, y, or z in a repeating unit-square pattern.

- BE


Post a reply to this message


Attachments:
Download 'direct stochastic tiling.png' (31 KB)

Preview of image 'direct stochastic tiling.png'
direct stochastic tiling.png


 

From: Bald Eagle
Subject: Re: Direct stochastic tiling
Date: 21 Sep 2023 06:25:00
Message: <web.650c19af5bb87ec31f9dae3025979125@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:

> Would you like to not lose your mind trying to figure out why patterns don't do
> what you think they're supposed to do?

After I posted this, I was looking at the rendered pattern, and noticed that
there was a lot of red, and very very little yellow, and since there's been
commentary on just how improbably it is to get an actual 1 or 0 from the PRNG, I
wondered what the spread of f_noise3d in functions.inc was.

It sucks.

After a few failed attempts to coax the output to cover a greater range, I took
5 noise samples at scales increasing by powers of 10, and did 1+2-3+4-5, and
then folded any out of range results back in with 2 nested select () functions.
That seemed to give a much more uniformly distributed random result, and a much
more varied coloration to the pattern.

- BE


Post a reply to this message


Attachments:
Download 'direct stochastic tiling.png' (93 KB)

Preview of image 'direct stochastic tiling.png'
direct stochastic tiling.png


 

From: Bald Eagle
Subject: Re: Direct stochastic tiling
Date: 21 Sep 2023 06:30:00
Message: <web.650c1a905bb87ec31f9dae3025979125@news.povray.org>
Also, here's a zoomed-in version, with thicker borders, and some rgb 0 cylinders
to separate the unit squares so that the tile structure is a lot more evident.

Not sure I'm looking forward to the Poisson disk part of this....


Post a reply to this message


Attachments:
Download 'direct stochastic tiling.png' (50 KB)

Preview of image 'direct stochastic tiling.png'
direct stochastic tiling.png


 

From: ingo
Subject: Re: Direct stochastic tiling
Date: 21 Sep 2023 08:40:00
Message: <web.650c39405bb87ec317bac71e8ffb8ce3@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:

> Not sure I'm looking forward to the Poisson disk part of this....

There is a poisson distribution in rand.inc, if it helps.

ingo


Post a reply to this message

From: Bald Eagle
Subject: Re: Direct stochastic tiling
Date: 21 Sep 2023 20:40:00
Message: <web.650ce1c85bb87ec31f9dae3025979125@news.povray.org>
"ingo" <nomail@nomail> wrote:
> "Bald Eagle" <cre### [at] netscapenet> wrote:
>
> > Not sure I'm looking forward to the Poisson disk part of this....
>
> There is a poisson distribution in rand.inc, if it helps.
>
> ingo

Thanks, but I went over that several times, and can't for the life of me figure
out what that does or how to implement / visualize it.  I think that somehow
that's a "different" Poisson distribution.

"The number of point in an area A is Poisson-distributed with mean equal to the
area times the density. For this reason, the distribution is often called a
Poisson distribution.  This unfortunate terminology should not be confused with
the univariate discrete Poisson distribution."
http://www.dgp.toronto.edu/~elf/.misc/poissondisk.pdf (bottom of pg 3)


I think that basically what I need is:

https://www.youtube.com/watch?v=flQgnCUxHlw
https://editor.p5js.org/codingtrain/sketches/4N78DFCXN

https://www.youtube.com/watch?v=7WcmyxyFO7o
https://github.com/SebLague/Poisson-Disc-Sampling/tree/master/Poisson%20Disc%20Sampling%20E01

I have coded the first one, but it doesn't work, because I probably messed up my
push/splice macros, and I have to work out the array indices, because those are
going awry as always.   :/

These "computer science" papers are all shit - since there's no code, and
therefore no way to verify/reproduce their work.  As a chemist, I had to give a
full, detailed experimental procedure, plus physical characteristics, spectral
data, etc.

"Find the center of gravity of the Voronoi region...."
Oh yeah, buddy.   Go cut down the tallest tree in the forest with .... A
HERRING!

- BW


Post a reply to this message


Attachments:
Download 'poisson-disc sampling.pov.txt' (5 KB)

From: ingo
Subject: Re: Direct stochastic tiling
Date: 22 Sep 2023 01:35:00
Message: <web.650d264f5bb87ec317bac71e8ffb8ce3@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:

> These "computer science" papers are all shit

Have you tried a search engine lately? Top 20 lists ... Stupid AI's ....

ingo <ducks and hides>


Post a reply to this message

From: Bald Eagle
Subject: Re: Direct stochastic tiling
Date: 22 Sep 2023 06:30:00
Message: <web.650d6c005bb87ec31f9dae3025979125@news.povray.org>
"ingo" <nomail@nomail> wrote:
> "Bald Eagle" <cre### [at] netscapenet> wrote:
>
> > These "computer science" papers are all shit
>
> Have you tried a search engine lately? Top 20 lists ... Stupid AI's ....
>
> ingo <ducks and hides>

Yeah - they're all changing - for the worst.
https://www.youtube.com/watch?v=48AOOynnmqU

I used to used duck duck go for a bit - until they sold out.
Then I switched primarily to Brave, but they stopped having useful search
results.
I find myself using Yandex a lot.

It's painful to have lived through "the golden age of the internet" and know
that all that stuff is out there  ---- somewhere.

The other thing that I find strange is that I'll get a list of search results,
and when I click on one of the top ones, the site is nonexistent.  So then
what's the result doing in the list?  How do I have an image thumbnail that goes
along with it, but can't get anywhere to see the image???


It's getting really weird.


Post a reply to this message

From: kurtz le pirate
Subject: Re: Direct stochastic tiling
Date: 22 Sep 2023 11:25:49
Message: <650db1fd@news.povray.org>
On 22/09/2023 02:37, Bald Eagle wrote:

> I have coded the first one, but it doesn't work, because I probably messed up my
> push/splice macros, and I have to work out the array indices, because those are
> going awry as always.   :/

maybe this inc file can help you?





-- 
Kurtz le pirate
Compagnie de la Banquise


Post a reply to this message


Attachments:
Download 'utf-8' (7 KB)

From: Bald Eagle
Subject: Re: Direct stochastic tiling
Date: 22 Sep 2023 14:05:00
Message: <web.650dd70d5bb87ec31f9dae3025979125@news.povray.org>
kurtz le pirate <kur### [at] gmailcom> wrote:

> maybe this inc file can help you?

Yes Sir, that would probably help me avoid debugging THAT part, and see what
else I've buggered up.

Thanks - that's very nice little collection of very useful macros!   :)


- BW


Post a reply to this message

From: Bald Eagle
Subject: Re: Direct stochastic tiling
Date: 22 Sep 2023 19:35:00
Message: <web.650e23985bb87ec31f9dae3025979125@news.povray.org>
kurtz le pirate <kur### [at] gmailcom> wrote:

> maybe this inc file can help you?

One thing that I did notice is that I'm splicing out array entries until I have
an empty array.

That was triggering an invalid array size error, which I fixed / worked around
by doing:

#if (newSize <= 0)
  #local tmpArray = array;
 #else
  #local tmpArray = array[newSize]
 #end

and

#if (newSize <= 0)
  #declare thisArray = array;
 #else
  #declare thisArray = array[newSize]
 #end


Maybe do some further testing and see what you think, then update that last
macro.

- BW


Post a reply to this message

Goto Latest 10 Messages Next 10 Messages >>>

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