Tutorial: Rendering lightmaps with RTTGroup plug-in.

Before starting the tutorial make sure that 3ds Max displays textures in shaded viewports with the highest quality. In order to do so do the following:

  1. Select: Customize menu > Preferences > Preference Settings dialog > Viewports tab > Display Drivers group > Configure Driver button.
  2. You are now in the driver configuration dialog - turn on Match Bitmap Size as Closely as Possible option available in Download Texture group.

This tutorial explains the necessary steps to create lightmaps - textures containing lights and shadows cast on the objects in a scene.

  1. Prepare an example scene with several light sources, possibly colored, casting multiple shadows on the objects.
  2. Select the Helpers panel, choose the standard helper set and click the RTTGroup button.
  3. Insert the RTTGroup helper somewhere in the scene - click on any of the viewports, preferably the top view. A new icon appears, named with the default name RTTGroup01. When the icon is selected the orange-colored square appears and shows a size of texture created by the plug-in in relation to the object sizes.
  4. Choose the Objects rollout and click the Add button. The object selection dialog pops up. Select all objects from the scene.
  5. Check the Create New Baked option. This creates a template material for baked lightmap materials. All materials containing lightmaps will be based on it.
  6. Click the Texture Elements button invoking another dialog window. You can choose render elements there. The Output Path edit field shows the destination folder for the texture files. You can also specify a filename template used when the rendered textures are stored on the disk.
  7. Click the Add button invoking the Add Texture Elements dialog.
  8. From all possible texture elements shown there select LightingMap and click OK.
  9. Now set Target Map Slot to Diffuse Color. This instructs the program to automatically assign the lightmap textures to the diffuse color bitmap slot.
  10. Close the Texture Elements dialog.
  11. Return to the Unwrap rollout and using a Grid Size parameter make the size of orange-colored square to match the scale of objects from which you want to render the textures. The Grid Size parameter specifies the size of resulting texture pixels (in our case lightmap pixels). The smaller value the higher precision of rendering but at the expense of increased number of textures. The orange square dimension is equal to Texture Width multiplied by the Grid Size.
  12. Click the Unwrap button in Objects rollout. This unwraps all objects assigned to the RTTGroup. You will immediately see the number of resulting textures in a Textures per TE window. If the number is too high, increase the value of Grid Size and click Unwrap again.
  13. Now switch to the Utilities panel and click More... button.
  14. Select the Render To Texture utility. The recently created helper RTTGroup01 should appear on the list.
  15. Click the Render button.
  16. When the render finishes, each object assigned to the group has a new type of material - Shell Material. The shell material is a simple container with two slots - one for the original material (previously assigned to the object), second for the baked material (created during render to texture process).
  17. You can choose which of those two materials will appear in the viewports (in shaded view) and in the rendered images - use appropriately named radio buttons.
  18. Select any object belonging to the RTTGroup. Switch to the Modify panel.
  19. Notice a new modifier on the object's modifiers stack - RTT UVW Map. This modifier keeps UV mapping coordinates created during the unwrapping process and new material IDs for baked material. The Apply Material IDs checkbox is active when the baked material is selected for viewing or rendering.
  20. Switch back to the Utilities/Render To Texture panel and activate baked material visibility in the viewport.
  21. Add a new light to the scene or move any existing one. You should notice that the light changes still affect the lightmapped objects. This is needed when working with original textures but the lighmaps shouldn't be affected by the lights in the scene anymore. The baked texture materials have to be self-illuminating, ignoring any lights in the scene.
  22. Select the RTTGroup01 helper and activate the Modify panel.
  23. Open the Material Editor.
  24. Click on the Put to Material Editor button in Output rollout. The instance to RTTGroup material should appear in the active slot of the Material Editor. You can edit the settings for this material (a base for baked materials).
  25. Find a Self-Illumination group in Blinn Basic Parameters. Check the Color checkbox and select white color.
  26. Render the textures again.
  27. Now any light changes won't affect how the baked materials are displayed.
  28. Repeat the tutorial but use the CompleteMap texture element instead of LightingMap.