Rendering a perfume bottle with Blender

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.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Blender 3D Modeling

    Although Walt Disney’s masterpieces are not forgotten, legacy cartoon techniques are a thing of the past. As long ago as 1995, the movie “Toy Story” proved that computers are more than up to the task of animating pictures. We’ll help you get started with building your own animations.

  • Blender 3D Animation

    Blender not only generates realistic single frames; it is also capable of capturing the natural movements of people and animals. We’ll introduce you to some of Blender’s animation features.

  • 3D Animation

    Realistic computer-animated movie scenes have been around for years, but hair, water, and fire are still difficult for 3D programs to handle. The new Maya 8.5 stands above the crowd.

  • Free Software Projects

    Shaping 3D objects with two-dimensional input devices is not easy. In this issue, we investigate how the K-3D project tackles designing a new user interface. Also, Towns triumphs, trouble at Debian, and good news.

  • FOSSPicks

    Graham had an interesting moral dilemma this month: whether to include an open source Wordle clone or not. Read on to see his decision.

comments powered by Disqus