Rendering a perfume bottle with Blender

Tutorial – Blender

Author(s):

Blender's massive feature set can seem overwhelming at first. Choosing a manageable project can help you get started.

Blender, the free and open source creation suite, includes a modeler, three renderer engines, a compositor, a tracker, a nonlinear video-editing system, a particle system, and the ability to animate physical simulations and export them as video. Suffice it to say, figuring out where to start can be overwhelming. Picking a relatively manageable project is key. An easy way to start is to model a simple item, such as a perfume bottle. For this tutorial, I will model a transparent perfume bottle filled with liquid. By using concrete but varied shapes, a limited scope, and a small number of different materials (i.e., surfaces), this tutorial can help take the frustration out of getting started with Blender. (Note: Having some basic previous experience with Blender will be helpful in this tutorial).

Setup

I always recommend working with the latest version of Blender, which is currently 2.93. However, you will find Blender 2.93 in only a few distributions. For instance, Ubuntu 21.04 includes Blender 2.83.5, and Fedora provides the latest version via updates. If your distribution does not have the current release, you can download the program as a TAR.XZ file from Blender's homepage [1] and unpack the archive on your computer. Then call the program's binary, blender, or create a starter for the desktop environment and link to the TAR.XZ file.

Before getting started, you may want to make a couple of adjustments. If English isn't your first language, you can change the localization in Edit | Preferences… | Interface under Translation. Keep in mind that many of the menus will remain in English (and many online tutorials use English terminology).

You may also want to change how you select objects with the mouse. In the default Blender configuration, you select objects by left-clicking. However, I recommend changing the selection to the right mouse button. To do this, go to Edit | Preferences… | Keymap | Select with Mouse Button and change the setting from Left to Right (Figure 1).

Figure 1: Selecting with the right mouse button makes it easier to work in Blender.

Setting the Scene

Blender uses scenes as a way to organize work. After startup, Blender displays the standard scene: a camera, a light source, and a cube. You will use the cube to model your perfume bottle, but before you get started, you need to do some preliminary work.

First, you need to define Cycles as the renderer and set the image dimensions and camera settings. By default, Blender uses the Eevee render engine. While the newer Eevee engine works faster, Cycles is better suited for rendering realistic objects. To change the render engine, go to the Render Properties tab in Blender's right sidebar. While you are in that tab, you should also increase the value for Sampling | Render to 512. Then, save the scene with a meaningful name.

You can use the default scene's camera and cube settings. To change the light source type, select the light source, Light, under Scene Collection and then select the characteristic Area instead of Point. This type of light source will cast more realistic (not so harsh) shadows.

If you are not yet familiar with navigating in Blender, see the "Navigation" box for some basic information.

Navigation

When working with Blender, there are some special features to keep in mind when navigating. Similar applications usually work with key combinations of a modifier such as Ctrl, Alt, or Shift plus a letter or a number. Blender takes a different approach. It enables many functions via a simple keystroke without the modifier key. In many cases, additional keys then follow as an option that specifies the selected function. For example, you can enable scaling of an object with S and then restrict it to the z-axis with Z (see Table 1 for more key combinations).

Table 1

Important Key Combinations

Key

Command

0

Change to camera view

1

Change to the front view

3

Change to the side view

7

Change to the top view

G

Move an object in the scene ("grab"). This can also be done by right-clicking on the object and moving it while holding down the mouse button. G also lets you restrict the function to one axis. For example, pressing G, Z moves you along the z-axis, which allows for far more precise modeling of the scene.

S

Scale an object either continuously or by a certain factor. Like G, scaling can be limited to one axis, for example, by pressing S, X. S, 2, on the other hand, lets you double the size of an object.

E

Extrude an object freely or only on one of the three axes (x, y, and z). E is only available in Edit Mode.

Shift+A

Insert objects, sorted by categories ("add"). In the beginning, you probably will be working mainly with objects from the Mesh and Light categories.

F12

Renders the complete image from the roughly calculated scene. Depending on the processor, graphics card, and scene size, this step may take awhile.

Shift+middle-click

Move and rotate the scene in the viewport. Alternatively, click on the hand icon top right in the viewport and move the view by dragging the mouse while holding down the left mouse button.

With only one view available in the viewport (Figure 2), Blender's default interface is not very clear cut. I recommend modifying Blender's interface by creating an additional camera view by positioning the cursor on the dark gray vertical line between the Properties Editor (bottom right) and the 3D viewport. A dark gray double arrow with a white border will appear. Right-click to pop up a dialog (Figure 3). Under Area Options, select Vertical split. Then drag the gray line to the left until you see two identical viewports. To make the right viewport show the camera's viewing angle, switch to Camera View with the mouse, press the left mouse button once, and then press 0 on the number pad.

Figure 2: Modifying the Blender 2.93 interface: The viewport can be divided into multiple viewports.
Figure 3: Right-click on the edge of the viewport to split the view.

If you want Blender to always use this viewport setup when creating a new Blender scene, save it by selecting File | Defaults | Save Startup File. This view will now be the permanent default that you will see each time you start Blender.

Background

Next, you need create a background with a bevel (Figure 4). Press 7 to switch to the top view, followed by Shift+A, and select Add | Mesh | Plane to create a new layer on the scene.

Figure 4: The bevel in the background provides a smooth transition between the object and the scene.

Switch to Edit Mode (see the "Blender Modes" box) and click on the Edge Select button. Select the edge farthest away from the camera and extrude it into the Z axis with E,Z so that the newly created second plane is at a right angle to the first plane.

Blender Modes

Blender has six modes; the two most important modes are Object Mode and Edit Mode. You can switch between these two modes by pressing the tab key. In Object Mode, you create 3D objects and move them as a whole by pressing G. You also assign materials to objects in this mode. You use Edit Mode to edit the shape of the objects.

Next you need to apply a bevel modifier to round the right angle to form a sloping edge. Switch to Object Mode and then click on the blue wrench icon in the Properties Editor on the far right. In the menu that opens, select Add Modifier | Bevel to add a modifier to the connected layers. Leave the Amount parameter at 0.1, and increase the Segments parameter to 6 (Figure 5).

Figure 5: The Bevel Modifier rounds off the bevel's hard edge to avoid creating hard shadows.

While still in Object Mode, smooth the bevel by going to Object | Shade Smooth (top left in the viewport). Position the bevel and the camera so that the bevel fills the entire viewport. If you want, you can save this setup as the new default by selecting File | Defaults | Save Startup File.

Make a Bottle

To get started on rendering your bottle, simply use the cube already present in the scene. In Object Mode, you can scale the cube along the z-axis by pressing S,Z until you get the desired bottle height (minus a cap on top – that step comes later). Next, move your bottle – you will adjust the bottle shape later – to the front view (press 1). Then press G,Z until the bottle's base rests exactly on the bevel plane. Now press the tab key to switch to Edit Mode, select the top square of the cube using Face select, and scale the top square down to create a flat-topped pyramid (Figure 6).

Figure 6: Starting with the default cube, you can create a relatively flat-topped pyramid.

Now toggle back to Object Mode using the tab key and assign a material to the pyramid by selecting a glass shader under Properties | Material Properties on the far right. Mouse over Surface | Principled BSDF and change the option to Glass BSDF. Leave the Roughness at the default value, and change the IOR (Index of Refraction) parameter to 1,330 for glass. As soon as you select Viewport Shading | Rendered, the cube becomes transparent.

Toggle to Edit Mode (with the tab key) and press A to select the entire cube. Next press L,P and select Separate | Selection. The cube's edge should now glow a bright red-orange, which will help you keep track of it later. The selected edge has become a separate object. Now switch back to Object Mode.

In the next step, give the wall (the edge) a thickness by applying a Solidify modifier. First, set Viewport Shading | Wireframe and then go to Properties | Modifier Properties. Under Add Modifier, select Solidify. As shown in Figure 7, the cube's wall now has a thickness, which you can set using the Thickness parameter.

Figure 7: Wall options: You can assign the cube wall a thickness, as well as choose a transparent material.

Now, you need to set the camera and the image dimensions by going to Properties | Output Properties (on the right). Set Resolution | X to something like 925px and Resolution | Y to 1080px. Then, right-click to select the camera. You can do this either in the viewport or in the Outliner.

To configure the camera, set Properties | Object Data Properties (the second icon at the bottom with the green camera) to Focal Length 35mm. Then use G to move the viewport up so that there is enough space for the bottle's cap.

Add Perfume

After you have modeled your bottle, you next need to fill the bottle with perfume. Create a new cube in the front view (1) using Shift+A and position the cube accordingly (Figure 8). Use G and S to move the cube until it fits exactly inside the bottle – just like real perfume.

Figure 8: A second cube inside the perfume bottle forms the space filled by the liquid.

To adapt the cube shape (perfume) to the flat-topped pyramid shape (bottle), follow the same steps you used to scale the bottle. In User Perspective view (on the left), select the four upper edges of the cube with Edit Mode | Edge select and scale them until they fit exactly into the bottle (Figure 9).

Figure 9: Select the four top edges of the cube and adjust them to the size of the perfume bottle.

Press 1 to activate the front view and scale the selected edges so that they fit exactly inside the bottle. Then, in Vertex select mode, adjust the top edges with a combination of scaling (S) and moving (G) so that they look like Figure 10.

Figure 10: The perfume does not have to completely fill the inside of the bottle: Leave approximately the top third empty.

Now you are ready to assign a material to the perfume cube. Choose a transparent, slightly amber material following the exact steps you did for the bottle (Properties | Material Properties | New). Under Surface, select Glass BSDF, and select a slightly yellowish orange color.

The perfume in the bottle currently looks too dark, so set the gamma to 1.8 via Properties | Render Properties | Color Management | Gamma. Now the perfume, as well as the whole scene, should appear much brighter. Use the top view (7) to check whether the perfume is centered exactly in the bottle; correct the position with G if necessary.

Label It

Your perfume bottle now needs a label on the front of the bottle. This process, known as UV Mapping, seems a little complicated at first. However, once you've done it a few times, it turns out not to be that difficult. Working in parallel, you will need to use Blender and a graphics program that supports layers to make your label. (I used Gimp for this tutorial.)

Use the tab key to switch to Object Mode and press A to select the bottle without the perfume. Then press Ctrl+A and select Apply | Scale – you must do this because you have scaled the cube. Call Ctrl+E and run Mark Seam. This will make the edges of the bottle appear a reddish orange. Next, press U and Unwrap, which unwraps the framework of the bottle on a plane, similar to unfolding a paper cube.

Next, you'll use the UV Editor to export the UV Layout, and then edit the label in your graphics program and import the finished layout back into Blender. To get to the UV Editor, click on the small clock icon at bottom left in the Timeline editor. Change Timeline to UV Editor and drag the viewport up a bit (Figure 11).

Figure 11: The bottle modeled as a 3D object with the UV layout rolled out flat below it.

Select the UV Editor and run UV | Export UV Layout. Save the layout as a PNG and then import it into your graphics program as the bottom layer. You now insert your desired label text in the graphics program. Make sure to rotate the text's orientation to 90 degrees (Figure 12).

Figure 12: You can create the bottle's label in an image editor such as Gimp.

Next, delete the bottom layer containing the UV Layout or temporarily hide the layer by pressing the eye icon. Once you've done this, export the label back to Blender. Keep the graphics program with the label file open in case you need to make corrections. If necessary, you can easily restore the deleted UV layout with Ctrl+Z and continue working with it.

To reimport the label text file into Blender, switch from the UV Editor to the Shader Editor and create the necessary nodes as shown in Figure 13. This relatively complicated setup is due to the bottle's transparent material. Once you've successfully added the nodes, you can view the label on the bottle. If the label is not quite right, switch back to the graphics program and edit the text.

Figure 13: Setting up the nodes in the Shader Editor: The nodes make the material of the bottle appear transparent.

Put a Cap on It

You can easily create a cap for your bottle using a black cube and a bevel modifier to round off the cube's edges. In Object Mode, position the 3D cursor (Figure 2) over the bottle, and create a cube with Ctrl+A. Press S to scale the cube so that it fits nicely on the bottle.

Then create a new material and color it black. This time, choose the Principled BSDF option. Now switch to Properties | Modifier Properties and use Add Modifier | Bevel to create a bevel modifier and round off the cap's edges. Leave the Amount at the default value, and increase the number of Segments to 6. Now apply Object | Shade Smooth to complete your bottle cap.

Insert Tube

Finally, create the fine tube used to connect the atomizer (hidden by the cap) to the perfume in the bottle. Simply create a path in Object Mode with Ctrl+A and use Add | Curve | Path. Move or rotate the path with G and R until it is vertical. Then switch to Edit Mode and move the lowest control point slightly to the right to create a slight curve in the tube.

Once you are satisfied with the curve, add some volume to the path by selecting Properties | Object Data Properties | Geometry | Bevel | Round. Increase the Resolution parameter to 4. Finally, the tube needs to be transparent. You can use the same material as you used for the glass bottle. As a final step, position the tube in the center of the bottle with G.

All done! Figure 14 shows the completed perfume bottle.

Figure 14: The finished product.

Conclusions

The longer you work with Blender, the more intuitive the above steps will become. Considering everything possible with Blender, this perfume bottle tutorial is only a modest beginning. If you get stuck as you venture forth with Blender, don't hesitate to ask for help, perhaps on a Blender forum [2], or look for a Blender Meetup [3] where users get together in person and share their experiences and techniques. My final advice: Don't give up too quickly!

The Author

Claus Cyrny has been working with graphics since 1996. He has used Linux since 2002 with Ubuntu Mate 20.04 currently installed. Claus has worked with Blender intensively since 2018. He enjoys playing guitar, blogging, painting, and photography.