14 min read

 

Blender 2.5 Materials and Textures Cookbook

Blender 2.5 Materials and Textures Cookbook

Over 80 great recipes to create life-like Blender objects

  • Master techniques to create believable natural surface materials
  • Take your models to the next level of realism or artistic development by using the material and texture settings within Blender 2.5.
  • Take the hassle out of material simulation by applying faster and more efficient material and texture strategies
  • Part of Packt’s Cookbook series: Each recipe is a logically organized according to the surface types with clear instructions and explanations on how these recipes can be applied across a range of materials including complex materials such as oceans, smoke, fire and explosions.

Introduction

Organizing your work, as you develop any project, will ensure that you achieve your task sooner and more efficiently. How to do this in Blender may not be immediately obvious. However, Blender has a raft of tools that will make your life, as a materials creator, so much easier. This article deals with the techniques that can be used to organize your textures and materials, and thus encourage some order to complex tasks.

While Blender can be a very flexible 3D suite, allowing the designer more than a single approach to a simulation, it is better to develop a more ordered strategy to your material and texture creations.

We will explore several recipes that attempt to show how to control material creation. However, apart from the inbuilt tools, there are several setups that will be dependent on personal preference. You are therefore encouraged to modify any of these recipes to suit your own approaches to organizing material production.

Setting a default scene for materials creation

It’s always a good idea to set the initial state of Blender to suit your needs. For us, the primary task is to explore materials and texture creation. When you first install Blender, a default layout will be presented. From here, you can perform most tasks, such as modeling, and rendering, as you create your desired objects. We can aid the process of surface creation by improving the lighting in the default setup. Adding a second light can give better definition to objects that are rendered.

Getting ready

When you first download Blender, the default factory settings provide a simple cube illuminated by a single light. Even if you have already changed some of these defaults, you will be able to apply the suggested changes in this recipe on top of your personalized settings. So, you can either start with the factory settings or your own.

How to do it…

  1. Start Blender, or select New from the File menu. This will ensure that any previous default settings are loaded.
  2. Move the mouse cursor into the main 3D view and press SHIFT+A to bring up the Add menu and select Lamp of type Hemi.
  3. Move, and rotate the lamp so that it will illuminate the shaded side of the default cube. Try to adjust its height and distance from the object similar to the default lamp.
  4. From the lamp menu, set the Energy value between 0.200 and 0.500. Render a quick scene and adjust as necessary.

    Managing Blender Materials

  5. Move to the Render panel.
  6. In the Dimensions tab, select Render Presets. From the list, select HDTV 1080p. This will give a render size of 1,920 x 1,080 square pixels. However, alter the Resolution percentage slider to 25%. Just below the Aspect Ratio settings are two buttons, check Border and then ,Crop. Now, uncheck Border. This might seem strange but although the Crop checkbox is grayed out it is still set.
  7. Ensure the Anti-Aliasing tab is selected, and the figure below that is set to 8, with the anti-aliasing method set to Mitchell-Netravali. Ensure that the Full Sample is NOT, set.
  8. Under Shading, ensure Textures, ,Shadows, Ray Tracing, and Color Management are set, while Subsurface Scattering and Environment Map are not.
  9. Move down to the ,Output tab and from the list of choices select PNG. You can also change the Compression percentage to between 0% for a loss less saved image or up to 100% for full compression. I usually set to 0% to produce the clearest images.
  10. Finally, in the Performance tab, ensure that Threads is set to Autodetect.
  11. You can save these settings as the default scene by pressing CTRL+U and selecting Save User Settings. Now, whenever you restart Blender, or select a new scene, you will have a better lit setup with render settings providing an ideal environment to create materials.

How it works…

The recipe provides a relatively simple set of changes to the factory default scene. However, they are ideal for materials creation because they make it easier to judge the surface characteristics as you develop the material.

We started by improving the default lighting by adding a second light to give a little more illumination to the shaded side of the objects you will be creating materials and textures for. Being able to set this as the default scene means we don’t have to worry about special light setups every time we create a new material. It also helps with consistency because the levels of light will be very similar between every new material you create. It is not there to provide the finished lighting for every scene you create, but just to give a more even illumination when you test render materials you are developing.

Managing Blender Materials

What we have done is produced a key light and a fill light, which is the minimum in almost any 3D lighting arrangement. The Hemi light offers a nice broad illumination but will not cast shadows. This is ideal for a fill light as it can represent bounced light off of ceilings, or walls, or even the outside world. The Point light source acting as our key light will cast shadows just as the strongest light in a natural environment would.

When you have developed your materials, you can light the actual scene with a more complex or artistic lighting setup if you wish.

For the majority of digital work, we need to use square pixels and a resolution that matches the size we wish to render to. Here, we have set the render size and resolution from the presets to HDTV 1080p. This produces a relatively large render area with square pixels. Square pixels are really important when developing objects or materials for digital work. It’s possible to set different aspect ratios that would alter the screen and render proportions, which are of no value when creating models or developing and placing textures on them. If you eventually want to render out to these none square pixel ratios, do so only when all you’re modeling and scene creation is finalized.

The render panel offers several useful presets. These are based on screen resolution and pixel aspect ratio to exactly match the desired output. Be careful not to inadvertently select one of the non-square pixel ratios, like HDV 1080p.

In the same step, we set the render resolution down to 25%. This will still give a render size of 480 x 270, which is OK for initial quick renders to check how a material is progressing. You can easily scale that up to 50% or 75% for more detailed renders. However, these will obviously increase the render times.

If you create a border in the camera view, by pressing SHIFT+B, and dragging the orange dotted border, Blender will only render what’s inside that rectangle. This is why we also checked the Crop checkbox so that Blender automatically crops the rendered image. If you perform a bordered render without the Crop set, the unrendered part is filled with black pixels. Therefore, setting the crop checkbox will ensure it will be cropped if selected. This will save valuable render time and also smaller image saves.

Anti-aliasing

Even if we are rendering to a large size, we should set Blender to anti-aliase the resultant render to remove the jagged edges that would otherwise appear. Here, we have set the antialiasing method to Mitchell-Netravali. This is probably the best of the available options. It will give very reasonable anti-aliasing at the relatively low setting of 8 without unreasonable render times. For final render, you might want to consider raising the level to 16.

Turning off unneeded render settings

Subsurface scattering and Environment map are not always required so can be turned off in the default scene. They can always be turned on for a particular material simulation that might require them. However, normally, they are not required and render times will be reduced by having them turned off.

If you are working on a material that requires environment mapping or subsurface scattering, you can set these, then save your first file of the simulation. Saving a blendfile will save all additional settings as well as objects and materials.

Blender offers an enormous range of output formats for your rendered still or animation masterpieces. You will not need to use them all so which should we choose as a default?

PNG (Portable Network Graphics) has lossless data compression, as compared to JPG which is lossy, and therefore, the picture is degraded every time you save. However, PNG can efficiently compress images without the subsequent loss of quality. It can also handle alpha channels. It can be read by most web browsers so is suitable for the Internet. Because Blender can render an animation as a series of still images, it is ideal for producing animations as well. Several video editors, including Quicktime, Adobe Premiere, and of course Blender, can take these sequenced still PNG images and combine them into movie formats like .mov, .avi, .mp4, .mpeg, and so on. I would therefore suggest that PNG is probably the best all-round image format to set as default.

If you’re primary work is in either the game development, or print, fields you might want to consider using TGA (Truevision Advanced Raster Graphics Adapter), or TIFF (Tagged Image File Format). However, windows-based systems will not display thumbnails of TIFF formatted images at this time.

There’s more…

There are other settings that you may want to consider as appropriate in a default scene. You can set locations of often used resources from the Blender User Preferences window, CTRL+ALT+U. Under the file menu of this preferences window, you can set file paths for such things as Fonts, Textures, Render Output, and so on.

Many of these locations will be specific to your operating system and where you choose them to be. Blender defaults are fine, but if you want to be specific go to this window and enter your appropriate choices. To ensure they are saved as default, click the Save User Defaults button, or press CTRL+U.

(Move the mouse over the image to enlarge it).

Additional settings for default scene

If you have a powerful enough computer system, you might want to consider setting some more advanced options to make your test renders look really special. In some ways, what you will be doing with this recipe is creating a more production-ready materials creation environment. However, each render will take longer and if it is a complex mesh object with transparency and multiple large-scale image textures, you may have to wait several minutes for renders to complete. Although this may not seem to be a significant disadvantage, the extra render time can build up as you produce multiple renders to test the look of a material simulation.

The renders reproduced in this article, and online, were created with these additional settings. The majority of development work also used these additional settings. While the majority of the simulations only took a few minutes to render at maximum resolution, one or two took a little longer. If that is the case it can slow down your material development, just turn some of these additional settings off before your first save of the blendfile. Any settings will be saved with the blendfile.

Getting ready

As we are adding additional settings to the default scene, ensure you have either just started Blender, or selected New from the File menu. This will set Blender back to the default scene ready for you to append the additional features suggested here.

How to do it…

    1. In the 3D window, ensure that the cursor is at the center. SHIFT+S, Cursor to Center.
    2. Add new object of type plane. SHIFT+A, Mesh, Plane.
    3. Scale the plane by 50 Blender units. The easiest way to achieve this is to type S, enter 50 and press the ENTER key to confirm.
    4. Grab the plane and transpose it down -1 in the Z direction. You can either select the plane, then type G, Z, -1, and ENTER to confirm. Or press N to bring up the Properties panel and alter the Z location to -1.000.

That has ensured that the plane is below any object you create from the origin. New objects are created at the cursor position and are always 1 Blender unit from their own origin, which will mean they should stand on the ground plane you have just created.

    1. Move to the Materials panel and create a new material, naming it ground.
    2. Under the Diffuse tab, change its color to R, G, B 1.000 or pure white.
    3. In the Specular tab, change the type to WardIso with an Intensity of 0.250, and a Slope of 0.300.
    4. Under the Shadow tab, select Receive and Receive Transparent.

That has set up the ground ready to act as a shadow-receiving backdrop to our material creations. However, we need to set up a better shadow than that in the default key light setup.

    1. Select the key light.
    2. From the Light panel, select the Shadow tab and set Ray Shadow with Sampling set to Adaptive QMC, with Samples set to 6, and Soft Size of 1.000 and Threshold 0.001.

Finally, we will set up ambient occlusion to give our models a little more shape.

  1. Move to the World panel and select Ambient Occlusion. Set its Factor to 1.30 and its Mix type to Multiply.
  2. In the Gathering tab, select Approximate, with Attenuation/Falloff selected and its Strength changed to 0.900. Set Sampling/Passes to 6.
  3. Select the Render tab, then save this as the new default setting by pressing CTRL+U.

    Managing Blender Materials

How it works…

The plane is there just so that any shadows will have somewhere to fall. Shadow casting is normally created as a default once an object has a material assigned. In step 19, we also said let the plane receive transparent shadows. That means that objects casting shadows with an alpha component such as windows, or transparent materials, will have accurate shadows showing that transparency.

We also set up soft raytrace shadows by turning on this feature for the key light. The important setting here is the number of samples. Too low and the shadow will look fake. Too high and the render times will become rather lengthy. Setting this to 6 is a good compromise for accuracy and speed.

Finally, we have set up ambient occlusion, which simulates the darkening of shadows in crevices and shaded portions of a model. The higher the Factor level, the darker the ambient occlusion will become. Essentially, the darkening is being multiplied on top of the rendered image, although it can also be set to Add.

Full raytraced ambient occlusion can take some time to compute, so it is good news that Blender has an excellent Approximate method, which is very quick. The Attenuation and Passes can be tweaked to give the best balance between accuracy and render time. Too low a setting will produce a spotty darkening that is not very real. We set Passes at 6, which is another excellent compromise. Ambient occlusion is only available if you render with raytrace enabled.

To save all these extra setting as the default, we only had to press CTRL+U. Now, whenever you start a new scene, these settings will be pre-set.

There’s more…

Occasionally, you may go too far with default settings and find that render times become too long when you only want to check how a material is progressing. Another common problem is that users will sometimes inadvertently save a pre-created scene as the default. If this happens, you can always return to the factory settings by pressing CTRL+N or choosing the Load Factory Settings from the File menu.

As you will be doing this regularly, the default light setup is perfectly adequate. However, for a ‘hero’ render, I would recommend the following settings:

Lights

Your key light, the one to the right of frame, should be set to Energy 0.500. Under the Light panel, set ShadowRay Shadow. Under Sampling, set to Adaptive QMC and Soft Size to 5.318, and Samples to 6. This will create a nice soft shadow, which is more realistic than the sharp ray shadows produced by the default settings.

Ambient occlusion

Ambient occlusion can produce a nice darkening of overall illumination around those shaded parts in our renders. It adds a decent approximation of how real light and shadow spread through an environment giving a render depth.

In our example, a Blend sky has been set in the World panel, with a Horizon color R and G set to 0.80, and B set to 0.69. The Zenith color has been set to R 0.69, G 0.75, and B 0.80.

Ambient Occlusion has been selected with the following settings: Factor 1.00, and Multiply. Under Gather, Raytrace is selected and Sampling is set to Adaptive QMC, with Samples 24. Threshold and Adapt To Speed are all set to defaults. Under Attenuation, Distance is set to 10.000 with Falloff and Strength set to 0.220.

LEAVE A REPLY

Please enter your comment!
Please enter your name here