warp/displace blendshader for density fractal for a cloud *update 2 - done*

Started by Goms, March 18, 2009, 08:17:51 AM

Previous topic - Next topic

Goms

Hi everybody,

after hours of trying and experimenting, i must admit that i need help.  ;D
I want to create a geyser from some shaders and a cloud.
The basic idea is to use the 3D function of the painted shader and geyser-like displaced terrain to create the basic form.
The displacement is function-based and creates a really great form; as a displacement. Also as a cloud for the form.
But now the structure is the problem. What i would need is something, that warps my cloud density fractal "away" from a given central point.
As a displacement this works, but however i try, the warp shader, redirect shader, displacement shader etc. do not work for colors. not even if i use another shader to create a terrain before i warp/displace/redirect it. But it will look unrealistic, if i only use the noise stretch function. then the fractal is only stretched in one direction.
Here is a picture of what i got until now (its quality is sub-optimal, in higher detail the lower cloud would look more shaped): http://img18.imageshack.us/img18/4500/73452841.png
The higher cloud should be the water jet later, the lower one the water that splashes around and steam.
And this is what i want: http://people.debian.org/~tille/debian-background/1600x1200/geysir.jpg
The shape is unimportant for now, the first thing for me is the structure.
Anybody a good idea? :)

*update*

Ok, so far i got what i needed. Nikita was able to solve the core-problem. :)
Its not perfect yet, but maybe in a few days i can show a nice geyser: http://img27.imageshack.us/img27/556/gesey.png

*update 2*

Ok, i think i'm satisfied now. :)
This last image shows the final geyser without anything, but maybe i'll use it for a picture.
It's made of 7 individual cloud layers, but i can imagine to cut it down to 4 with some more work.
Every cloud layer has quality 1 with no acceleration, the samples are between 47 and 303.
Render Detail was 0.9 with 6 AA (Catmull-Rom sharp) and GI 2 1 with supersample prepass, no ray traced shadows.
It took my Intel Core 2 Quad Q9300 with 2.5GHz and 4GB Ram on Vista Home Premium 64-Bit 55 minutes to render this in 600*800, which is quite fast for these quality; in my opinion.
If there is much demand for a (short) how-to, i can write something (maybe). :)
Quote from: FrankB
you're never going to finish this image ;-)

Mohawk20

Whoa, that's looking great!

That must be a LOT of work and a LOT of nodes...!
Howgh!

Goms

thank you, but to be honest it was not really that hard.
the most difficult part was the warping of the cloud fractal. and this needs only 7 nodes beside the cloud shader.
this picture shows 3 clouds. one is the highest, one the middle and one the lower part.
in all there are 18 shaders and function nodes, but until now its not optimized. i think i could use 3 shaders less or something in that range.
after nikita gave his input, the rest was nothing more than combining a few shaders. ;)
right now i'm working on picture with this, so maybe i gonna show a more realistic scene later.
Quote from: FrankB
you're never going to finish this image ;-)

rcallicotte

So this is Disney World.  Can we live here?

cyphyr

Looking very good, love to see your node structure :)
richard
www.richardfraservfx.com
https://www.facebook.com/RichardFraserVFX/
/|\

Ryzen 9 5950X OC@4Ghz, 64Gb (TG4 benchmark 4:13)

Goms

update! the structure is still not perfect, and also the terrain is of course only scratch.
Motivation is getting smaller.  ;D
Quote from: FrankB
you're never going to finish this image ;-)

Mohawk20

I would really want to see your nodes, or even a clip file. This can be used for so much different scenes, like explosions and stuff...
Howgh!

Goms

well, the key-idea is from Nikita, so i should ask him first. ;)
Quote from: FrankB
you're never going to finish this image ;-)

Goms

ok, here we go:

the basic idea was to warp a power fractal away from the center.
as the warp shader seems to warp somehow along the slope of the displacement of the shader plugged to the warper-input, i needed a function which creates an ongoing slope around the central point (maybe the easiest picture to imagine this is a screw).
nikita came up with the following idea:
a get position node leads to a x to scalar node which will be divided witch get position again.
this fraction (x/get position) can be used to create an angle with the arcsin node.
when this is used as function for a displacement shader, this can be plugged into the warper-input. :)
The rest is basically just an image map and a merge shader.

Quote from: FrankB
you're never going to finish this image ;-)

nikita

My guess is that the warper works in the following way:
The normal of the displacement specifies the direction of the warping and the amount of displacement (basically, the height) corresponds to the distance of the warping. With that direction and distance, you get a certain position.
I don't know the details but I think it basically looks up what the shader looks like at this position and uses this as output.
This way the fractal will be squeezed where the displacement has a (high) gradient and stretched where there's a hill or valley. It's somewhat counterintuitive but it is fast, easy to code and sufficient for most cases.

In this case I calculated the angle. the idea is that the angle a point has relative to the center, gets larger and larger, causing a gradient with the desired direction.

By the way.. if you're reading this Matt, a function node to calculate the angle (in [0, 2pi]) of a point relative to the origin (0,0,0) would be nice. The arc* functions don't really do that unless you surround them with a lot of extra nodes. Maybe one for each of the three planes.

cyphyr

VERY interesting and potentially useful, thanks for the info and screeny :)
By the way will this work at any point on the planet or are we limited to the origin (0,0,0) ?
richard
www.richardfraservfx.com
https://www.facebook.com/RichardFraserVFX/
/|\

Ryzen 9 5950X OC@4Ghz, 64Gb (TG4 benchmark 4:13)

nikita

You can create a constant vector for the position you want and then subtract it from the output of the get position node.

Goms

@nikita: damn, 2 minutes faster than me :P

it could be very interesting if theres a possibility to create more than one 0;0;0 in order to create more than one geyser...

edit:
yes, it is. :D
http://img12.imageshack.us/img12/4452/clipboard02ndv.jpg
Quote from: FrankB
you're never going to finish this image ;-)

Mohawk20

Darn...
I feel stupid when people start talking about functions, because I can't get my head around it.
I guess it's because I'm a visual thinker, I like to see what I do, not extrapolate abstract concepts.


So thanks for the node views and stuff, maybe one day I can make a function tree of my own that actually does something!
Howgh!

rcallicotte

Functions are sorta abstract.  I agree.  This is nice, too.  Thanks.
So this is Disney World.  Can we live here?