Lightmap with Mental Ray:
Set a middle tone grey as your environment color of your camera and a brighter grey for your object ...
Press "F5" and select your object. Then go to "Lighting/Shading" > "Assign New Bake Set" > "Texture Bake Set". Now you can adjust the settings as you want ...
With your object still selected go to "Lighting/Shading" > "Batch Bake (mental ray)" (optionbox). For "Color Mode" I normaly choose "Incoming Illumination Only" ...
Then click "Convert and Close" ...
Don't forget a lightsetup (or "Enable Default Light") and the "Render Global Settings" (global illumination, final gather, sampling quality ...) before rendering the lightmap.
Rendering a lightmap with mental ray takes time!
Lightmap with Maya Software:
Open the Hypershade, select your object and shift-select the material on what you want your lightmap to be baked on. Under "Edit" (in the Hypershade) and click on the optionbox of "Convert to File Texture (Maya Software)". Make your settings and click "Convert and Close" ...
In both cases make testrenderings first ...
If you have a different uv layout for your lightmap than for your diffuse map just work with two maya files.
One file with your object and two uv sets (first for diffuse, second for lightmap). Use this file to export your mesh.
Then copy the uv coordinates from the second uv set to the first and delete it (2nd). Save that as a new Maya file. Use this file to render your lightmap (somehow Maya didnt manage to bake the lightmap onto the second uv set)
To define what texture has to be on your sets in Ogre you have to write something like that in your material file ...
Code: Select all
material model_01
{
technique
{
pass
{
texture_unit
{
texture model_01_diff.jpg
tex_coord_set 0
}
}
pass
{
scene_blend modulate
texture_unit
{
texture model_01_light.jpg
tex_coord_set 1
}
}
}
}
Hopefully I made no mistake

...