- The Blend
- The Magic of Spray Foam
The Magic of Spray Foam
Create spray foam you can actually spray around your scene.
One detailed technique for realism in Blender, in 5 minutes each week.
By Samuel Sullins
In a basement…
On a spaceship…
In the back of an old van…
On the side of a building…
If you look for it, you can find foam insulation all over the place. Especially on more functional things (like spaceships.)
Next time you’re on a spaceship, look around. I bet you’ll see some insulation.
Spray foam is the most versatile insulation of all. It can be used to:
Fill gaps and holes
Cover seams between panels
Seal around objects
Because it’s so useful in reality, it’s also useful in Blender—to add a whole new layer of realism to your scene.
In today’s Blend, you’ll learn how to create some nice useful spray foam.
We’ll create this in 3 phases: setup, Geometry Nodes, and material. It’ll go fast.
First, the setup.
Add a new Curve → Bézier curve. You’ll generate your spray foam along this curve.
That was all the setup. No idea why I made a whole phase for it.
Next, the Geometry Nodes.
Go to the Geometry Nodes tab.
Select the curve and press New. Name the new node group “spray foam.”
Since you know how to build nodes yourself, I’ll just show you a picture of the final result, then explain what it’s doing.
First is the Curve To Points node, which changes the curve to points. In Length mode, we choose how many new points to make as a multiple of the curve’s length.
Next we use a Set Position and a Random Value to mess up the points a little.
Next we use an Instance On Points to put an icosphere on each point. Two Random Value nodes make sure that there spheres all have a different rotation and scale.
Finally a Realize Instances turns the setup into a real mesh.
It’s looking like spray foam, but now we need to make it look smooth and blobby.
To do that, add a Remesh modifier with these settings:
Now the modeling is complete. On to materials.
Since we’re using a Remesh modifier, we can’t add a material to this object (it just doesn’t show up.) To solve this, we create our own “set material” modifier with Geometry Nodes.
Press Add Modifier > Geometry Nodes to add a new modifier, then click the New button on that modifier.
Name the new node group Set Material.
Add a Set Material node, like this:
Now that’s done. Go to the shading tab, add a new material, and name it Spray Foam. In your Set Material modifier, select this material.
Finally it’s time to set up the material nodes. It’s simple: we’ll use Noise Textures to create small bubbles in the foam and some color variation.
Here’s the nodes:
Now you have spray foam—but you can’t spray it yet.
Read on to get to the Extra Tip and see how you can spray this foam all over the place ↓
..and it’s a realistic 3D snail made in Blender.
I’ve thought about trying to make a snail in Blender for a long time.
I’m glad somebody finally made one! It’s very realistic, too, with excellent materials. I also like the mushroom it’s on.
My favorite part of this render is the texture on the snail’s body. It looks very realistic.
↪ Reply to this email with your own render for a chance to get featured!
To spray your foam on things:
Select your foam.
Tab into Edit Mode.
Press A then X to delete the entire curve.
Enable the Curve Draw tool in the sidebar, then select Surface to make it stick to surfaces when you draw:
This allows you to draw curves in your scene—which all get converted to spray foam. Now you can draw foam on anything!
Note that you are still in Edit Mode—when you go back to object mode, the foam will look better, since you’ll be able to see the Remesh modifier at work.
Pick next week’s topic.
What do you want to learn in next week's Blend?
You get to pick:
Reading this online? Cool but still that’s a bit strange. You know you can just subscribe and get this in your email right? You won’t have to try to remember to come here and check for new posts all the time.