Join Andy Needham for an in-depth discussion in this video Ice cream sprinkles and sauce, part of X-Particles 3 for Cinema 4D Essential Training.
- In this Essential project we've got a delicious looking ice cream that I found in the content browser, I've added a flake, and in the UK this is known as a 99. I've created a system for some hundreds and thousands sprinkles, and by the end of this project we want to achieve the effect of having some sauce come down and coat the ice cream. So the sprinkles system, if we just hide some of these scene objects, we don't need to see them in the object manager, we'll just create some room for ourselves.
The sprinkles are fairly straight forward, they're landing on the geometry, the follow surface is capturing them and then freezing them with an action. I experimented with the cover target modifier, but I just got better results with this. We've also got some particle to particle collisions, and I just reduce the bounce down because I want the effect to be quite subtle. So you could go back over this and get familiar with it. Let's just move on to creating the sauce, I'll turn off the sprinkles, and enable the sauce system.
And we have an emitter, and it's just off screen, and it's being moved around by this vibrate tag. And you'll notice when I was on the display settings that we are coloring the particles over their speed. We've also got the same modifier setup with some gravity, and the follow surface, but with some slightly different settings. So we want to generate a mesh from these particles, so to do that we'll use a skinner. I'll add in a skinner, and the sauce object will be our emitter.
So I'll rewind and we'll generate some particles, and we're getting this ridiculously large blob, that's actually quite scary. Let's change some settings and make this a bit more sauce-like looking. So the surface level I experimented with a bit, I think for it I was using Fluid or Zhu-Bridson, or something like that and this one was probably a bit closer but in the end I went back to Hart because I was getting a better result. It doesn't look like it now, but when we start to change some of the settings you'll see what we start to achieve.
So I'm going to reduce the polygon size down to two, and the render polygon size and already that's looking a bit more manageable. The mesh is tightening up. I also want to turn on some smoothing, and we'll preserve the volume, we will also smooth the particles. I'm going to reduce the radius so slightly, and what I like to do when using the skinner is add my own control outside of these settings, so I'll add a displacer and I'll also add some smoothing, and I'll put that after the displacer.
Just going to click on this and paint down to add all of these into the sauce layer, and in the displacer let's change the color to be something like so. Just mid gray, that just brings everything down a bit, I'm just going to increase the smoothing iterations, and that tightens everything up a bit more once again. I want the sauce to be quite thick, and I know I could do this using the constraints so in the dynamics we'll add a constraints object, and I'm only interested in the viscosity tab so we'll check on that and we'll look at some of these settings.
We're going to leave the weight at 100, I'm going to increase the connection limit. The connection limit is looking at the surrounding particles and the radius is looking at, it's the maximum difference to those surrounding particles, so I'm going to reduce that slightly, and increase the stiffness. The stiffness is just how strong the viscosity is. So before we move on, I'm just going to press cmd + d, and we'll look at the X-Particles project settings, the settings is slightly different to the defaults.
When using dynamic objects, you usually have to increase the subframe steps and iterations to get more accurate results. So I found that increasing the subframe steps and iterations to five works nicely here, and if we look at the emitter we've got quite a lot of particles being born, and that will also mean a lot of calculations taking place. So I think the best thing to do for this kind of sim would be to cache the sim. I'll just add this to the layer, and we'll save our work, I'm going to save incremental file, save incremental, and we'll go to the other options and we'll add a Cache Object.
Let's build the cache, and while it's building, we'll get to see how this sauce is playing back, and so it's coming down hitting the ice cream, I quite like the movement that we're getting from the emitter with that vibrate tag on it, it's just kind of waving around. So we're getting this very thick syrupy looking sauce, and soon it's going to start to flow down the surface of the ice cream. I'm also looking at the quality of the surface of the mesh, and there aren't any holes appearing, which could usually happen, and it all looks like it's behaving quite nicely.
There's not any flickering that I could see. This is due to the number of particles and also the surface level that we have as well. So the combination of all the settings that we've just been using, and those modifiers as well has helped to achieve this result. So, caching is almost done. With the cache completed with can play through and have a look at the result. And we can just jump forwards to a few frames, and I like how we're getting the sauce kind of making this nice shape over the edge of the ice cream.
Well, it doesn't look like sauce at the moment if we render it. That's not what we're looking for, we want it to be more of like a raspberry sauce. So, we'll create a material, new material, and drop it on the skinner. And we're going to use a shader, I'm not interested in the color channel, I'm going to turn on the luminance, and we're interested in the X-Particles skinner shader. The skinner shader uses the data from our particles, and shades the mesh created by the skinner. So it's going to look at the display settings that we've got here, this parameter speed, and it will shade the mesh.
I just want to add some reflectance to this, so we'll add a Beckmann and I want to increase the roughness and the specular strength. And we'll also add a dielectric for now. I could remove the default specular now, and if we look at this frame I could render it to the picture viewer, and already I could see that's starting to look like a really nice looking sauce, we're getting some good volume to it, it looks really sticky, it might be a bit thick but you could tweak the settings and take it a bit further.
Using the skinner shader, we've taken the data from our particles and shaded the mesh created by the skinner. To make this your own you could go into the sauce emitter display settings and change the colors to make a chocolate sauce for example. I think this is looking great for where we've got to, we'll add back in the sprinkles, and we'll play through this animation, playback everything, you could look through the camera that I've got set up as well, and I think this is starting to look really, really good. We've explored subtle particles of particle collisions, and created a viscous sauce which sticks to our ice cream geometry.
With our final frame in place, we could render this out and maybe give a bit of color correction and tweak it a bit more, make it our own, but we've got the nice foundation of the animation here.
- Working with the Emitter tabs
- Adjusting particles with modifiers
- Creating visible particles
- Using sprites
- Colliding, freezing, and lighting particles
- Caching in X-Particles
- Applying constraints
- Adjusting materials settings
- Sculpting particles
- Saving and loading presets