Showing posts with label Blender. Show all posts
Showing posts with label Blender. Show all posts

Blender & Yafray HDRI Tutorial

Tutorial Requirements
You will need to have some basic experience with Blender and, of course, the following pieces of software:
You will also need a .hdr image. A few examples can be found here.
Introduction
In this tutorial we are going to create an image that uses HDRI technology - the aim of which is to teach you how to use HDRI sources in Blender. The acronym HDRI is short for 'High Dynamic Range Image', and is explained in more detail here - the practical examples themselves are well worth your browsing time.
Building The Scene
We will start this tutorial by building a simple scene consisting of four objects - a UV sphere, a lamp, a camera, and a floor plane. Place the objects in roughly the same positions as the diagram below.

Fiddle with the camera a little until you can render a sphere resembling the one below. Our scene is now ready. Define the shader of our sphere and adjust the world settings so that the .hdr image is mapped onto the surface.


Creating the UV Sphere Shader
Select the UV sphere. Go to the editing tab and click on the set smooth button - This will automatically smooth out our UV sphere when it is rendered. Now click on the shading tab and press the add new material button. We want to eliminate the material's specularity, so adjust the spec slider to 0.  Click on the mirror transparency button and then the ray mirror button.  Set the corresponding slider to a value around 0.50.

Our material preview should show a texture reflecting a chequered floor plane. We have now finished creating a material for our sphere. If we render our image, we can see it is reflecting a blue colour, which is our current sky colour.
Loading a .hdr image Into World Settings
Deselect all objects and click on the shading tab, and then the world settings tab. From the bottom right of the screen find the add new texture button and click it. We can now load our .hdr file. To do this, click on the texture tab, and set the property in the texture type box to Image. Navigate your way through your pc’s hard drive, until you find your hdr file and then load it up. Leave all the other settings alone.
Soft shadows
To give our scene more life-like lighting we are going to enable soft shadows. Start by selecting your lamp, then click on the shading tab. Now click on the lamp button and then on the buffer shadows button. Play with the settings to your heart's content until they suit your own individual tastes. You can also adjust the strength of the light in the shader tab.
Final touches
If you are unsatisfied with the results that you receive from your renders, just start moving the light source into a position that you find more aesthetically pleasing. I also find that if I decrease the amount of diffusion on my UV sphere, the specularity reduces accordingly as well.
Rendering
Go to the render tab. Make sure that you have YafRay enabled as the render engine, and that the envmap setting is enabled. Then just hit the render button. The result should resemble the image below.

This is, of course, only a single example of the potential uses of HDRI mapping. You could use this feature on any model that you have created, and the technique is universally exciting, capable of making all your models substantially more life-like. So play around a bit and watch your renders come to life!
read more "Blender & Yafray HDRI Tutorial"

A Simple Winter Scene

This tutorial will teach you how to make a simple winter scene, including some fir trees and a snowman. It is supposed to show you how to use the most common Blender functionalities (i.e. modelling, adding materials and textures) and shortcuts.

When a shortcut is used for the first time, I'll say something like "press the x key". When I use it again, I'll just put something like "(x)".
The Snowman


Step 1 - Press the X key to delete the square that is in the middle of the scene. Press the space bar. Select Add > Mesh > UVSphere to add a sphere in the scene (click on the OK button for the number of segments and rings, 32 is perfect). Zoom in ("+" key or the mouse scroll button) and press the S key (size) to make the sphere 4 squares wide. (if you want it to be exactly 4 square wide, hold the Ctrl key while you move the mouse ). This is going to be the body of the snowman.
Step 2 - Press the Tab key to switch to the object mode (the sphere is now displayed in pink). On the bottom of the 3D view, there's a little menu with icons, click on the one circled in red opposite (or press F9), and change the values of the 2 fields with a name that fits (i.e. SnowmanBody). It is not necessary to name the object, but it's a good habit to develop :). 
Step 3 - Now switch to the front view (numpad 1), and add a 2nd UVsphere in the scene. Resize it (S) to 2 squares wide. Switch again to the object mode (Tab) (when you create an object, blender automatically switches to the Edit Mode). Name it SnowmanHead (as done in the previous stage).  Now press the G key (G=Grab) and move the head on top of the body. This is the beginning of the snowman. (You can add some "arms" later if you want, or a 2nd snowball for the body). If you're satisfied with the shape of your snowman, you can "link/join" all the elements together. Select them by pressing the B key and drawing a square all around them. Then press Ctrl+J and click on "join selected meshes".  

Step 4 - Now, let's create his face. Stay in the front view, press the space bar and choose Add > Mesh > Cone. Switch to the side view (3 on numpad). The cone is going to be the nose and, as you can see, it's much too big. Deselect all the points by pressing the A key. Then select only the points on the right (the base of the cone). Press the S key and decrease the size of the base of the cone. Switch to the object mode (Tab), and press the S key to decrease the size of the "nose" of the snowman. Then place the nose (G) onto the face of the snowman.

Note : The other sphere you can see is an arm I added to the snowman.


Step 5 - Switch to the front view (1 on numpad), add a sphere, and make it small enough (S) to be one of the eyes of the snowman. Press Tab to get into object mode, and put (G) your sphere in the place of one eye. Then, with this sphere still selected, duplicate it by pressing Shift+D, and put it (G) at the place of the second eye.  Zoom in (+) and select the 2 eyes (right-click on the first one if it's not already selected, and Shift+right-click to select the other one. They should now appear in 2 different tints of pink. Be sure to be close enough not to select the snowman instead of the eyes. If it happens, press the A key to deselect all and try again). Now, join the 2 eyes (Ctrl+J).  


Step 6 - Keep the eyes selected, move to the top view (7 on numpad), and move the eyes as shown in the picture. To make sure they're visible, press Z to switch to "Solid" mode (instead of "wireframe" mode). and move around the snowman (hold the middle mouse button down, and move the mouse). As you can see, the snowman is all grey, but we're going to make it look better. Press Z once again to switch back to the wire frame mode.  
Step 7 - In the object mode (tab) select the snowman body. Now go to the editing menu (F9 or the button that is circled) and click "Set Smooth". If you press Z now, the snowman should look smoother. Then, click on "New" to create a new material for the snowman, and click "Shading" (or F5) to go onto the shading menu.

Step 8 - Name the material "Snow", and change its RGB values to 1 to get a white color. Also set the "Hard" value to 1 (If it's bigger than 1, you'll get a grey snowman looking more like metal than snow) and the specularity value to approximately 0.24.

If you go to the solid mode (Z) once again, you'll see almost no changes. They'll be noticeable only when you make a render of the scene. (This is the F12 key. If you see nothing, don't panic, that happens if your camera is not "watching" your snowman. Select the camera (the triangular object that should be hidden somewhere in the scene - If you deleted it before, press the bar and choose Add > Camera) and use the rotation (R) & move (G) to point it at the snowman. Press the 0 key (zero on the numpad, not "o") to go into the "camera view" and check that you can see the snowman, then try to render the scene again).


Step 9 - Now, select the nose of the snowman. On the shading menu (F5) click on "Add New" to create a new material for this part. Name it "Orange" or whatever you want, and set the RGB values to an orange color.

There's a big probability that the nose will look very dark if you make a render (F12), but don't worry, as that's only a lighting problem, which we'll fix later.

Do the same thing for the eyes of the snowman (name the material "coal" and set the RGB to zero).  





The Fir Trees


Step 10 - We're going to make the fir trees on a different layer than the layer of the snowman. Layers? Yes, the 20 little squares are the layer buttons. As far as I know, you can't have more layers, and you can't name them. The first (and maybe the second) layers are selected, which means the snowman was created on the first layer (when several layers are selected, the objects are added on the *first* selected one, the most on the top-left - to select several layers, hold the Shift key when you click). Select (only) the second layer. Switch to the top view (7), and add a Cone (Add > Mesh > Cone).


Step 11 - Switch to the front view (1), and make the cone a little flatter.  To do this, select the top of the cone (right-click on it) and move (G) it. To move it only in one direction (e.g. along the z axis only) start your move in the direction you want and do a click with the middle-button. The move should now be restricted to only one axis. Click a 2nd time with the middle button to cancel. Then switch to the object mode (Tab) and increase the size (S) of the cone. Make it 8 squares wide. 
Step 12 - Keep the cone selected, and go to the shading menu (F5). Click on Add New (as in step 9), and name the new material "FirTree". Then, click on the Texture Menu button.
Step 13 - Click on "Add New" to add a texture to the FirTree material, then select "Image", because the texture will be based on an image. Click on "load image" and choose the image you'll find here.

Set the "Xrepeat" value to 2 (the Xrepeat button is underneath the "Load image" one).
Step 14 - Go to the material menu, and select the "Map Input" tab. Choose "Tube". Make sure the cone is still selected, go back to the editing menu (F9) and select "Set Smooth" (as in step 7).

By the way, the textures can't be seen in the solid mode (Z), they're visible only in renders. 
Step 15 - In the front view (1), duplicate (Shift+D) the cone, and put the duplicated cone on top of the other. Repeat this once to have 3 cones. Decrease slightly the size of the cone on the top and in the middle. You should have something looking like the picture opposite. 
Step 16 - Switch to the top view (7) and add a cylinder (Add > Mesh > Cylinder). Make it small enough (S) to be the trunk of the tree, and put it at the right place in the front (1) view.

Repeat the same things as in steps 7 and 8, (or step 9) to make them smooth and add appropriate materials. Make the material brown (R:0.500, G:0.250, B:0.000). 
Step 17 - Switch to the top view and select the whole fir tree (A or B and draw a square around it). Select the first layer (press Shift when you click on it to keep the layer with the fir tree selected). There's a big probability that the fir tree will be over the snowman, so move it (G) away. 
Step 18 - Use Shift+D to copy the fir tree and create a little forest around the snowman. (Don't put fir trees in front of him, or he'll be totally hidden from the camera). You can make some trees bigger or smaller, so it won't look too artificial (yes, I know, trees made out of 3 cones and a cylinder *do* look artificial, but let me dream it's not the case ;). Verify your scene in the front/side views (1/3) that the bigger trees are not half-underground and the smaller trees half-flying. 


The Ground


Step 19 - Select another layer and add a plane (Add > Mesh > Plane). Now select the 3 layers you used, and (with the plane still selected) grow the plane to be bigger than the forest. This is going to be the ground.
Switch to the object mode (Tab) and make sure in the front or side view (1 or 3) that the ground is not floating above the trees, but directly under them.
Step 20 - Now go to the shading menu (F5), and instead of choosing "Add New", click on the small arrows on the left of the Add New button and choose "Snow".

The Camera & Lights

Step 21 - Let's start with the camera. Select it, and try to point it at the snowman (with G and R), so that you can see the snowman and also the forest. You can go in the camera view (0) to help you (you can move the camera while you're in this view). Here I show you the place I chose to put the camera.

Step 22
- This part is a little more difficult, because the quality of the image could change a lot depending upon the lights, and there's no "magical tip" that will make them always look right. In general you'll have to try many times before creating something good. Select the light/lamp (the small yellow circle with a yellow dot inside that you can see on images 18 and 19), then go to the shading menu (F5) and click on "Lamp Buttons" (the square button with a light bulb). Select "Sun" (one of the green buttons on the left). Then try to place it (G and R) somewhere where it will light the scene properly (as in image 19 for example... Don't forget to try rendering (F12) to see what it looks like).

You'll notice that the "sun" doesn't cast shadows. Only "spots" can do that: Add another lamp (Add > Lamp) and, in the same menu as before, click on "Spot", and then on "OnlyShadow", so the spot will not light the scene but add shadows to it.

 

Step 23 - Try to place the spot approximately at this place with the grab (G) and rotate (R) tools. (I colored the snowman in red to show you where it is).
Step 24 - Select the camera, and on the shading menu (F5) try to make the "world" color sky-blue.

Step 25
- On the Scene menu (F10), select "OSA" (this will enable anti-aliasing). The 5,8,11,16 buttons below set the quality of the anti-aliasing (the higher, the best). Also select the "100%" button to render the image at 100%, and then change the values of the SizeX and SizeY (this is the size of the final image). Then you'll only have to click on the big "render" button (or F12) to start the rendering. To save your image, press F3 after the render.

 

Step 26 - Here is what it should look like :)

You'll find the Blender source of this scene below. I added some fancy stuff on the last layer (the one on the bottom right) so you can try some renderings with the 3 layers + this one.

read more "A Simple Winter Scene"

Reflections & Reflective Materials

It is sometimes said that traditional illusions are all just 'smoke and mirrors'.  In the digital world things are never that simple, but we can replicate the mirror effect with a few simple commands in Blender, giving us unique illusions of depth and complexity.  Here's you how do it:

Step 1 - Start by creating a new file in Blender. At this point you may find it useful to set up your viewports to show a camera view and perspective on the left-hand side of the window... but this is entirely up to you.   In any case, go to the render section and select the buttons indicated on the left, so that they are all pressed in.
Step 2 - Delete the cube and then press the spacebar to pull up the new object menu.  Add a plane and size it up real big ("s" then move mouse).  Position it to act as the 'floor tile' in the scene. You can, of course, make the ground anything you like (hills other mirrors, etc), but that is not the focus of this tutorial.
Step 3 - Switch to front view (num pad "1", making sure the mouse pointer is in the window) and add another "plane" to act as the mirror.  The image on the left shows you how it should look in the camera viewport (the plane being the pink square). Make it about the same size as mine.  

Step 4 - Just a quick adjustment. Right-click the "lamp" so it turns purple, and then navigate to the menus indicated in the second image. Enter my settings into your own blender dialogs.

+


Step 5 - Click on the smaller plane (the one you made in step 4), and load up the materials tab. Click "Add New", and change your settings to the ones indicated in the image opposite.
Step 6 - Now go to top view (num pad "7") and add a "UV Sphere".  This will be our object reflected in the mirror plane (unless, of course, you have a better object to reflect).  Click "OK" for the resulting object-creation menus - we don't need to set those values at the moment. Press "tab" and "g" and move the sphere down to pull it apart from the mirror plane.
Step 7 - Now, if you are sure you've done everything correctly in the steps above, you can press 'F12' on your keyboard to render your scene and admire your handiwork.

Note: Please remember that its a hard learning curve with Blender. Don't expect to get perfect results first time, and feel free to mess with all the settings to learn how things work.
Conclusion - And here is our final result!   It looks a little stark because, apart from the mirror, it has no textures or complex lighting.  You might want to attempt curved mirrors, double reflections, etc. This is something I will leave in your capable hands.

Check out the other Biorust tutorials and Blender.org for more info, inspiration, and help with the program.  Good luck!
read more "Reflections & Reflective Materials"

UV Mapping & Texturing

In this tutorial you will learn how to make a UV map of an object you wish to texture using Blender's 'seams' functionality.  By learning how to do this correctly you can apply effective detailed textures to almost any object, ushering your work into a new level of complexity and flexibility.

Note: You will need blender v2.34 (or greater), and an image editing program like Gimp or Photoshop to attempt this tutorial.
 
Step 1 - Start Blender and add a cube of an appropriate size.  Now switch to top view (Num Pad 7) and extrude the cube in the exact same way as the image to the left.    If you do not know how to use extrude, you may wish to view Blender's documentation before you proceed...  ;)
Step 2 - Exit edit mode and press F to enter face select mode. Split the main viewport in half and change the new view to the UV/Image Editor window. 

You can select faces with R-Click and Shift-R-Click, or press A on the keyboard to toggle all/none of them.
Step 3 - Select all the faces and click UV > LSCM Unwrap. You'll notice in the UV window that the Vertices are all messed up, and the faces aren't visible.  To correct this we will have to make use of seams.

While still in Face Select mode press Tab and then select the vertices indicated in the image opposite.  Press CTRL-E on the keyboard, and click Mark Seam. The newly Marked edges now have a thicker line to indicate that they are marked.

Step 4 - Here is an example of a cube 'unwrapped' into a UV map. Its basically like cutting the shape so it falls apart as a Net. Mark the seams as I have and come out of edit mode. Now select all faces and click UV > LSCM Unwrap as before.


Step 5 - If you have done everything correctly, you should have a UV map resembling the one opposite.
Step 6 - Now in the UV window rotate the edges so that they are straight. Then resize the windows and zoom in until the UV map fills your screen. Take a screenshot by pressing PrintScrn on your keyboard (next to Scroll Lock).   *OR*  as an alternative, select UVs > Save UV Face Layout, and let Blender save it as a .tga.  

Step 7 - Open up your image editor, add a new document, and paste the screenshot in.  Crop out any unwanted areas and add a number to each square in your image map - the importance of this will become apparent later.   Then save your image as a supported format (.jpg is fine), and return to Blender.


Step 8 - Restore your windows to normal and go to Image > Open in the UV window's menu. Select the image you saved in step 7  and move/resize it until it superimposes over the existing UV map perfectly.
Step 9 - In the main window switch to Textured mode to allow you to see your finished pre-rendered object with the texture applied. 

To render with the texture go to the materials tab and select TexFace. Now render your handiwork as normal.
Conclusion - And here is our final result!   Now that you know which number corresponds to each face you can, of course, do more detailed texturing work... but I'll leave that up to you!  Try practising with more advanced shapes to exercise your 3d mind further, and perfect your UV mapping technique. Have fun! :)
read more "UV Mapping & Texturing"

Particle-Based Clouds

Important - For this tutorial I will show the worded directions along with the exact keystrokes it takes to perform each step. If you are fluent enough with Blender you may not have a need for the keystrokes line. Each step within the keystrokes line will be separated by a semicolon. Arrows will indicate that you should be following a menu path.
Section 1 - Setup
Step 1:
   Let us begin by opening a new scene.

-- “Ctrl X” -OR- File>New>Erase All

If you have kept the default scene that Blender automatically sets up, you will want to delete the default cube. I normally have the screen set up to front view at the beginning.

-- “X”>Vertices ; “1”

My Screen now looks like this…

Step 2:  Add a plane. This is what the cloud will be emitted out of after the particle setting is added to the object. Skew the plane along the X-Axis by a factor of 10 and then move your view slightly to see your plane in 3D. A good way is to look through the camera. This way you will know exactly what it will look like when you decide to render your scene.

-- Add>Mesh>Plane ; “S” ; “X” ; “10” ; “0” (Camera View)

Step 3:  In order to see the clouds better when you render, move the plane back by about 5 on the Y-Axis and also by -5 on the X-Axis. In order to see the particles you must be in Object Mode. After you have done this, go to the Physics buttons and hit New in the physics tab.

-- “G” ; “Y” ; “5” ; “Enter”

-- “G” ; “X” ; “-5” ; “Enter”

-- “Tab” ; “F7” ; Click the “Physics Button” ; Click “New”


Great! We now have the particles hooked up to your plane. Right now, however, there are no particles to be seen. To see them you will have to make a few changes to the particle settings.

Section 2 - Settings & Texturing
Step 4:
   So far we have set up the basic scene for our clouds. For this tutorial I am going to show you the clouds whilst stationary. As you can see, where the New button used to reside there are now two tabs worth of settings. On the Particles tab hit the Static button. Little dots should appear on the plane. To make the particles come off the plane go to the Particle Motion tab and then change the Normal setting to .250 and the Random setting to .100.

-- Click “Static” ; Click “Particle Motion” Tab ;

-- Click “Normal” ; Type in “.250”

-- Click “Random” ; Type in “.100”



Step 5:  In order to make these particles look like clouds, we have to make a texture for them. So go to the Materials tab and click on Add New. After that all of the material buttons will appear. Click on Halo. Go into the Shaders tab and change the Halo size to “1”, Hard to “35”, and Add to “.080”. You also want to select HaloTex and Shaded. Over in the MapTo tab, turn on Alpha. Finally, you should change the RGB color to white.

Instead of doing a keystrokes line here, I have these screen shots for you to look at and match on your blender file:

Step 6:  Now go to the Texture buttons. Click Add New. Under Texturing Type select Clouds in the slide out menu.

-- “F7” ; Click “Add New”

-- Select “Clouds” under texture type


Now we have to play with the texture settings:

- In the Colors tab, (this is in the same box that the “Add new” button was in), change the “Bright” to “2.000” and the “Contr” to “4.000”

- In the Clouds box, select “Hard Noise”, set the “NoiseSize” to “2.000” and the “NoiseDepth” to “6”. to “6”.

You can see these settings in the picture below:

Step 7:  This is the moment you have been waiting for! Go ahead and hit F12 on your keyboard to see what you have created! If you have duplicated all my settings perfectly, your results should look very similar to the image below.

Step 8:  The rest is up to you. Go back and change settings to see what they do, and make changes where you think they are appropriate. Also, if you want the clouds to move, you must turn off the Static button that we clicked at the very beginning of Section 2. After that you can go into the Animation Setup (At the very top where it says “SR:2-Model" click the scroll down menu and select Animation) and you can see the particles come out of the plane as you move down the timeline.

That’s all for now! If you have any comments or suggestions feel free to E-Mail me.
read more "Particle-Based Clouds"