View Full Version : Unpredictable results with particles colliding with a sub-d object

11-04-2009, 11:51 AM

I am having a lot of trouble getting a distance-to-particle setup work for creating foam on wavetops for a water scene I am going to do.

The enclosed images show to renders. They were made with exactly the same settings! The scene wasn't altered at all, I just pressed F9 twice. But when I continued to press F9, each subsequent render looked just like the second one, so I am unable to recreate the error. However, a recalculation of the particles does change the scene again.

The white stuff is the start of an attempt to create foam, and it is a coloration of the texture based on distance to the nearest particle. The particles are generated when the waves get taller than a certain height, and they are then supposed to stick to the waves, sliding down into their valleys.

I use the DP-kit plugin to find particle info...

Anyone have any kind of experience with this sort of setup?

11-04-2009, 01:34 PM
What about generating the texture on the waves based on a gradient set to Y distance or a procedural with falloff based on y distance?

11-04-2009, 02:51 PM
Hi Larry!

Thanks for chiming in - again:D Yep, that is the good old one. But when doing some wave research I discovered that the foam actually remains in place. The foam gets generated when the waveform reaches a peak, and then slowly slides back down into the valley behind the peak while the waveform moves on.

To mimic that I first experimented with the thought of trying to look up wave height back in time (to find out: "was there recently a peak here?"), but landed on another solution. I am now generating particles each time a wave hits a certaint y value, and letting them fall down (with a sticky collision) into the valley behind the peak.

I then take advantage of these particles in my node tree, mixing in foam texture based on distance to the closest of these particles.

Perhaps this is taking it too far... I need photo-realism, but I have been struggling with this wave scene for so long now...

11-04-2009, 02:58 PM
OMG! This is off topic, but I just found two candidates for foam texture that I had to mix, and I thought I remembered that I once upon a time was able to define color for each key in a gradient with a map.

I searched and searched and at last I checked "show output" - and there it was! But why did they call it "show output" when it actually means "take input"?

If I'd only found this one before, my node-trees would have had much less clutter...

11-04-2009, 05:00 PM
I would go for what looks cool vs what might be physically accurate. Youre probably the only person who knows that foam does that :)
Also put a collision plane above the waves and set the waves to emit particles based on collision with the plane.
Also duplicate your wave object and use one for emitting particles and the other as a collision object for catching the particles.
You might also be able to use Dponts particle paint plugin to change the surface attributes where the particles collide.

11-05-2009, 01:21 AM
Hi Larry,

Thanks a lot for your tips! You say I should use separate emitter/collision objects. Is that the more stable solution, then? :)

Thanks for tipping me about that particle paint plugin! One of the problems with the particle info node is that it hangs LW when there are no particles to check on, so I have had to generate a very long lived particle in frame 1... Perhaps particle paint will work better.

You're right about going with what looks cool. I'll see if I am able to kill my particle baby this weekend... Or at least stop using them for foam texture and start using them for spray instead.