Rendering a perfume bottle with Blender
Tutorial – Blender
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).
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.
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.
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.
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).
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.
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
New Slimbook EVO with Raw AMD Ryzen Power
If you're looking for serious power in a 14" ultrabook that is powered by Linux, Slimbook has just the thing for you.
-
The Gnome Foundation Struggling to Stay Afloat
The foundation behind the Gnome desktop environment is having to go through some serious belt-tightening due to continued financial problems.
-
Thousands of Linux Servers Infected with Stealth Malware Since 2021
Perfctl is capable of remaining undetected, which makes it dangerous and hard to mitigate.
-
Halcyon Creates Anti-Ransomware Protection for Linux
As more Linux systems are targeted by ransomware, Halcyon is stepping up its protection.
-
Valve and Arch Linux Announce Collaboration
Valve and Arch have come together for two projects that will have a serious impact on the Linux distribution.
-
Hacker Successfully Runs Linux on a CPU from the Early ‘70s
From the office of "Look what I can do," Dmitry Grinberg was able to get Linux running on a processor that was created in 1971.
-
OSI and LPI Form Strategic Alliance
With a goal of strengthening Linux and open source communities, this new alliance aims to nurture the growth of more highly skilled professionals.
-
Fedora 41 Beta Available with Some Interesting Additions
If you're a Fedora fan, you'll be excited to hear the beta version of the latest release is now available for testing and includes plenty of updates.
-
AlmaLinux Unveils New Hardware Certification Process
The AlmaLinux Hardware Certification Program run by the Certification Special Interest Group (SIG) aims to ensure seamless compatibility between AlmaLinux and a wide range of hardware configurations.
-
Wind River Introduces eLxr Pro Linux Solution
eLxr Pro offers an end-to-end Linux solution backed by expert commercial support.