I watched that tut on high res to low res baking with mudbox then Bobbysoon mentioned that this was possible with just 3ds max ( i have zbrush but dont know how to use it yet) so i looked in my Deep Creator tutorials folder ( a not too bad 3ds modeling prog which can open .max files) and there is a nice big section on Render to Texture and Baking so i uploaded it for you guys this is the basic tut (in the dload file there are pics to follow)
This is a tutorial for Deep Creator but it explains well how to render to texture.
http://files.filefront.com/dc+tutorialschm/;9198543;/fileinfo.html its in the shadows,lights and surfaces section.
Baking Lighting in 3ds max for Import
One of the most limiting factors in DirectX, from an artist's point of view, is the restrictions and limitations involved with lighting. Because lighting works on a per vertex basis, and in-app shadows can be quite costly (resources), it is worth looking into "baking" the lighting into a texture and adding it as a material stage.
Obviously, this will use more texture memory, so, as with most features, one must use the resources sparingly and economically to keep the game or other application running smoothly.
This tutorial covers texture baking in 3ds max and importing the resulting meshes and their materials into Deep Creator. It assumes you have a solid understanding of mapping and materials, and are also familiar with 3ds max and Deep Creator. To open the sample files, you will need 3ds max 6.
In the first section of the tutorial, you will bake the lighting into a fairly simple object to get familiar with some of the choices offered in the Render to Texture dialogue.
I - A Simple object
The first sample is a simple object with multiple mapping and materials, including a procedural texture. Procedural textures are calculated from mathematical algorithms, rather than bitmaps, and for the most part are too slow to be used in real-time applications. One of their biggest advantages, however, is that they do not need any mapping coordinates, since they are calculated on a volumetric basis.
By "baking in" the texture, you can have the best of both worlds by turning the procedural texture into a bitmap made specifically for that particular object. The drawback to this method is that the size of the baked texture map will probably be larger than its component maps.
1. In 3ds max 6, open the file, Sample1.max.
The file contains a strange little building with several tinted lights.
2. Render the Perspective viewport.
The tinted lighting is more apparent, as is the procedural texture in the bump channel of the roof.
3. From the Rendering menu, choose Render To Texture. The Render To Texture dialogue appears. Under Output, in the General Settings section, change the Map Channel to 2. The Deep Creator importer does not currently support more than two channels.
Set the output Path so the textures will be in a convenient place for this tutorial.
As with the other paths used by max, this one is stored in the ini file, rather than with the scene file, so you should always set it to the folder you want at the beginning of each new project.
The General Settings section
4. If you haven't already, select the building object in the scene. Its name appears in the Objects to Bake list. At the bottom, the All Selected radio button is chosen. In complex scenes, after setting up each object to bake individually, the All Prepared button can be quite useful when global changes are made to the lighting in the scene.
5. In the Output section, click the Add... button and choose CompleteMap from the Add Texture Elements dialogue. The map and its information are added to the Output list. Change the Name to Sample1.
Size: Choosing the map size will be one of the most important decisions. If the map is too small, it will appear pixelated if the user gets too close to the object. if the map is too large, you will be using more memory to store it during run time, resulting in poorer performance on machines with less texture memory on their graphics cards. Since the little building is meant to be approximately the size of a coffee cup in the finished scene, and the player will never be able to get closer than a couple of feet to it, 256 x 256 pixels is a good starting size.
Once in the scene, you can determine whether a texture can be reduced even further, but keep in mind, the next size down in memory usage will be 128 x 128. Any size in between will still use the same amount of memory as the 256 x 256 map.
Map Type: As a default, the file type is tga. TGA files have some compression, but no color loss. JPG files have more compression, but at the cost of color loss. Once in Deep Creator and loaded into memory, both files will take up the same amount of memory, so your choice becomes one of application file size. If the application will be delivered via the web, you may wish to choose .jpg files, if on cd, then .tga files are probably a better choice.
6. The last section creates new materials with the resulting texture maps. The default creates a Shell material that consists of the original material and the new baked material. By default, the finished baked material is shown on the object in the viewport (with 100% Self Illumination, so it is not affected by scene lighting), and the original material used at render time. This allows you to change lighting in the scene, re-render the bake to texture maps and then see the result without re-assigning materials.
7. Click the Render button. The following map is produced.
As you can see, even on such a small map, there is a lot of wasted space using the default settings for the Auto Unwrap.
8. In the General Settings section at the top of the dialogue, Change the Spacing to 0.005 and click Render again, choosing to overwrite the first map.
The first map is what is rendered, the second map includes the edge padding of 2 pixels where the edge pixels have been extended to give a buffer zone. If there is overlap apparent on the mapped object, you should reduce the padding and/or increase the unwrap spacing. If the background color shows up producing "seams" you should increase the padding and/or the unwrap spacing. The padding works on a pixel basis rather than a percentage, so increasing or decreasing the map size will always impact the padding and spacing of the unwrap.
The auto unwrap uses bounding boxes when calculating the layout of the unwrap. In this case, the unwrap was fairly efficient. If there are several diagonal unwrap pieces, you may wish to manually re-arrange them to get more detail for your pixels.
9. Optional: Select the Edit button in the Automatic Flatten UVs modifier that was added to the building object's modifier stack. Remembering the final output size of the map, and the edge padding, re-arrange the unwrap pieces for more efficient use of the space.
The unwrap re-packed manually, scaled up to fit the bounding area, and rendered to texture with padding set to 1.
Because the building used a multi-sub-object material, the newly created material may need some adjusting. the shell material created baked materials for each of the sub-object materials, some of which contained bump maps. Since one of the reasons to bake the entire map together is to do away with multiple maps, you will create a simpler map before importing the building into Deep Creator.
10. Open the Material editor and choose an unused slot. With the building selected, click Get Material, choose Selected, under Browse From, and double click to load it into the material Editor.
As you can see, the baked material is also a Multi/Sub-Object material. If you wish, you could go into each one and turn on Show Map in Viewport. To make importing cleaner, you will condense it all to one map.
11. Save your file as Sample1_Baked.max.
12. Select an unused slot and load the BuildingSample1.jpg map into the Diffuse slot. Because the unwrap used channel 2, you must change the Map Channel in the material to match. Name the new material Building, and apply it to the object.
Changing the Map Channel to match the Unwrap, and the building with the new simpler material in the viewport.
13. Save your file as Sample1_For_Import.max.
14. Open Deep Creator. Under File, choose Import Objects to Scene, and choose the Sample1_For_Import.max file.
The scene meshes visible at start up.
15. Delete any unnecessary lights and adjust the material's properties until you are happy with the result.
II - More Complex objects
In the next example, there is more than one object, each with its own unique mapping and material. If each object had its own map, you could be using more texture memory than is necessary, so the first step is to merge them all into one object. Managing one map rather than several can also be faster loading.
1. In 3ds max 6, open the file, MumboManStart.max. The file contains a figurine consisting of several independent objects. It also includes lighting.
2. Render the Perspective viewport.
The figure uses complex materials and mapping, as well as spot lights, and a skylight for some simulated global illumination. In the Display panel, you may uncheck Lights in the Hide by Category to see the position and type of lights.
Once again, you will be making a complete map, baking in lighting, shadows, textures, etc.
3. Select the Man object, add an Edit Mesh modifier, or collapse it to an editable mesh. Click the Attach List and choose the other 3 objects. Choose Match Material IDs to Material at the resulting dialogue.
The object is now all one mesh, but has retained its component materials and mapping types.
4. Open the Render To Texture dialogue. Set the Map Channel to 2, and the Size to 0.005. Click Add and choose Complete, naming the map Mumbo, and, because this piece will need more detail than the little building, set the output size to 512 x 512. At the bottom of the panel, check Render to Files Only as you will be manually creating the material to export.
5. Click Render. The mesh is unwrapped and the lighting and materials rendered to texture.
The unwrap was not particularly efficient his time. Also note the large dark circle near the center of the map - it belongs to the underside of the base - a collection of polygons that should probably be deleted as they will never be seen if the figure will only stay on a shelf in the real-time application.
6. Delete the Automatic Flatten UVs modifier to clear all UV information from the object, and delete the bottom faces of the base. Click Render again in the Render To Texture dialogue. Overwrite files when prompted.
Once again, the unwrap was not very efficient- due in part to the angle of the arms. By dropping the unwrap angle down to 40 degrees, you can get a slightly better dispersion, or, by manually re-packing the pieces, you can get up to about one third more efficiency/detail. To use the manually re-packed map, Load MumboUnwrap.UVW into the unwrap modifier and re- render.
7. In the Material Editor, make a new material named MumboMan, load the ManMumbo.jpg map into the diffuse slot, and change the channel to 2 to match the unwrap. Apply the new material to the mesh and click Show Map in Viewport.
8. Save your file as MumboMan_For_Import.max, and import it into Deep Creator, deleting lights and adjusting its material parameters as necessary.
9. Save your Deep Creator file as MumboMan.rsn.
III - Multiple Channels
So far, you have been rendering the entire map to texture. In some cases, where the diffuse map is tiled several times, this will result in either poor quality of the diffuse map component, or an overly large map, using excess texture memory. In the next section, you will use separate channels for the diffuse map and the lighting map. This allows for a small light map where detail is less crucial, and a small diffuse map that will be tiled for maximum efficiency.
Another advantage of separating the two allows for different diffuse maps to be used in the real-time application, including dynamic switching of the the diffuse maps during run time.
1. In 3ds max 6, open the file, Sample2.max. The file contains a wall and several object that are casting shadow from several light sources.
2. Render the scene from the Perspective viewport.
3. Unwrap and Render To Texture as before using a Complete Map and 512 x 512 for the output size.
Load MySample2.UVW into the unwrap modifier for a slight gain in efficiency if you wish and render again.
4. Save your file as Sample2Baked.max.
5. In the Material Editor, make a new material named Wall Complete, load the Wall2Channels.jpg map into the diffuse slot, and change the channel to 2 to match the unwrap. Apply the new material to the mesh and click Show Map in Viewport.
6. Save your file as Sample2_For_Import01.max, and import it into Deep Creator, deleting lights and adjusting its material parameters as necessary.
The map looks fine from a distance.
7. Navigate in closer to the wall.
At some point, the detail gets blurry and unacceptable. The map is already quite large- 512 x 512 pixels. The next size up, 1024 x 1024, would quadruple the size in memory, and might not give much better results.
8. Return to max and assign a new material to the wall. Set its diffuse color to a very light gray, change the name in the Render To Texture dialogue to White, set the size to 256 x 256, and re-render.
You could easily use white instead of light gray for this map since there are no specular highlights, but a light gray will allow for highlights on a model to be baked in as well, and so gives a bit more contrast.
9. In the Material Editor, make a new material named Wall2, load the WallWhite.jpg map into the Bump slot, and change the channel to 2 to match the unwrap. Load the diffuse map from the original material into the Diffuse slot- it should remain channel 1. Apply the new material to the mesh.
10. Save your file as Sample2_For_Import02.max. In Deep Creator, under Files, choose New Scene, then Import the latest max file. Delete the extra lights.
11. In Deep Creator, in the Materials panel, select the Walls2 material. Set the Emissive color to light gray. Since max has no exact equivalent of DirectX's stages, the second stage with the light map was brought in as a bump stage. Change its Stage Type to Diffuse, and set the Amount to 100.
At an amount of 100, the second diffuse map is additive, only adding darkening to the other diffuse maps. At anything less, the white is blended in with the other diffuse maps, washing out the color.
The light map at amounts 100, 99.9, and 50.
In some cases, the combination of the two maps may be too dark even with the Emissive set to white.
12. Change the stage's Color Blend to Modulate 2x.
The maps are brighter
13. Zoom in closer to the wall. The mapping is much clearer than the material that contained both diffuse map and lightmap baked in together. Instead of one 512 x 512, the version using two different stages uses a 256 x 256 map for the light map, and a 55 x 55 (using 64 x 64 of actual memory) pixel diffuse map (see below)- for almost a quarter of the memory usage.
The wall, close up and the wall paper pattern map.
The other advantage of using two mapping channels is the ability to scale the UV mapping independently.
14. Select the Wall object. In the UV Wraps panel, select either of the UV Wraps and click the Editor button, just to the right. The UV Editor dialogue appears. It is currently showing Material Index 1, the wall paper.
15. Uncheck Show Grid and Show map. Use Zoom Extents, Reset Origin, Zoom, and pan to position the wall nodes in the editor. Use Scale or Non-Uniform Scale to adjust the tiling of the wall paper.
16. To see the other channel with the light maps, set the Coordinate Index & Stage Index both to 2, and turn on the grid and Map.
Another advantage of splitting the channels and maps is to allow for different maps, either from the start, or during the game or application.
17. In the Materials panel, change the Stage 1 map to [SC] Art Glass.
The new map is substituted for the old map.
18. Save your Deep Creator file as Sample2.rsn.
This tutorial has covered many of the basics of baking and importing objects with light maps. In the next tutorial, you will see one approach to dealing with an entire scene, rather than on a per object basis.
Next Up: Baking a Complex Scene
Edited by Maniac1000 on Dec 5, 2007 at 07:51 PM