codex34
11-09-2011, 10:33 PM
RenderBaking
Tools needed:-
Metasequoia
3dsMax
mqo import plugin for max.
Render Baking, put simply, is a tool that allows you to place all lighting and shadows, materials and material effects, including glossiness and bumpmapping, onto a single texture.
Render baking is performed for a variety of reasons, to combine more than one texture, to overlay a material onto a texture, to add lighting effects or to simply optimise the UV layout.
In this tutorial we are going to combine 3 textures, optimise the UV layout and add lighting effects for a metasequoia model, the model will then be export back into metasequoia.
MODEL SETUP
First we finalise our model and place it into a single object, by finalise I mean make sure all faces have a material and have the model 'finished'.
It doesn't have to be in a papermodel-able state just so long as you don't need to move parts you can cut the model up later.
The image below shos the model as a single object with 3 textures.
http://i1235.photobucket.com/albums/ff428/codex34/renderbaking/meta1.jpg
Our next task is to import the model into 3dsMax.
Start max, setup your user interface how you like it, file -> import -> find the file you need.
Once in max you can rotate, pan and zoom the model with the tools at the bottom right.
A quick render, without any render setup, will show you what the output will look like.
http://i1235.photobucket.com/albums/ff428/codex34/renderbaking/max1.jpg
LIGHTING SETUP
Now we need to set up a skylight and a plane to bounce light off.
The skylight is in the create -> lights -> standard lights -> skylight
Place the skylight wherever you want, it's just there to tell the renderer a skylight is to be used, it's position is unimportant.
Next create a plane create -> standard primitives -> plane.
Drag to make a plane and then change the size to 2000x2000 and move it to 0,0,0
In the material editor, select a blank material and apply it to the plane, this allows you to control the bounce light more effectively than leaving the plane in the standard colour.
The image below shows the scene with a plane, a skylight and the model we are using
http://i1235.photobucket.com/albums/ff428/codex34/renderbaking/max2.jpg
Now do a quick render to see the difference from the last render.
This will also let us set up the renderer for the render baking.
Click render under the rendering menu, select the advanced lighting tab and select light tracer in the dropdown.
The render dialog for max 7 is shown below
http://i1235.photobucket.com/albums/ff428/codex34/renderbaking/max3.jpg
We can set the quality of the render with rays/sample, 25 is low quality 250 is high quality.
I set it to 25 because I like the low quality look and because it renders faster.
I also set the bounce to 1, this is the ammount of times the light ray will bounce off objects, play with this setting when you get more experience, 1 is good for now.
A note to mention is that a higher number of bounces increases the render time.
Now click render to see the result.
http://i1235.photobucket.com/albums/ff428/codex34/renderbaking/max3render.jpg
As you can see the skylight and bounce lightens up the model and provides some shadow detail.
Setting up the lighting is important as this affects the final output considerably.
As it is the model lacks directional lighting so lets set up a spotlight.
create -> standard lights -> target spotlight.
You create this by clicking where the spotlight will go and dragging the mouse to where it should point.
You can move both the spotlight and target at any time
http://i1235.photobucket.com/albums/ff428/codex34/renderbaking/max4a.jpg
http://i1235.photobucket.com/albums/ff428/codex34/renderbaking/max4b.jpg
http://i1235.photobucket.com/albums/ff428/codex34/renderbaking/max4c.jpg
A quick render will show you the results.
http://i1235.photobucket.com/albums/ff428/codex34/renderbaking/max4render.jpg
http://i1235.photobucket.com/albums/ff428/codex34/renderbaking/max4renderb.jpg
AS you can see the result is alot better, the front is lit and the rear is in shadow, exactly what we want for this particular model.
You can add and move lights to wherever you want for the result your looking for.
Spotlights can even be used to add specular effects without affecting the ammount of light used to light the textures.
Lights can be adjusted in brightness and colour.
UV SETUP
So once your happy with the light setup and how the model rendered you need to set up the model to produce the render baked texture.
We need to 'unwrap' the UV coordinates.
First select the just the model.
Then goto menu -> modifers -> UV Coordinates -> Unwrap UVW.
http://i1235.photobucket.com/albums/ff428/codex34/renderbaking/max5.jpg
This will automatically bring up the modify section in the right hand panel.
The FIRST thing you do is click the save button on the right.
Save the current UV's with a name like modelORIG.uvw
*********************************
NOW SAVE THE ENTIRE SCENE TO FILE
*********************************
Now we need to set the map channel to 2, this is so the original textures are kept in channel 1 and the renderbaked image is in channel 2.
http://i1235.photobucket.com/albums/ff428/codex34/renderbaking/max6.jpg
You will get a prompt to make sure you want to do this, click 'yes'
After clicking yes to the prompt the UV coordinates will be automatically unwrapped, you will see the green lines change as in the image below.
compare this to the previous images.
http://i1235.photobucket.com/albums/ff428/codex34/renderbaking/max7_1.jpg
Now we didn't want it to automatically unwrap so click load to reload the UV's you saved a moment ago.
http://i1235.photobucket.com/albums/ff428/codex34/renderbaking/max7_2.jpg
Notice how the green lines change back to how they were before.
Now we can edit the UV's so click the edit button
http://i1235.photobucket.com/albums/ff428/codex34/renderbaking/max7a.jpg
What you see is the edit UVW's dialog with the original UV's displayed.
You should notice in the image that some of the UV mappings overlap others, this is because the model had 3 textures so there will be some overlap, this is normal.
We can't leave the UV's like this because some parts of the model would get textured with images belonging to other parts.
So in the dialog select tools -> pack UV's
http://i1235.photobucket.com/albums/ff428/codex34/renderbaking/max7b.jpg
Set the pack dialog with the options as shown in the image below
Then click ok
http://i1235.photobucket.com/albums/ff428/codex34/renderbaking/max7c.jpg
The UV's will now be re-arranged as shown below.
You can adjust the UV's to your own requirements, we won't do it here, but on this model the shoulder UV's are quite large, we can reduce the size of these and repack the UV's
Now SAVE these UV's with a name like modelPACKED.uvw
http://i1235.photobucket.com/albums/ff428/codex34/renderbaking/max7e.jpg
************************************************** *
NOW SAVE THE ENTIRE SCENE FILE TO A DIFFERENT NAME.
************************************************** *
Tools needed:-
Metasequoia
3dsMax
mqo import plugin for max.
Render Baking, put simply, is a tool that allows you to place all lighting and shadows, materials and material effects, including glossiness and bumpmapping, onto a single texture.
Render baking is performed for a variety of reasons, to combine more than one texture, to overlay a material onto a texture, to add lighting effects or to simply optimise the UV layout.
In this tutorial we are going to combine 3 textures, optimise the UV layout and add lighting effects for a metasequoia model, the model will then be export back into metasequoia.
MODEL SETUP
First we finalise our model and place it into a single object, by finalise I mean make sure all faces have a material and have the model 'finished'.
It doesn't have to be in a papermodel-able state just so long as you don't need to move parts you can cut the model up later.
The image below shos the model as a single object with 3 textures.
http://i1235.photobucket.com/albums/ff428/codex34/renderbaking/meta1.jpg
Our next task is to import the model into 3dsMax.
Start max, setup your user interface how you like it, file -> import -> find the file you need.
Once in max you can rotate, pan and zoom the model with the tools at the bottom right.
A quick render, without any render setup, will show you what the output will look like.
http://i1235.photobucket.com/albums/ff428/codex34/renderbaking/max1.jpg
LIGHTING SETUP
Now we need to set up a skylight and a plane to bounce light off.
The skylight is in the create -> lights -> standard lights -> skylight
Place the skylight wherever you want, it's just there to tell the renderer a skylight is to be used, it's position is unimportant.
Next create a plane create -> standard primitives -> plane.
Drag to make a plane and then change the size to 2000x2000 and move it to 0,0,0
In the material editor, select a blank material and apply it to the plane, this allows you to control the bounce light more effectively than leaving the plane in the standard colour.
The image below shows the scene with a plane, a skylight and the model we are using
http://i1235.photobucket.com/albums/ff428/codex34/renderbaking/max2.jpg
Now do a quick render to see the difference from the last render.
This will also let us set up the renderer for the render baking.
Click render under the rendering menu, select the advanced lighting tab and select light tracer in the dropdown.
The render dialog for max 7 is shown below
http://i1235.photobucket.com/albums/ff428/codex34/renderbaking/max3.jpg
We can set the quality of the render with rays/sample, 25 is low quality 250 is high quality.
I set it to 25 because I like the low quality look and because it renders faster.
I also set the bounce to 1, this is the ammount of times the light ray will bounce off objects, play with this setting when you get more experience, 1 is good for now.
A note to mention is that a higher number of bounces increases the render time.
Now click render to see the result.
http://i1235.photobucket.com/albums/ff428/codex34/renderbaking/max3render.jpg
As you can see the skylight and bounce lightens up the model and provides some shadow detail.
Setting up the lighting is important as this affects the final output considerably.
As it is the model lacks directional lighting so lets set up a spotlight.
create -> standard lights -> target spotlight.
You create this by clicking where the spotlight will go and dragging the mouse to where it should point.
You can move both the spotlight and target at any time
http://i1235.photobucket.com/albums/ff428/codex34/renderbaking/max4a.jpg
http://i1235.photobucket.com/albums/ff428/codex34/renderbaking/max4b.jpg
http://i1235.photobucket.com/albums/ff428/codex34/renderbaking/max4c.jpg
A quick render will show you the results.
http://i1235.photobucket.com/albums/ff428/codex34/renderbaking/max4render.jpg
http://i1235.photobucket.com/albums/ff428/codex34/renderbaking/max4renderb.jpg
AS you can see the result is alot better, the front is lit and the rear is in shadow, exactly what we want for this particular model.
You can add and move lights to wherever you want for the result your looking for.
Spotlights can even be used to add specular effects without affecting the ammount of light used to light the textures.
Lights can be adjusted in brightness and colour.
UV SETUP
So once your happy with the light setup and how the model rendered you need to set up the model to produce the render baked texture.
We need to 'unwrap' the UV coordinates.
First select the just the model.
Then goto menu -> modifers -> UV Coordinates -> Unwrap UVW.
http://i1235.photobucket.com/albums/ff428/codex34/renderbaking/max5.jpg
This will automatically bring up the modify section in the right hand panel.
The FIRST thing you do is click the save button on the right.
Save the current UV's with a name like modelORIG.uvw
*********************************
NOW SAVE THE ENTIRE SCENE TO FILE
*********************************
Now we need to set the map channel to 2, this is so the original textures are kept in channel 1 and the renderbaked image is in channel 2.
http://i1235.photobucket.com/albums/ff428/codex34/renderbaking/max6.jpg
You will get a prompt to make sure you want to do this, click 'yes'
After clicking yes to the prompt the UV coordinates will be automatically unwrapped, you will see the green lines change as in the image below.
compare this to the previous images.
http://i1235.photobucket.com/albums/ff428/codex34/renderbaking/max7_1.jpg
Now we didn't want it to automatically unwrap so click load to reload the UV's you saved a moment ago.
http://i1235.photobucket.com/albums/ff428/codex34/renderbaking/max7_2.jpg
Notice how the green lines change back to how they were before.
Now we can edit the UV's so click the edit button
http://i1235.photobucket.com/albums/ff428/codex34/renderbaking/max7a.jpg
What you see is the edit UVW's dialog with the original UV's displayed.
You should notice in the image that some of the UV mappings overlap others, this is because the model had 3 textures so there will be some overlap, this is normal.
We can't leave the UV's like this because some parts of the model would get textured with images belonging to other parts.
So in the dialog select tools -> pack UV's
http://i1235.photobucket.com/albums/ff428/codex34/renderbaking/max7b.jpg
Set the pack dialog with the options as shown in the image below
Then click ok
http://i1235.photobucket.com/albums/ff428/codex34/renderbaking/max7c.jpg
The UV's will now be re-arranged as shown below.
You can adjust the UV's to your own requirements, we won't do it here, but on this model the shoulder UV's are quite large, we can reduce the size of these and repack the UV's
Now SAVE these UV's with a name like modelPACKED.uvw
http://i1235.photobucket.com/albums/ff428/codex34/renderbaking/max7e.jpg
************************************************** *
NOW SAVE THE ENTIRE SCENE FILE TO A DIFFERENT NAME.
************************************************** *