Learning Blender 3D - understanding & editing materials
Having used a background image to help in making and editing the low poly sword mesh, then applying Smooth Shading through the use mesh smoothing and smooth groups, we can now move on to setting up and editing a basic material with its associated texture image. The follow chapter will discuss what Materials are alongside their use and general set-up.
Understanding Materials ^
With the swords construction done and smooth groups assigned it's time to look at "Materials". Because of what we'll be doing at a later stage with UVW maps only a single material is necessary, and as the original cube already had one assigned by default we'll be using that. Before progressing any further however, we need to understand the basics of Materials in Blender.
For the purposes of what we're doing in this tutorial (making a low poly sword model for use in some form of 'game' environment), a 'material' is composed of three distinct components, each usually referred to as a 'stage' or 'slot';
a "Material" stage/slot.
a "Texture" stage/slot.
an "Image" stage/slot.
These three separate stages in combination form a "'global' material", i.e. a decorative 'layer' that changes the outward appearance, but not structure, of an object as a whole, hence its 'global' nature. This is then managed through two sets of "Properties" - a set of "Material" properties and a set of "Texture" properties - each having numerous options and settings associated with their respective functions.
Design note: it's important to understand the difference between the nomenclature "Material", what the collective data set is called, and the individual "material" slot that's a component of that collective data.
Material Properties ^
For the purposes of what's needed within the context of this tutorial, a "Material" effectively serves as a 'container' for an associated set of "Texture" properties. As this is all we need, and although the material properties do provide numerous options and settings, they can be largely ignored.
To access "Material" settings click the button marked with a 'sphere' icon in the "Properties" section of the interface (right hand side). This opens all the tools and option associated with making, editing and applying materials to objects in Blender, and as there is one already applied to the mesh by default we only need to 'edit' it to see those changes apply automatically.
The general properties associated with a "Material". 1) the materials name. 2) input field for renaming the material 'datablock' as it's properly called. 3) the material preview, currently a sphere - textures display here once applied. 4) diffuse colour changes the underlying colour of the material [see *.blend "27a"]
Texture Properties ^
The most important aspect of a Material for us is its "Texture" settings. Typically the properties held in this slot relate to and control 'bitmap' assignments as well as vital information on how that data is subsequently used and 'mapped' (applied) over a mesh as a 'texture'. In practice this means we need to assign an image to the 'texture' and then tell Blender how that image is to be used.
To access "Texture" settings click the button marked with a 'checker' icon in the "Properties" section. This provides access to the various options for managing both the "Texture" and the "Image" slots of the Material. From here we need to pay particular attention to two types of 'properties'; "Type:" - available directly under the textures slot list, and "Coordinates:" - available within the "Mapping" sub-section (shown below). Each setting has a drop-down list from which we need to select "Image or Movie" and "UV" respectively. This will leave us with "Type: Image or Movie" and "Coordinates: UV".
The general properties associated with "Texture" slots. 1) the textures name. 2) the input field to rename the texture. 3) the "Type" of object the texture should be - a drop down selection list. 4) how the texture is applied or 'mapped' to the object - again a drop down list provides a number of options
Selecting "Image or Movie" from the "Type" drop down list which tells Blender what 'type' of texture is being created
Selecting "UV" from the "Coordinates" list. This tells Blender that the texture will be 'mapped' to the object based on UVW unwrapping (see below) [see *.blend "27b"]
Materials, Textures & Images ^
An additional set of properties is activated on doing the above, we're specifically interested in the "Image" sub-section - this is where bitmaps to be used as the texture image is loaded into Blender, as we're using the default material we only need to load one in.
In the "Image" section click the button titled "Open" to access the "File Browser", this will display the files available for use. Browse to or select an image file (either one supplied in the sword tutorial source file or one you have available - make sure they are the correct size so read the paragraph below), then click "Open" top-right of the File Browser interface to load in the bitmap and automatically change the "Image" properties to show "Source" and 'name' information - this is accompanied by an additional change to the "Preview" window which will also update automatically to show a sample of the image just loaded (see below).
Once "Type" and "Coordinates" have been set, load an image by clicking "Open"...
... this opens the "File Browser" where an image is selected. Note "Relative Path" is set to make sure the image loads 'locally' using a path that relates to the Blender file rather than the images location on the hard drive
"Image" settings change once image is loaded, displaying the texture path and other information. "Preview" also displays the texture image [see *.blend "27c"]
With an 'image' assigned to the 'texture', if we now click the "Material" button again to view those properties we'll see the sample sphere now covered in the texture image we just assigned (blue checker in this instance) indicating both the "Texture" and "Image" stages has been correctly set up.
The final material showing the texture image on the sphere [see *.blend "28"]
Material Diffuse colours ^
Although we have all the "Material" settings we need in place there is one more that, whilst not absolutely necessary in this instance, is quite useful. That's the "Diffuse" colour setting. In practice this allows a mesh and its materials to be identified by colour rather than texture so if we wanted, the blade, handle, guard and pommel of the sword could have individual materials assigned all-the-whilst using the same texture.
To change the Diffuse colour, first press "Z" to switch from "Wire" (which we've been in whilst setting up the material) and into "Solid" view. In the "Diffuse" sub-section below the preview window, click what is currently the white input field (shown in orange below during colour selection), a circular colour wheel will appear. Select a colour by LMB clicking or LMB+hold+drag - if the material is properly assigned to the mesh its colour should change as the material colour changes. Press "Enter" to set the colour once its chosen. The entire mesh now has a "Diffuse" colour assigned to the object
Switch to "Solid" view and change the "Diffuse" colour to check material assignment by selecting a colour from the sampler. RGB values for the illustration above are R:0.800, G:0.391, B:0.00 [see *.blend "28b"]
Texture Density ^
There is an important side issue to mention at this point before going any further and that's the "Power of Two" rule. A more detailed tutorial is available here that explains this in depth but suffice to say here that we need to make sure that all texture assets are properly sized (the exception being the background image, that's used 'as is'). For the purposes of this tutorial that means making sure images are "256x256", "512x512" or divisions/multiplications thereof - do not use 'odd' sized assets, "294x309" for example.
Next we'll discuss UVW unwrapping the mesh and applying the texture image.