Welcome to Fractal Forums

Fractal Math, Chaos Theory & Research => (new) Theories & Research => Topic started by: Kali on November 27, 2012, 03:38:22 AM




Title: Dynamic Fractal Waves
Post by: Kali on November 27, 2012, 03:38:22 AM
I've been playing lately with the "dynamic fractal" concept first introduced by Tglad here at the forum, and I had the idea of applying this to sine waves used as displacement maps in distance estimated objects.

I had this Fragmentarium script I made some time ago, with a classic interference pattern between two wave generators:

https://dl.dropbox.com/s/tbu2jtscqkjmq2o/simplewaves.swf


So I made some experiments based on this, but iterating the sin function and scaling frequency, amplitude, and propagation speed at each iteration.

This are the results so far:


POLES IN WATER

https://dl.dropbox.com/s/awvyogjlhk01t83/polesinwater.swf


SLIME SEA

https://dl.dropbox.com/s/tdw1xl2lz7wg8b4/slimesea.swf


I used four wave generators in this one. It made me think of my attempt at the classic non-newtonian fluid experiment I made some years ago and uploaded to Youtube ;D :

http://www.youtube.com/watch?v=Hgd9Be7P3w4&feature=channel&list=UL


CHARLIE'S FACTORY

https://dl.dropbox.com/s/x3bq8a20qesypog/chocofactory.swf

Is fake, but it really looks like a falling flow of liquid chocolate ;D. I used a torus on the waving plane with a cylinder inside, four wave generators placed at the torus border, and a central one...  I guess the faster moving waves on top of the slower ones simulates a laminar flow or something.


Then I tried with 3D waves, using radial space displacements. With the generators aligned on the 2D plane (at the same heigth), an interesting effect occurred:


SWAMP BUBBLES

https://dl.dropbox.com/s/341lfphmecmcqdx/bubbles.swf



And the last one, using a 3D object:


LIQUID SPHERE

https://dl.dropbox.com/s/gbg7ndhs7onqnid/spherewave.swf


I only used basic shapes for better showing the waves alone, but this can be used on any shape including fractals (I've already implemented a waving effect in some of the fractal animations I posted, but it was using simple sinewaves)

I'll be doing further research on this technique, and also I want to implement transparency/refraction for a better water effect (and making a perfect habitat for my underwater fractal creatures  ;D)

Any comments appreciated.



Title: Re: Dynamic Fractal Waves
Post by: hobold on November 27, 2012, 06:49:14 AM
There is a technique for generating fractal terrain that uses superposition of sine waves. It is called "spectral synthesis". I cannot easily find a good reference on the web. The method is described in "The Science of Fractal Images", edited by Peitgen & Saupe. Maybe you can find that book in a library. (I am unsure if I should recommend buying the book. It's good, but partly outdated by now.)


Title: Re: Dynamic Fractal Waves
Post by: KRAFTWERK on November 27, 2012, 09:12:04 AM
You are about to create a new world Kali... Be careful, remember Frankenstein...:devil:

Great animations, and I love your experiment with non-newtonian fluid, it looks so alive.  O0


Title: Re: Dynamic Fractal Waves
Post by: Tglad on November 27, 2012, 10:32:27 AM
Great work Kali, some high end ocean simulators use something similar  http://graphics.ucsd.edu/courses/rendering/2005/jdewall/tessendorf.pdf
Real oceans have been analysed and can be approximated by 'Phillip's spectrum' which defines how high the waves are for each wave length.
The paper then describes how you turn that spectrum into a set of sine waves at different frequencies, superimposed.

The dynamic fractal concept is probably a linear approximation of this spectrum. Though I think all waves should move at the same absolute speed for a proper 'conformal' dynamic fractal.

You can make simple waves (sine waves) into choppy waves by putting the horizontal position of each point also on a sine wave in the direction that the wave is travelling in.


Title: Re: Dynamic Fractal Waves
Post by: DarkBeam on November 27, 2012, 11:21:15 AM
 :o :smileysmileys: sooo freaking cool


Title: Re: Dynamic Fractal Waves
Post by: cKleinhuis on November 27, 2012, 11:26:40 AM
yeah some more to try out for the realtime section,
the poles in water look extraordinary real, and the fake chocolate as well has something, especially regarding the super low calculation time for this effect,
very nice to be used in games ....

so, you little crazy never stopping gpu coder implemented just the idea of tglad with the fractal animation ... awesome, is it true this has not been researched the slightes before ?!?!

awesome!!!


Title: Re: Dynamic Fractal Waves
Post by: cKleinhuis on November 27, 2012, 11:30:12 AM
be sure to include the global illumintation code for out of the box caustics when playing with the water rendering :D


Title: Re: Dynamic Fractal Waves
Post by: eiffie on November 27, 2012, 05:55:45 PM
There is a technique for generating fractal terrain that uses superposition of sine waves. It is called "spectral synthesis". I cannot easily find a good reference on the web. The method is described in "The Science of Fractal Images", edited by Peitgen & Saupe. Maybe you can find that book in a library. (I am unsure if I should recommend buying the book. It's good, but partly outdated by now.)

I didn't know it had a name! I had found the same trick and used it to make terrain, waves and clouds here:
http://www.fractalforums.com/landscapeterrain-generation/simple-non-standard-approaches/ (http://www.fractalforums.com/landscapeterrain-generation/simple-non-standard-approaches/)


Title: Re: Dynamic Fractal Waves
Post by: Kali on November 27, 2012, 06:39:15 PM
First, thanks to all for the nice comments, and interesting/useful info.

@Tom: I tried with uniform speed, but it worked best for me when I scaled the speed twice: Speed*=(Scale*Scale). I'll post some examples later to compare.

@Johan: ;D - There's nothing to worry about, except of my own mental sanity  :headbatting:

@Chris: Yes, next step is to implement that awesome renderer, if eiffie allows me to use his code  :D

@Hobold: Thanks, I'll try to find it, but it seems the same eiffie already did, and he also shared the code... :spork:  

@eiffie: Awesome stuff as usual, thanks for sharing (I didn't see it before).

@Luca: Not as cool as you  :-*

@Kali: IT'S YOUR SON'S BIRTHDAY, GET OUT OF THE COMPUTER!!!


Title: Re: Dynamic Fractal Waves
Post by: Syntopia on November 27, 2012, 10:11:12 PM
Great stuff, Kali - you really should try it with Eiffies new refractive GI shader.


Title: Re: Dynamic Fractal Waves
Post by: Kali on November 28, 2012, 04:29:59 AM
Great stuff, Kali - you really should try it with Eiffies new refractive GI shader.

Thanks Mikael. I tried it, but my results are very noisy, I don't know if something is wrong or I must wait way a lot of subframes to render in order to get good results? if so, too slow for my patience  ;D - also animation on progressive renderers is not working for me, or I don't know how to do it. Too bad because that GI looks so good  :sad1:

But at least I managed to implement transparency/refraction on the good old "DE-Raytracer-v0.9.1". This renders pretty fast in realtime:


https://dl.dropbox.com/s/1dv58nty54qxifp/transparency_001.swf


I will share the script but first I must fix some minor issues.

Also I want to make the caustics, but I don't fully understand how it works yet...




Title: Re: Dynamic Fractal Waves
Post by: eiffie on November 28, 2012, 06:43:21 PM
I only had patience for a fast render too :)
http://youtu.be/uQ-yuK3vaH8

To get good caustics you need global illum (to pull in extra light rays) but you can fake it by counting the marching steps it takes to get thru the water's surface. If it doesn't take many steps lighten the object underneath. Of course I only thought of that AFTER I rendered. I had never placed one DE inside another - tricky! lol

But why isn't the octopus under there??


Title: Re: Dynamic Fractal Waves
Post by: Kali on November 28, 2012, 09:46:58 PM
Nice video, eiffie!

I'll give a try at that cheap caustics, thanks.

The octopus is waiting for me to find a way to put him INTO the water. Yeah, tricky stuff indeed...


Title: Re: Dynamic Fractal Waves
Post by: Syntopia on November 29, 2012, 10:00:09 PM
Thanks Mikael. I tried it, but my results are very noisy, I don't know if something is wrong or I must wait way a lot of subframes to render in order to get good results? if so, too slow for my patience  ;D - also animation on progressive renderers is not working for me, or I don't know how to do it. Too bad because that GI looks so good  :sad1:

Yep, GI is quite slow :-) As for the animation on progressive renders it should work after the latest fix - did you use the latest experimental binary in from the Non-DE thread? Otherwise please send me the code, and I'll take a look.


Title: Re: Dynamic Fractal Waves
Post by: eiffie on November 30, 2012, 05:31:17 PM
I should have explained the fake caustics would be calculated on the number of SHADOW ray march steps. Not the primary ray. I did a version with the GI script with only 32 subframes for the water rendering and it looks pretty good:
http://www.youtube.com/watch?feature=player_detailpage&v=CuHn9HdQQHE

I feel a little guilty about calling this GI since it doesn't really pull in that much light globally. More like "probabilty based path tracing". GI is just easier to say.


Title: Re: Dynamic Fractal Waves
Post by: Kali on December 02, 2012, 08:40:47 PM
Nice video eiffie! thanks for including the reference to my thread.

I had never placed one DE inside another - tricky! lol

Ok, here it is:

https://dl.dropbox.com/s/lehdwz95aneujab/poo_002.swf

Finally I did it this way:

Code:
de = min(max(waterde, -objectde), objectde);

It turned to be quite easy, but I had the problem of the underwater object colored like the water, to avoid this I checked the difference between objectde and waterde, and if it's smaller than a given treshold (0.01 worked fine), it uses the object's coloring and off course stops tracing if the ray is inside the water and collides with an opaque object.

But why isn't the octopus under there??

Sorry for the floating fractal poo :rotfl: -  I'll put the octopus next time, I promise!

I still have to work on the shadow tracing to finish this mod of Syntopia's tracer. Also the fog is not working properly because of the ray bounces, I must replace it with another algorithm.

Btw, did you use some similar approach to the "de inside a de" problem?




Title: Re: Dynamic Fractal Waves
Post by: knighty on December 02, 2012, 09:02:13 PM
Nice! :thumbsup1:


Title: Re: Dynamic Fractal Waves
Post by: cKleinhuis on December 02, 2012, 09:04:08 PM
really nice, although this water does not get reflected on the border, i like the general flow of the water knowing that it is the most cheapest water algorithm i know so far!!!

perhaps making an infinite plane :D and with caustics ???

you know, object fluid interaction is always hard to reach, and this is a real nice impression, i would love the demo scene would make use of it, but i am going to have a message for the demo scene in my next gallery episode :) i want them that they greet us for giving them the algorithms, or credit us :D


Title: Re: Dynamic Fractal Waves
Post by: Kali on December 02, 2012, 09:31:41 PM
Thanks knighty and Chris!

really nice, although this water does not get reflected on the border, i like the general flow of the water knowing that it is the most cheapest water algorithm i know so far!!!

You mean the reflected waves? I was thinking on how to do it... I guess is a bit difficult on pure GPU without using a buffer, but being a cheap algorithm, maybe it can be done by "wave tracing"... i.e. recreating the waves evolution from the starting state to the current frame state. It will get slower as time passes, but who knows...
Another approach is to fake it with waves generators at the borders, synced to the arrival of the incident waves, but only practicable on very simple scenes.


Title: Re: Dynamic Fractal Waves
Post by: cKleinhuis on December 02, 2012, 10:33:48 PM
yes for sure, but since it is purely deterministic, it is basicall just an offset from the starting wave in the middle ;)
but surely 4 initiators would make it more complex, but this is the "ahaaaaaaaaaaaaaa" effect that some people really like