Bubbles Popping
In this tutorial we are going to put together a fun little effect used in simulating popping soap bubbles.
In order to achieve a decent effect a simple sphere shape would suffice, but let's go a little further with it and see if we can't get a more animated amorphic shape for our bubblesthan that. It will give us a chance to use some of the fun settings in a shape instance operator in particle flow as well. We will move along as if you are somewhat familiar with particle flow in this tutorial, so if it gets confusing please try a simpler one first.
Ok, let's get to work and make ourselves an amorphic shape. Start with a sphere.
I have created it off to the side and out of the way for now, since our object itself won't actually appear in the final effect. I gave my sphere a radius of 6.0 and I upped the segments to 64. You could get away with less, but let's get it moving smoothly with more polygons for the moment.
Next, go to your modify tab, and add a Displace modifier to our sphere.
I started with a strength of 3.0, which can be changed until you are happy.
I marked the Luminance Center checkbox so that we get a tighter displacement around our bubble.
Click on the Map None channel box, and add a Noise from the Maps list.
Finally, check the Spherical Box. This will wrap our noise around the sphere rather than place it on top.
Then open your material editor (M) and drag and drop the noise we just added to the Map channel box on our displace, into an empty texture slot in the materials editor.
In the noise map settings, reduce the size until you are satisfied with the shape of your displaced sphere. We just want it to look less perfectly round.
I chose a Size value of 9.0
Good, now we can animate the noise to add a kind of smooth gyration to our bubble as if it is trying very hard to keep it's round shape.
I know I am going to want to add more time to my animation than the default 100 frames, so I have changed it to 500 for this one.
Turn on the Auto Key button, and move your timeline slider to the last frame in the animation... in my case, frame 500. Then change the phase value on our Noise map to 10.0 to set a keyframe.
Once you have done this you can turn your auto key button off and close your material editor.
Scrubbing back and forth should show you that your bubble now moves stretching in and out across the surface like a real one might.
Next lets create the forces we will need to make our bubbles float and drift through the air.
Go to your create tab, and then all the way over to the spacewarps, make sure Forces is selected in the dropdown menu.
We are going to create 3 forces, a Gravity, a Wind, and a Drag. Everything a bunch of bubbles need to move through the air.
In our top view, lets create a wind first. By dragging out the wind icon in the top view the arrow will be pointing upwards, which is exactly what we want. The wind will give our bubbles some lift as well as turbulence so they don't fly like rockets but rather float like .... well, bubbles.
I made the strength very low, as our particles won't need much to lift off. Then I adjusted the Wind turbulence settings to get a fairly slow chaotic movement pattern. You can always come back and adjust these settings later to your liking once you see your particles moving.
Next, Create a Gravity in the top view as well, this will ensure the arrow for the gravity is pointing down... as gravity should. Then reduce the strength of your gravity to 0.2, this will let our soapy droplets fall once the bubbles have popped.
Last, create a drag in your scene. The default values for this will be fine, except for the Time Off number, make sure it is above whatever your animation time length is going to be. I just added a 0 and made mine 1000 in case I need to extend the animation later.
The drag will slow our bubbles down a little as they travel, adding to the wind resistance and giving our bubbles a more realistic movement.
Now we are ready to make the particle system! Open up particle view by pressing 6 on your keyboard, or find it in the Graph Editors Menu.
Start, by dragging out an empty flow into the light grey stage area. Be sure to click on the PF Source 001 box title, and change the settings to the right (not the Render 001, but the entire box)
Next, drag and drop a Birth in the empty light grey stage area, and connect the blue node to the empty circle node between the two flow chart boxes.
Once your first event is connected to your PF Source, click on the Birth Operator in the Event 001 box to adjust its settings in the command panel on the right hand side of the particle view window.
Next, we want our particles to emit from the PF Source Icon, so add a Position Icon to the Event 001 box, between the Birth and Display operators.
Then so our bubbles don't come out in clumps, but rather closer to 1 at a time we are going to add a "Keep Apart" operator after the Position Icon.
Reduce the force to about 30.0 and the Accel Limit to 100. We don't need them being pushed apart to an extreme, but this will help separate our particles from one another.
Next, Add a Shape Instance under the Keep Apart, time to make our particles look like bubbles.
In the Shape Instance settings we have some big changes to make. First of which is to click the None channel box at the top and then click on your bubble shape to add it as the Geometry Object.
I gave mine a scale Variation % of 45, so my bubbles don't all come out the same size.
We animated our bubble shape, so be sure to check the Animated Shape checkbox.
Then check the Random Offset Checkbox, and give it a value. I chose 75, which will make each particle start the animation of our main bubble 75 frames apart, giving them the appearance of moving separately rather than all at once.
Next, add a Force operator beneath your Shape Instance.
Click on the By List button in the Force settings to the right, and add your Wind and your Drag to this force operator.
This should get your particles floating up and away from the emitter icon.
Next, lets make the viewport display our bubble shape, rather than those little tick marks. Click on the Display operator in the Event 001 box and change the top dropdown menu from Ticks to Geometry.
Now you should have colorful bubbles instead of tick marks.
Next lets add a Speed operator underneath the Force, this will add a bit more randomness to our bubbles movement as well as push them to go a little more up than out. Be sure to reduce the Speed to 40 or so or you'll have rocket bubbles, also be sure to check the Reverse checkbox.
Definitely a subtle change, but I feel it makes them move a little nicer.
We can further making our bubbles seem random by adding a spin operator beneath the speed, unless you want very fast spinning bubbles I would reduce the amount greatly though, and give it a little variation so each bubble can decide how much it wishes to turn.
Ok, looking good so far, we have bubbles! ... now the one thing (possibly the best thing) about bubbles is that they pop!
Sometimes for a reason, sometimes for no reason! In this tutorial we will make them pop for no particular reason, but know that you can make the same thing occur by using a different Test to get us into the next Event box.
For this one, Add an Age Test to the very bottom of Event 001 box.
By giving it a higher test value and variation we can tell the bubbles to move into the next event after they have been alive for 90 frames, give or take 115. Which of course means our bubbles could pop anytime between the very second they are born, to over 200 frames later. Adjust these numbers to your liking!
Note* - If we were to perhaps use a Collision instead of an Age test, we could pop the bubbles only when they came into contact with another item in the scene! Just food for thought**
Now that we have tested for Age, we get another blue node which comes along with any Test operator. We want our particles that have reached the required age limit to move on into the next phase of our flowchart. Which will be the creation of particles making our bubbles look as if they have popped!
So, drag and drop a Spawn operator, to the empty grey space below our Event 001 box. (not in the Event box like all the others have been so far) and then connect the blue and circle nodes between Event 001 and Event 002.
Make sure to set your particles to Spawn Once, and Delete the Parent Particle.
Give them an offspring of 5, and a variation of 30% or so for some variety.
This will make it so that when the original bubbles reach their Age Test, they will change into 5 new particles give or take.
Next, add a Shape beneath the spawn so we can define what our exploded bubble particles will look like. Change the 3D Cube default setting to the Sphere 80sides setting.
Then change your new Display 002 operator, from Ticks to Geometry just like we did in the first Event. You should be seeing something like this now...
Your bubbles will turn into several different colored spheres after they have reached their age limit. Now we make them move like soapy droplets.
Add a speed operator below our Shape, and give it a reduced speed and a variation close to the same. The most important thing here is to add a Divergence of 180 which tells our particles they can move in all directions rather than just up.
Next, find and add a Scale Operator beneath our speed. This will let us tell the new particles to start a little smaller than the original. Set the Scale Factor to 95% and the Scale Variation to 15% or so. Adjust to your liking.
Now drag and drop a Delete operator beneath the scale, we don't want these particles flying away into space forever so we will kill them off by setting it to By Particle Age with a life span of 8 and a variation of 7.
Next we'll make them fall out of the air like they got heavier, add a Force below your Delete and then add our Gravity to the operator.
Lastly, let's make these particles evaporate or shrink as they fall to give the illusion that they popped and dissipated into the air.
Add another Scale to the very bottom of our Event 002 box. Set the dropdown to Relative Successive this time, indicating they should change over the course of the particles life. Make the Scale Factor 70% or so, and the Variation 5% and adjust to your liking.
Our Particle Effect is now complete, but our bubbles will need textured so add one last Operator to the system. Find a Material Static and add it to the very first PF Source 001 box below the Render 001. By placing this operator here we tell it to carry the texture all the way through the entire system.
Then create yourself a bubble texture and add it to the channel box in the settings for the Material Static Operator.
And there you have it, as a reminder you may need to refresh the system by clicking the little lightbulb icon in the top corner of the PF Source 001 box off and then on again for the texture to take effect.
For a finished example render of this effect, you can download an .mov here:
Hope you enjoyed this one!
1