LuxBlend tutorial: image textures and mix materials
Views
Personal tools
From LuxRender Wiki
This tutorial shows how to apply textures to objects using Blender and LuxRender. As LuxRender only takes care of rendering, textures will have to be applied within Blender and materials will have to be defined in LuxBlend.
Basic modelling knowledge in Blender and some familiarity with LuxRender are assumed as this tutorial does not cover modelling and lighting. If the instructions for UV mapping are unclear, please refer to Blender wikibooks or leave some feedback on the forum.
This tutorial uses Blender 2.46 and LuxRender 0.5.
Contents |
introduction
In this tutorial, we will be applying a logo to a mechanical pencil. The object that is used as an example is created by drawing the section of the pencil as a bezier curve, spinning it around a bezier circle, converting it to a mesh and separating it in several parts. However, the part where the logo will be applied is just a cylinder, so you could follow this tutorial just by creating a cylinder object in Blender.
image map preparation
Assuming that by now you have created a cylinder object (or a cylindrical part of the pencil), the only other thing we need is a texture. The Blender logo will be used here. It will turn out to be convenient to have a bit of space on all sides, so open the image in your favourite image editor, increase the canvas size and fill the area around the logo with the background colour.
unwrapping / uv mapping
Now that we have the cylinder model and an image, we need properly position the image on the model. For this, we will use Blender's UV/Image Editor window.
An easy way to unwrap the cylinder is to mark one of the edges as a seam. This is the point at which the cylinder will be cut and where seams in the texture may appear, so it's best to do this at a part of the object that won't show from the camera. To do this, go to edit mode, select the edge, press cntrl-E and select mark seam.
While staying in edit mode, select all, press u and select Unwrap. This will create a projection of all faces of the object in the UV/Image Editor window.
In the UV/Image Editor window, go to the image menu, choose open and select the file you have prepared for the logo. The image should now appear in the UV/Image Editor window.
Although most likely not at the right spot, the logo will also show in the 3D View - at least, if "Solid Tex" is selected in the View Properties. So after making any changes in the UV/Image Editor window, you should see the result in the 3D View right away.
You might need to rotate the whole object 90 degrees in the UV/Image editor. This is done by pressing A to select all, then type R to rotate and 90 for a 90 degree angle. Additionally, some scaling is probably necessary in both the x and y direction.
Once the logo is placed to your liking, we can move on to assigning the material.
method one: assigning a texture to diffuse and specular channels
LuxRender looks at Blender's material assignments to decide which materials belong to which object, but other than that, all material characteristics are defined in LuxBlend.
If you haven't done so yet, go to Blender's Shading panel (F5), create a new material and give it a name. Once this is done, create a LuxBlend window, go to the material tab and select the material you have just created.
In this case, we will use a plastic material, so select plastic in the material type dropdown menu. Now the only thing we need to do is assign the logo image to both the diffuse and the specular channel. This is done by first pressing the T button on the right, then pressing the button marked ... on the right of the file: field.
That's all. After setting up some lighting to your liking, the logo will appear on the pen.
method two: using a mix material
Using the method mentioned above, all parts of the object will have the same material type - although various colours are used, both the logo and the background are of the plastic material. If we want the logo to be of a different material, we can accomplish that by making use of the mix material.
The mix material can combine two other materials based on the brightness value of an image. Therefore, we first need to create an image where the background is white and the logo is black, then use this image in the mix material and finally define the two materials that are to be used. To avoid problems with the uv mapping, make sure that the resolution of the image does not change/
After having created the black and white image of the logo in your favourite image editing program, go to the material panel in LuxBlend and change the material type of the object we're working on to mix. Set the amount to one and press the T button, then locate the black and white image using the ... button on the right of the file field.
The mix material texture should use the same uv mapping coordinates as the other textures, so assigning two different materials to the mix material's mat1 and mat2 slots should already result in a logo that is made of a different material.
To make the logo appear in colour, we can just apply the original image to the diffuse and specular channels of one of the mix material's materials. As both textures use the same uv mapping coordinates, the logo should appear exactly at the right place.








