Jump to content

Athmosphere/Fog reacting to other Objects


puma.snyder

Recommended Posts

I have a simple scene, a tube like geometry and a sphere (with some tentacles) passing through the tube.

I would like to add some fog/noise which moves very subtle by itself, but gets pushed away when the big

sphere passes by.

What is the best way to set this up and how to render it most efficiently?

Thanks

Achim

Link to comment
Share on other sites

Hi Achim,

Ask an easy question, get lots of answers, see? :P

Not simple, this.

The "proper" way would require you to model the fluid (a "gas" in this case), and... well; who needs accuracy? this is CG ferchrissakes! :)

Probably the first thing I would try would be filling the space with lots of particles (or multiple groups that get assigned different behaviours), animating them to give a convincing sliding-displacement in front of the sphere, and a believable turbulent "wake" behind it. Then I would likely relegate the rest of the trickery to shading.

It's not like we're talking about water or some other dense medium here, so you *should* be able to get away with a hack.

Have you already tried something like this?

Cheers!

Link to comment
Share on other sites

Hi Mario,

Yes I tried something like that, for now I birth particles (from volume) inside the tube, and used turbulence and interact pops. Then I render this as sprites with a noise pattern. While it generally works, the turbulance caused by the main sphere passing by is not yet believable.

I am not sure how to achieve this turbulence, maybe some metaballs copied around the main sphere?

In general, how many particles are roughtly needed for this, 100s, 1000s or even more?

And is it better to have big sprites with detailed noise on it or more smaller sprites, with less detail?

How to I handle particles that pass close to the camera? There the fake will be visible?

Is there some trick to limit the maximum density of the atmosphere, so that I can have the atmosphere in the foreground visible without getting to dense in the background?

Any tips are highly appreciated :D

Cheers

Achim

here's an expample picture of the scene I'm working on (without any atmosphere yet)

post-21-1086958627.jpg

Link to comment
Share on other sites

Hey Achim,

First of all... nice work! :)

It helps to see exactly the context of what you're trying to solve.

As I mentioned, this is not a trivial effect, and as with anything like that, there are a whole bunch of ways you could go about it.

Let me give it some thought (today I'm delivering a WIP, so I won't be able to do much).

However... as a first step, you might want to itemize some aspects of your scene that may ultimately drive the choice of a method for a solution. Here are some things that come to mind right away from looking at that still:

1. That ball looks like it will pass very close to cam at some point. This means the dynamics need to be *good* (if not physically accurate). At first blush, this seems to mandate a POP solution (for the region close to the ball, at least).

2. Given the "look" you're going for, there is (thankfully in this case) very little directionality to the overall lighting. This may allow you to look into actual volume solutions (instead of sprites) since the need for accurate self-shadowing is either minimal, or could potentially be faked (with negative lighting, say).

3. Given the needs in #1, but the relaxations in #3, you might want to try a hybrid "i3d plus direct primitive

Link to comment
Share on other sites

Hi Mario,

1. your right, in every scene the "spore" passes very close to the camera, so the dynamics will have to be very acurate. Unfortunatly I didnt work much with pops, so this part will be very hard for me. Anyone else got some tips for setting up such a pop network?

2. yep, no need for self shadowing :) In fact I don't have shadows at all in any of those shots yet, as I couldnt get them working with those self illuminating SEM shaders, exept when using ambient occlusion, which I can't afford because of the render times with all those displacement shaders. So no shadows and no self shadowing is fine, for now

3. What do you mean with "direct primitive volume solution"and in which "areas" could I optimize this? For i3d, in the final rendering I can switch of self shadowing, which will help in this stage of the rendering process,

but I mostly had the long render times when generating the i3d. So I guess you mean it would be possible to to optimize this part as well. And what would be the advanteges of a i3d/hybrid solution compared a

sprites solution?

4. Cant follow you there 100% :unsure: , so maybe you could clear this up a bit. :D

5. Yes, your right, though I tried this only with a sprite solution for now, it works good when just applying the DOF to the background . The noise/fog will enhance the DOF illusion (without having to zblur the fog itself).

Here is a quick test (divx coded avi) with a sprite solution and without complex dynamics,

the particles are just pushed away when the spore passes. I guess I could get away with such an approach when I add the dynamics, and maybe use different layers of fog.

But I'm really interested in the hybrid approach you suggested, so if you find the time, please tell me a little bit more about it. :P

Link to comment
Share on other sites

Hi Achim,

Like I said, I was just thinking out loud, so not all ideas may be advantageous and/or applicable. ;)

What I meant by the hybrid method, was combining some optimized primitive-based method, together with the more general i3d approach.

Why? Because density detail decreases with distance to the viewer (see Musgrave's QAEB renderer in the texturing and modeling book). As a result, there's no sense in having an equal sampling density everywhere (i3d, if used naively), so you should devote most of your rendering effort in the areas that matter: directly in front of the camera for the "ambient" noise, and directly in front and around of the spore -- i.e the "head" of the compression wave, where density is much higher due to the compression. This is the main driving factor for finding "areas" for optimization.

How? This is what gave rise to that "direct primitive" comment. And by that I simply meant (for the "ambient" noise) either a small number of planes parented to the camera and positioned progressively further appart as distance increases, and with a proportional decrease in noise octaves (to emulate the decrease in perceived detail), which amount to sprites that don't move (but whose noise textures do). Or, say, a primitive sphere in front of the camera, whose ray-marching can be somewhat optimized due to the fact that it's a sphere (you know where the marching starts, ends, how big a step to take to maintain detail, etc.). These are all ideas for the immediate vicinity of the camera. Ideas which *do not* exclude using i3d for this region as well. Here the trade off is *dense* regular sampling to capture enough detail (but with the advantage of pre-calculation) vs. the "intelligent" ray marching of a primitive sphere (but with the disadvantage of render-time re-sampling). A matter of testing.

Anyway; hopefully that explains my choice of the word "hybrid" -- a combination of methods to concentrate the rendering only in the places that matter, and that render as fast as possible. That's all.

And now we come to the much more interesting bit: the "glue". How to tie these disparate methods so that they read as a homogeneous, turbulent medium. This bit is exclusively determined by the type of scene and how much "hackery" you can get away with. Looking at your avi, it looks like, in this case, you can get away with murder! :)

So; I'll shut up now, because I think what you're already doing, i.e: using sprites (or "Gardner cloud" spheres) coupled with convincing particle dynamics, should work just fine in this case. And the *last* thing I want to do, is complicate things and point you in the wrong direction for no good reason! <_<

It's just that I find this kind of stuff very interesting, so I get carried away sometimes, sorry :rolleyes:

One thing I'm *dying* to try when I get a chance, is using i3d as a vector field (of forces) which get influenced by objects (like your spore), which in turn drive a dense grid of particles (by converting to acceleration), and these particles then carry their rest-position densities around, "painting" another i3d image (this time of densities), which finally get rendered as a volume....

OK. really. I *will* shut up now. No. REALLY this time! OK; bye! :rolleyes:

(besides, I've got a *fine* game of UT2004 waiting for me! :D )

Cheers!

Link to comment
Share on other sites

Hey Mario, got to thank you again for your detailed description! :) This sounds very interesting, especially the "i3d as vectorfield solution", but I guess for now, thats to advanced for me. While I generally can follow your ideas, at at certain point I have no idea how to translate this into an actual network. Nevertheless I learned a lot from your suggestions, and could read them for hours :P. After this animation is finsihed I will try it again, but for now I will stick with some kind of sprite solution, as time runs away for me and because and it looks like I can get way with sprites pretty well.

And because the pop simulation part is already really hard for me. I cant get anything else besides some "pushing away effect" to work, so I guess I need some more help here. :unsure: For the ambient noise, which doesn't get influenced by the spore, I find it works well when using the interact pop and some turbulence and collision checking. For for the area around the sprore, I just can't get it to work and am running out of ideas.

I tried building some geometry along which the particles should slide around the sphere and thought I could the use some forces to then add the turbulence behind the spore. But this didn't work as expected. I roughly remember reading in the mailing lists that "slide on collsion" and animated objects don't work well together, maybe that's the reason, maybe its just me. Anyway, cant get my head around this, so I would highly appretiate, if you or anyone else finds another little bit of time to give me some more advice or even a basic sample file.

Thanks again

Achim

Link to comment
Share on other sites

Unfortunally I haven't much chance to work with POP's yet, but here is what I'd try with Maya. I assume that most things should be applicable to houdini's pop's as well.

- use a fairly low conserve value (particle loose their speed if they aren't driven by some force). This way particles that get quite a bit of velocity due to stronger forces around the spore will return to their slower movement once the spore past them.

- parent a radial field with strong falloff to the spore

- the particles that move fastest are closest to the spore and we want this kinda compression look there --> increase the opacity of your particles depending on their speed slightly.

- possibly even directly emit the particles on a enlarged hemisphere around the spore and make this hemisphere some softbody for a slightly more dynamic look to it.

- use a softbody chain with linked turbulance fields as a tail on your spore

- use multiple turbulance fields with different frequencies / octaves. start with low frequencies for the general movement if happy add another field with higher frequency ...

- put a newton field behind the spore

Concerning the problem with sliding and animated objects. What was the proverb with the prohet and the moutain again ? ;) Try making the spore static and move the tunnel etc. instead. Theoretically this is no more than a coordinate transformation.

Hope my thoughts aren't all rubbish

Jens

Link to comment
Share on other sites

Hey Achim,

Those are good ideas from Jens, especially how to break it up into regions with different dynamic properties.

I just thought I'd "Houdini-ize" some bits of it, so you can try them out:

- use a fairly low conserve value (particle loose their speed if they aren't driven by some force). This way particles that get quite a bit of velocity due to stronger forces around the spore will return to their slower movement once the spore past them.

Raise the drag and lower the mass (though the mass part is optional). Or, in other words, play with drag and mass until you get something a little more "viscous" than a gas.

- parent a radial field with strong falloff to the spore

Add a metaball SOP, followed by a Force SOP, and reference that last force SOP in an Attractor POP. Set the Force SOP to "Radial" and a negative force value (Force < 0).

- the particles that move fastest are closest to the spore and we want this kinda compression look there --> increase the opacity of your particles depending on their speed slightly.

When you increase the opacity, you don't want it to either grow indefinitely, or reach all the way down to zero. Here's a little expression to help it reach a ceiling gracefully, and fit it in a range:

[ease-out curve]          fit01((smooth(VEL,-OV,OV)-.5 )*2, O_MIN, O_MAX)
[ease curve]                fit01(smooth(VEL,0,OV), O_MIN, O_MAX)

The "easout" curve just uses the second half of the full ease curve. In both cases, OV is the velocity at which you want the opacity to reach its maximum value, VEL is the particle's current velocity, and O_MIN and O_MAX are the minimum and maximum opacities respectively. All of these are constants that you set to your liking and replace your chosen values wherever the related symbol appears in the above expressions.

- possibly even directly emit the particles on a enlarged hemisphere around the spore and make this hemisphere some softbody for a slightly more dynamic look to it.

Yep. Actually; I think Mcronin's last chop thread might help you out in this respect. Either that or go cheap and just use noise (the spring thing is fun though :P )

- use a softbody chain with linked turbulance fields as a tail on your spore

- use multiple turbulance fields with different frequencies / octaves. start with low frequencies for the general movement if happy add another field with higher frequency ...

Use a Trail SOP for the template on which to copy metaballs, group them, and use them inside multiple force pops with varying settings for their fractal noise.

- put a newton field behind the spore

Think of this as an "attractor". Proceed as with the "Radial field" example above, except this time the force should be positive (Force > 0)

Cheers!

Link to comment
Share on other sites

on a somewhat related note:

can the spring sop be forced to use

animated geometry?

I was trying something dodgy

(to do with the mucus problem) with

a divided box, an animated magnet,

spring and copy.

anyone used flex in max? that sort of thing

but more turbulent.

-cpb

Link to comment
Share on other sites

Hey Jens, thanks for your ideas! and as always, big thanks to you Mario, for translating this.

- use a softbody chain with linked turbulance fields as a tail on your spore - use multiple turbulance fields with different frequencies / octaves. start with low frequencies for the general movement if happy add another field with higher frequency ...

Use a Trail SOP for the template on which to copy metaballs, group them, and use them inside multiple force pops with varying settings for their fractal noise.

Not sure how to handle this. In the force pop I only have access to force objects, I can't reference the metaballs directly. So I used a force object and referenced the metaballs position, so it follows the trail of the spore, but then I "loose" my metaball information, and when applying the noise in the force pop, all particles get affected.

Link to comment
Share on other sites

So I used a force object and  referenced the metaballs position, so it follows the trail of the spore, but then I "loose" my metaball information, and when applying the noise in the force pop, all particles get affected.

Hey Achim,

Here's a sketch of the tail thing -- not perfect, but it shows what I was talking about.

wake1.zip

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...