courtesy of Autodesk
Using Projection to Create a Normal Bump Map
You use Render To Texture to create the normal bump map for the warrior head as well, but you also adjust the cage before you render the map.
Set up the lesson:
- On the Quick Access toolbar, click (Open File), navigate to \scenes\materials_and_mapping\normal_bump_map\ and open warrior_head_lores.max.
Note: If a dialog asks whether you want to use the scene’s Gamma And LUT settings, accept the scene Gamma settings, and click OK. If a dialog asks whether to use the scene’s units, accept the scene units, and click OK.
The only visible object is an editable mesh model of the head of a warrior. This is the low-resolution target object, consisting of roughly 750 polygons, to which you will apply normal bump maps. Its surface is smooth, and it has a checkered texture map applied to it. This checker map was used as a visual guide in setting up the texture mapping of the surface. An Unwrap UVW modifier has already been applied.
Inspect the mapping:
- Select the model, go to the Modify panel Edit UVs rollout, and click the Open UV Editor button.
3ds Max opens the Edit UVWs dialog, which shows how the Unwrap UVW modifier has already been applied to the target object, and how the texture coordinates have been mapped to the surfaces of the model. This layout was designed to facilitate painting, which can be necessary for “touching up” texture mapping.
- On the first of the lower toolbars, the Sub-Object Selection toolbar, click (Polygon) to make the Polygon (Face) sub-object level active, then click to turn on (Select By Element UV Toggle).
In the main Edit UVWs window, select geometry elements to see how they correspond to the model in the Perspective viewport. Close the dialog when you are done.
In order to extract the high-resolution information from the source model, you will now need to merge it with the low-resolution version.
Merge the high-resolution model:
- From the Application menu, choose Import Merge, and on the file dialog, navigate to the folder that contains your scene files. Select the scene that contains the high-resolution model, warrior_headhires.max, then click Open.
3ds Max opens a Merge dialog.
- On the dialog, click to highlight War_Head_HiRes, then click OK.
The two models are now visible. Both are the same size and are precisely aligned.
- To view the high-resolution model on its own, make sure the high-resolution model is selected, select a non-checkered part of the head, right-click, and from the quad menu choose Isolate Selection.
This model, at approximately 96,000 polygons, shows a much greater amount of detail.
- On the status bar, click (Isolation Selection Toggle) to return to the merged view.
- Click a checkered region of the model to select the low-resolution model.
To make sure you have the low-resolution model selected, check that the Name And Color rollout displays War_Head_LoRes.
Now you will proceed to create the normal bump map based on the high-resolution model.
Set Up Render To Texture (RTT):
- From the main menu, choose Rendering Render To Texture.
- In the Render To Texture dialog General Settings rollout Output group, define the output path where you want to save the diffuse and normal bump map textures you are about to create.
By default, the output is saved in the \sceneassets\images folder of the current project, but you might want to specify a different storage location.
- In the Objects To Bake rollout Projection Mapping group, turn on Enabled, then turn off Sub-Object Levels, since no sub-selections exist in this particular model.
- Click the Pick button to display the Add Targets dialog. In this dialog, click to highlight War_Head_HiRes, then click Add.
The drop-down list in the Projection Mapping group has changed from (No Projection Modifier) to Projection, indicating that a new Projection modifier has been placed on the stack for War_Head_HiRes.
Also, a rough wireframe cage appears around the high-resolution head object in the viewport. The cage shows a considerable amount of irregular geometry, but this is usual when it is first applied. The problem is easy to correct.
- On the Modify panel Cage rollout, click Reset.
The cage resets itself to fit tightly around the target low-resolution model.
The shape of the cage is correct, but it is important that the cage fully encompass the source high-resolution model. Where the source geometry lies outside the cage, the result will be ray intersection misses, which in turn will cause flaws in the normal bump map.
- On the Cage rollout Push group, set Amount to 1.1.
After the value is applied, it resets to 0.0 and the cage balloons outward slightly so that the entire War_Head_HiRes object, with all its bumps and protrusions, fits within it.
- In the Render To Texture dialog Objects To Bake rollout Mapping Coordinates group, choose Use Existing Channel.
This is where you specify that you want to use the pre-assigned texture-mapping coordinates you viewed at the beginning of this lesson, rather than letting 3ds Max create new texture-mapping coordinates on the fly.
- Scroll down to the Output rollout, click Add, and in the Add Texture Elements dialog, click to highlight NormalsMap, then click Add Elements.
A new NormalsMap entry appears on the Output rollout of the Render To Texture dialog.
- On the Selected Element Common Settings group Target Map Slot drop-down list, choose Bump, then click the 512 x 512 Width/Height button, which sets the output size to 512 by 512 pixels.
- In the Selected Element Unique Settings group, turn on Output Into Normal Bump, so that the result shows up properly both in the viewport and in renderings.
At this point, you have defined all the basic elements and settings for generating a normal bump map.
To generate the normal bump map, you will use the Render To Texture tool.
Render and fine-tune the normal bump map:
- At the bottom of the Render To Texture dialog, click Render to render the Diffuse map and the Normal Bump map.
Note: If a warning appears that says the maps already exist, click Overwrite Files.
The rendered frame shows the unwrapped Diffuse map of the high-resolution model. Assorted red patches are visible, indicating where the bump map projection rays did not properly capture the underlying geometry. This is because the cage created by the Projection modifier did not completely cover the high-resolution model in these spots.
This would create problems if you applied the normal bump map to the low-resolution target. You will resolve this problem by applying neutral normal values to these red patches so they blend with their surrounding areas.
- Make sure the War_Head_LoRes object is selected and in the Render To Texture dialog Objects To Bake Projection Mapping group, click Options to display the Projection Options dialog.
- In the Resolve Hit group, turn off Ray Miss Check, then close the dialog.
With Ray Miss Check turned off, the red patches in the rendered normal bump map will be replaced by a neutral black background with a normal value of 0, a value that will permit the regions to blend effectively with the normal map that will be created.
- At the bottom of the Render To Texture dialog, click Render to render your normal bump map once again.
Click Overwrite Files when you are prompted to overwrite the previously rendered file.
The rendered Diffuse map shows that the previous ray misses now appear as black, the neutral element background.
At the same time it renders the Diffuse map, 3ds Max renders the Normal Bump map as a TGA image. Now you will take a look at this image to see the blending result.
- From the main menu, choose Rendering View Image File. In the file dialog that displays, navigate to the image file location, which by default is \sceneassets\images.
- Select the file war_head_loresnormalsmap.tga, then click Open.
The blue channel conveys vertical depth information, and the red and green channels enhance this information by providing a direction vector for the normal orientation of the surface at each point. This conveys more information than an ordinary grayscale bump map.
- Close the normal map image.
Save your work: