Author: Antonis Geralis
First, let's create the basic smoke simulation.
- Open Blender. You'll start with the default scene containing a cube, a camera, and a light.
- Select the Cube. This will be our smoke emitter.
- Press
Ctrl+5. This adds a Subdivision Surface modifier. - In the Object Properties panel on the right, set the Scale for the X, Y, and Z axes to
0.5. - With the cube still selected, navigate to the top menu and click
Object > Quick Effects > Quick Smoke. This will automatically create a smoke domain around your cube.
Now, let's adjust the shape and position of the smoke domain.
- Select the smoke domain (the larger box that appeared).
- Press
GthenZto move the domain up along the Z-axis so its bottom is just below the cube. Click to confirm. - Press
SthenXto scale the domain along the X-axis, making it wider. Click to confirm.
To make the smoke more dynamic, we'll add some forces.
-
Add Turbulence:
- Press
Shift+Ato open the Add menu. - Go to
Force Field > Turbulence. - In the Physics Properties panel, set the Strength to
0.2.
- Press
-
Add Wind:
- Press
Shift+Aand go toForce Field > Wind. - In the Physics Properties panel, adjust the Strength as needed (a value between
0and2is a good starting point). - Press
RthenY, and while holdingShift, rotate the wind force90degrees to point along the X-axis.
- Press
-
Position the Domain: Select the smoke domain again. Press
GthenXand move it in the same direction the wind is blowing.
Let's tweak the physics for a more realistic look. Select the smoke domain to access these settings in the Physics Properties panel.
-
Adaptive Domain: Check this box to allow the simulation to calculate only where the smoke is, saving processing time.
-
Time Scale: Under the Fluid settings, set the Time Scale to
1.0for a standard speed. -
Noise: Check the Noise box and set the Upres Factor to
3to add more detail. -
Gas Settings: Experiment with these values:
- Buoyancy Density: Around
1 - Heat: Between
1and2 - Vorticity: Around
0.25
- Buoyancy Density: Around
-
Dissolve: Enable this and set a Time of
5frames to make the smoke fade out over time.
Now, select the original cube (the emitter). In the Physics Properties > Fluid > Settings, set the Initial Temperature to 10.
Prepare the scene for rendering.
-
Adjust the Light:
- Select the Light object in the outliner.
- In the Object Data Properties (the light bulb icon), change the light type to Sun.
- Set the Strength based on the desired intensity for your scene.
-
Adjust Smoke Density:
- Select the Domain object.
- In the Material Properties, expand the Volume section.
- Experiment with different Density values: Around
20.
-
Add a Render Background (Optional):
- Go to the Compositing workspace at the top of the screen.
- Check the Use Nodes box.
- Press
Shift+Aand add an Alpha Over node. - Press
Shift+Aagain and add an Image node. Click Open and select your background image. - Press
Shift+Aone more time and add a Scale node. Set it to Render Size and Fit. - Connect the nodes as follows: Image node's Image output to the Scale node's Image input. Then connect the Scale node's Image output to the top Image input of the Alpha Over node. Finally, connect the original Render Layers node's Image output to the bottom Image input of the Alpha Over node.
- In the Render Properties panel, go to Film and check the Transparent box.
-
Set Camera Background for Inspection (Optional):
- Select the Camera object.
- In the Object Data Properties (the camera icon), expand the Background Images section.
- Check the box to enable it, click Add Image, and select your background. You can adjust the Opacity as needed.
Final steps to render and save your image.
-
Position the Camera:
- In the 3D Viewport, find a view you like.
- Press
Ctrl+Alt+Numpad 0to align the active camera to your current view. - Press
Nto open the side panel, go to the View tab, and check the Camera to View box. This locks the camera to your movements. - Use the standard navigation controls (middle mouse button to rotate,
Shift + middle mouseto pan) to frame your shot. - Uncheck Camera to View when you're done.
-
Adjust Render Samples:
- In the Render Properties panel (the camera icon), go to the Sampling section.
- Under Render, you will see Max Samples. The default of
4096is very high and intended for final, high-quality images. - For smaller resolutions like
512x512or1024x1024, or for test renders, a much lower value is sufficient. Start with128or256to significantly reduce render times.
-
Final Checks:
- In the Outliner (the list of all objects in your scene), disable the original cube from rendering by clicking the camera icon next to its name.
- In the Output Properties panel, set your desired Resolution (e.g.,
1024x1024).
-
Render the Image:
- Use the timeline at the bottom to scrub to the frame you want to render.
- Press
Numpad 0to look through the camera and ensure everything is framed correctly. - From the top menu, click
Render > Render Image(or pressF12). - If you're happy with the result before it finishes rendering all the samples, you can press
Esc.
-
Save the Image:
- Once the render is complete, a new window will appear. From its menu, click
Image > Save As.
- Once the render is complete, a new window will appear. From its menu, click
-
Save the Blender File:
- It's good practice to pack all external files (like background images) into your
.blendfile. - Go to
File > External Data > Pack Resources. - Then,
File > Save.
- It's good practice to pack all external files (like background images) into your
For a more convincing effect, the smoke's color should not be a uniform gray. Denser areas often contain more ash and unburnt particles, giving them a different hue than the thinner, more dispersed smoke.
-
Open the Shader Editor: Select your smoke domain object. At the top of the Blender window, go to the Shading workspace. You will see a node network, including a Principled Volume shader.
-
Add a ColorRamp Node: Press
Shift+Ato open the Add menu, then go toConverter > ColorRampand place it in the editor. -
Add an Attribute Node: To drive the color based on the smoke's properties, press
Shift+Aand go toInput > Attribute. In the Name field of this new node, typedensity. -
Connect the Nodes:
- Connect the Fac output of the Attribute node to the Fac (Factor) input of the ColorRamp node. This uses the density values from your simulation to control the color.
- Connect the Color output of the ColorRamp node to the Color input of the Principled Volume shader.
-
Set Your Colors: The ColorRamp node has a gradient with two default color stops.
- Click on the left color stop (which represents the thinner parts of the smoke). Set this to a light gray color (e.g., RGB ≈
0.5, 0.5, 0.5). - Click on the right color stop (representing the densest parts). Change this to a slightly brownish or yellowish-gray to simulate ash (e.g., RGB ≈
0.3, 0.25, 0.2). You can add more color stops by clicking the+button on the ColorRamp. - You can add more color stops by clicking the
+button on the ColorRamp. Experiment with different colors and positions to achieve varied smoke coloration. - Change the color interpolation to Constant for more defined color transitions.
- For additional variation, you can replace the Attribute node with a Noise Texture or remove it entirely.
- Click on the left color stop (which represents the thinner parts of the smoke). Set this to a light gray color (e.g., RGB ≈
To mimic the distinct visual artifacts of a Raspberry Pi camera, use the Compositor.
- Press
Shift+Aand add aFilter > Lens Distortionnode between the Render Layers and Composite nodes. - Set Distortion to a small positive value (e.g.,
0.015) to create a slight barrel distortion, a common trait of small lenses. - Increase the Dispersion value (e.g., to
0.02) to introduce chromatic aberration, which creates red and blue color fringing around high-contrast edges. Check Fit to scale the image and hide black edges caused by the distortion.
- Add an
Input > Texturenode. Click the node's New button. In the Texture Properties panel (the checkered icon). Create set its Type to Noise. You can adjust the Size parameter here to control the scale of the noise grain. - Add a
Color > Mixnode. Connect the Render Layers output to the top Image input and the Noise node's Fac output to the bottom Image input. - Set the Mix node's blend mode to Add. This will overlay the noise on your image.
- To make the noise more prominent in the shadows, as is typical with camera sensors, add a
Converter > Mathnode set to Less Than. Connect the Render Layers Image output to the top Value input of the Math node. Connect the Math node's Value output to the Fac input of the Add node. Adjust the Threshold (e.g., to0.002) on the Math node to control where the noise appears.
- Add a
Color > Color Balancenode. - Subtly shift the Gain color wheel towards a yellowish-brown or the Lift wheel towards a greenish-magenta to simulate common white balance inaccuracies.
- To simulate the blocky artifacts of video compression, a simple method is to add a
Distort > Pixelatenode.
Scripting can automate tasks like managing simulation caches. Instead of navigating menus, you can run a script to set file paths and bake your simulation. This is especially useful for maintaining consistent settings.
-
Open the Scripting Workspace: At the top of the Blender window, click on the Scripting tab. This will open a new workspace with a Text Editor for writing your code and a Python Console for testing snippets.
-
Enable Python Tooltips: To better understand how Blender's interface translates to code, go to
Edit > Preferences > Interfaceand check the Python Tooltips box. Now, when you hover over a button or property, you'll see the corresponding Python command. -
Write the Script: In the Text Editor, you can write the following Python code. This script will find the object named "Smoke Domain," change its cache folder, and then start the baking process.
import bpy bpy.data.objects["Smoke Domain"].modifiers["Fluid"].domain.settings.cache_directory = "//cache_smoke/" bpy.ops.fluid.bake_all()
-
Run the Script: Click the "Run Script" button (a play icon) in the Text Editor's header or press
Alt+P. -
Check the Result: The script will update the Cache path in the Physics Properties for the "Smoke Domain" object and the simulation will begin baking.
For more advanced scripting and automation, check the Blender API reference.