Skip to content

Instantly share code, notes, and snippets.

@planetis-m
Last active July 27, 2025 11:16
Show Gist options
  • Save planetis-m/03af478f1e9b40301310c79ef741f573 to your computer and use it in GitHub Desktop.
Save planetis-m/03af478f1e9b40301310c79ef741f573 to your computer and use it in GitHub Desktop.

Blender Smoke Simulation Guide

Author: Antonis Geralis

Initial Smoke Setup

First, let's create the basic smoke simulation.

  1. Open Blender. You'll start with the default scene containing a cube, a camera, and a light.
  2. Select the Cube. This will be our smoke emitter.
  3. Press Ctrl+5. This adds a Subdivision Surface modifier.
  4. In the Object Properties panel on the right, set the Scale for the X, Y, and Z axes to 0.5.
  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.

Shaping the Simulation

Now, let's adjust the shape and position of the smoke domain.

  1. Select the smoke domain (the larger box that appeared).
  2. Press G then Z to move the domain up along the Z-axis so its bottom is just below the cube. Click to confirm.
  3. Press S then X to scale the domain along the X-axis, making it wider. Click to confirm.

Adding Environmental Forces

To make the smoke more dynamic, we'll add some forces.

  1. Add Turbulence:

    • Press Shift+A to open the Add menu.
    • Go to Force Field > Turbulence.
    • In the Physics Properties panel, set the Strength to 0.2.
  2. Add Wind:

    • Press Shift+A and go to Force Field > Wind.
    • In the Physics Properties panel, adjust the Strength as needed (a value between 0 and 2 is a good starting point).
    • Press R then Y, and while holding Shift, rotate the wind force 90 degrees to point along the X-axis.
  3. Position the Domain: Select the smoke domain again. Press G then X and move it in the same direction the wind is blowing.


Refining the Simulation

Let's tweak the physics for a more realistic look. Select the smoke domain to access these settings in the Physics Properties panel.

  1. Adaptive Domain: Check this box to allow the simulation to calculate only where the smoke is, saving processing time.

  2. Time Scale: Under the Fluid settings, set the Time Scale to 1.0 for a standard speed.

  3. Noise: Check the Noise box and set the Upres Factor to 3 to add more detail.

  4. Gas Settings: Experiment with these values:

    • Buoyancy Density: Around 1
    • Heat: Between 1 and 2
    • Vorticity: Around 0.25
  5. Dissolve: Enable this and set a Time of 5 frames 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.


Lighting and Background

Prepare the scene for rendering.

  1. 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.
  2. Adjust Smoke Density:

    • Select the Domain object.
    • In the Material Properties, expand the Volume section.
    • Experiment with different Density values: Around 20.
  3. Add a Render Background (Optional):

    • Go to the Compositing workspace at the top of the screen.
    • Check the Use Nodes box.
    • Press Shift+A and add an Alpha Over node.
    • Press Shift+A again and add an Image node. Click Open and select your background image.
    • Press Shift+A one 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.
  4. 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.

Rendering and Saving

Final steps to render and save your image.

  1. Position the Camera:

    • In the 3D Viewport, find a view you like.
    • Press Ctrl+Alt+Numpad 0 to align the active camera to your current view.
    • Press N to 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 mouse to pan) to frame your shot.
    • Uncheck Camera to View when you're done.
  2. 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 4096 is very high and intended for final, high-quality images.
    • For smaller resolutions like 512x512 or 1024x1024, or for test renders, a much lower value is sufficient. Start with 128 or 256 to significantly reduce render times.
  3. 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).
  4. Render the Image:

    • Use the timeline at the bottom to scrub to the frame you want to render.
    • Press Numpad 0 to look through the camera and ensure everything is framed correctly.
    • From the top menu, click Render > Render Image (or press F12).
    • If you're happy with the result before it finishes rendering all the samples, you can press Esc.
  5. Save the Image:

    • Once the render is complete, a new window will appear. From its menu, click Image > Save As.
  6. Save the Blender File:

    • It's good practice to pack all external files (like background images) into your .blend file.
    • Go to File > External Data > Pack Resources.
    • Then, File > Save.

Introducing Color Variation

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.

  1. 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.

  2. Add a ColorRamp Node: Press Shift+A to open the Add menu, then go to Converter > ColorRamp and place it in the editor.

  3. Add an Attribute Node: To drive the color based on the smoke's properties, press Shift+A and go to Input > Attribute. In the Name field of this new node, type density.

  4. 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.
  5. 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.

Recreating the Raspberry Pi Camera Look

To mimic the distinct visual artifacts of a Raspberry Pi camera, use the Compositor.

Lens Distortion & Chromatic Aberration

  • Press Shift+A and add a Filter > Lens Distortion node 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.

Sensor Noise

  • Add an Input > Texture node. 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 > Mix node. 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 > Math node 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., to 0.002) on the Math node to control where the noise appears.

Color Cast

  • Add a Color > Color Balance node.
  • Subtly shift the Gain color wheel towards a yellowish-brown or the Lift wheel towards a greenish-magenta to simulate common white balance inaccuracies.

Compression Artifacts

  • To simulate the blocky artifacts of video compression, a simple method is to add a Distort > Pixelate node.

Getting Started with Scripting

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.

  1. 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.

  2. Enable Python Tooltips: To better understand how Blender's interface translates to code, go to Edit > Preferences > Interface and check the Python Tooltips box. Now, when you hover over a button or property, you'll see the corresponding Python command.

  3. 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()
  4. Run the Script: Click the "Run Script" button (a play icon) in the Text Editor's header or press Alt+P.

  5. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment