For newer tutorials, go here. Even better, order one of my books!


3D Studio MAX 3.1 tutorials
© 2000 Aaron F. Ross. Unauthorized duplication or publication is a violation of international copyright laws.

Tutorial 12: Sub-Object Materials (Still Life part 2)

1. Download the following file, which includes a scene file and textures needed for this exercise. Right-click, choose "Save Target As..." or "Save Link As..." and save the file to a folder on your hard drive. Then unzip it.

12_sub_object_materials_still_life_pt_2.zip

Open your scene from the last tutorial, #11: Intro to Materials — Still Life, part 1.You will continue with this scene in the following exercise.

2. Create a Target Camera by clicking and dragging anywhere in the Top viewport. It doesn't matter where you create the Camera, as long as it's in the Top Viewport. Then right-click to exit Camera creation mode. (The green Target button turns grey again.)

     

3. Activate the Perspective viewport by right-clicking it. Make sure the camera you just created is still selected. Then go to the Views menu (in the top menu bar) and select Match Camera to View. Notice that the Camera moves automatically; it is now matched to the currently selected Perspective viewport. Now you can change the Perspective viewport to facilitate materials and map assignment, and still get back to the view you had before — by activating the viewport for the new camera.

4. Restore the Perspective view to full-screen. Select the apple, and only the apple. Hold down the Ctrl key and right-click the apple. You will see a new pop-up menu. Select the Isolate Tool. All other objects are hidden, and the viewport is zoomed in to the extents of the apple object.

     

Now you can clearly see that the stem of the apple is the wrong color.

5. Convert the Perspective view to wireframe mode by right-clicking the viewport label, which says Perspective, and selecting Wireframe from the pop-up menu.

6. Open the Materials Editor and create a new material which is brown. Name it "apple stem," or something similar. Do not assign it to the apple yet.

7. With the apple selected, open the Modify panel, and click on Sub-Object Element. Then select the apple stem. I originally created this apple as two separate objects, and Attached one to the other. As a result, the two original objects are individual Elements in the final Editable Mesh object.

8. In the Materials Editor, drag the "apple stem" material to the apple. Because you are still in Sub-Object mode, the material is assigned to the current sub-object selection, and not the entire object. Confirm this by restoring the Perspective viewport to a shaded view. Right-click the Perspective viewport label, and select Smooth + Highlights from the pop-up menu. You should see that the apple is a red fruit with a brown stem.

9. Exit Sub-Object mode by clicking the yellow button; it turns grey. Select an unused sample slot in the Materials Editor. Click the Get Material button on the left side of the Material Editor controls. (See the illustration below.) The Material/Map Browser is launched. In the Browse From: area, click the radio button which says Selected. The material which is assigned to the currently selected object, the apple, is listed. Its name will be "Material #35" or something similar. This is a material which was automatically created when you assigned the "apple stem" material to the Sub-object selection. It is of the type Multi/Sub-Object, and listed below it are the two sub-materials it contains.

In the Material/Map Browser, click the material name once to see a preview. Double-click the name to assign the material to the current sample slot in the Material Editor. Close the Material/Map Browser.

10. Rename the new Multi/Sub-Object material "apple multi" or something similar. You can now make changes to the original sub-materials, and the changes will be instantly updated in "apple multi." If you wish, you can drag a sub-material label (the button which says "apple material (Standard)") to a sample slot to create a new instance. Or you can simply click on the label to go down to that level in the material hierarchy.

11. Click the yellow button which says Exit Isolation; the rest of the scene objects are unhidden. Now we'll add a pattern texture to the tablecloth. Select the tablecloth in the scene, then select an unused sample slot in the Materials Editor. Rename the material to "tablecloth material."

Open the Maps rollout and look for the Diffuse map slot. Activate it by turning on the check-box, and make sure it is at 100% Amount. Then click the button which says "None." This launches the Material/Map Browser again.

12. In the Browse From section, select New. Then double-click the word "Bitmap" in the main browser pane. (All of the items with parallelogram icons next to them are texture maps.) The Material/Map Browser closes, and a dialog box opens which says Select Bitmap Image File.

When the dialog box opens, it should display the default 3DS MAX Maps folder. If not, you will need to browse to the directory, which is:

C:\Program Files\3dsmax3_1\Maps

Then open the Fabric subfolder.

If the Preview option is checked, you can single-click on a texture file to see a thumbnail preview. You can also click the View button to see a texture at full resolution. Select Pat0039.jpg and click Open to assign this texture file to the Diffuse channel of the new material. The file you are looking for looks like this:

If the file is not in your default ...\Maps\Fabric folder, you can find it in the Zip file you downloaded.

13. In the Material Editor, look at the bottom of the Bitmap Parameters rollout. In the Alpha Source section, make sure the radio button marked None (Opaque) is selected. The Diffuse bitmap should now completely replace the existing Diffuse color swatch; the colors of the bitmap and the Diffuse swatch should not be mixing.

At the top right of the Materials Editor, change the object in the sample slot to a cube. Now you can clearly see the pattern texture applied to the new material.


change the sample object to a cube

14. Rename the map "tablecloth map" and assign the material to the tablecloth object in the scene.
Click Show Map in Viewport to display this texture in the shaded views. Render the scene.

Hint: to speed up rendering when tweaking these parameters, you can turn off some of the rendering options, such as the automatic refraction of the wine glass. MAX allows you to set two different render settings: Production and Draft. In the Render Scene dialog, select Draft mode, and then turn off Auto-Reflect/Refract and Mirrors. With automatic refraction mapping turned off, the wine glass now renders as black. Render times are much faster, so you can focus on what you're currently working on — the tablecloth.

15. When you render the scene, notice that the tablecloth texture looks very grainy and "pixelated." This is because it is a low resolution bitmap image, being mapped to a large area on the screen. One thing you can do to try to minimize this is apply some blur to the texture.

MAX offers two types of blurring for bitmap textures. The first is simply called Blur, which applies a blur to the texture based on its distance from the camera. The farther an object is from the camera, the more blur is applied. This is to minimize aliasing artifacts (jagged lines) which can occur when a texture is far away from the camera.

In the Coordinates rollout, change the Blur factor to 7.0 and render the scene to see this effect: the front edge of the tablecloth is still grainy, but the back edge is blurry. Change the Blur factor back to the default value of 1.0 to continue.

The other type of texture blurring in MAX is called Blur Offset. This is not dependent on distance; it applies the same amount of blurring to the entire texture. The primary function of Blur Offset is to correct the problem we see here: the graininess of a low resolution texture. It can also be used as a special effect.

The Blur Offset value is extremely sensitive. Useful values range from 0.0 to 1.0. If the value is set too high, the texture will be completely blurred, producing a flat field of color which is the average of all pixels in the texture file. Change the Blur Offset to 0.05 and render the scene.

16. The Blur Offset did eliminate the graininess, but unfortunately it also eliminated most of the detail of the pattern. This low-resolution bitmap is simply inappropriate for the use to which we have put it. This pattern texture was intended to be repeated many times across the surface of an object. This is easily accomplished by changing the Tiling parameter in the Coordinates rollout.

Change the U Tiling value to 2.0 and observe the results in the sample slot and viewport.

Experiment with the U and V Tiling values and the Blur Offset factor until you get a result you like. Try setting the U and V Tiling to the same number; you will get square tiles.

Additionally, feel free to tweak the colors of the material and map if you wish. You can do this in many ways. For example, if you reduce the Diffuse Map Amount to less than 100%, the Diffuse color swatch will mix with the Diffuse bitmap.

Even better, you can directly influence the bitmap colors as you would in a 2D paint program. In the Output rollout of the maps parameters page, there are many options for adjusting the colors of bitmaps. Experiment with parameters such as Output Amount, RGB Offset, and RGB Amount — the only way to get a feel for them is to tweak them.

Even more incredible, MAX 3 has a function almost identical to Photoshop's "image curves." Kinetix calls it the Color Map, and it is found at the bottom of the Output rollout. When activated, it gives you a graph of the red, green, and blue color channels. By editing Bezier curves, you can totally tweak the look of a bitmap without altering the actual file on disk. This type of non-destructive image adjustment helps you use efficient material techniques, such as re-using the same bitmap many times in the scene to save RAM.


bitmap colors altered non-destructively with Color Map

17. By now you should have adjusted the tablecloth material and map colors to your preferences. Now let's add a bump map to give the object the roughness of a piece of cloth, rather than a perfectly smooth surface.

Go back to the level of the material by clicking the Go To Parent button.

In the Maps rollout, activate the Bump map channel by clicking the button which says None. Select a new bitmap in the same Fabric folder; this time choose carpttan.jpg. Again, if it is not in your ...\Maps\Fabric folder, you can find it in the Zip file.

Render the scene. The tablecloth now has some roughness to it — probably too much. Reduce the Bump Amount to give a more natural result, and re-render. (A value of 15 worked for me.)

In addition, change the U and V Tiling values for the bump map to make the fabric threads smaller, and re-render to check your work.

18. Now we will revisit the fruit bowl. Find the "bowl material" in the Material Editor. Next to the Diffuse color swatch is a small grey button — this is a shortcut to the Diffuse Map slot. Click the button to assign a new Diffuse Map.

In the Material/Map Browser, scroll to the bottom of the list of map types, and double-click Wood to assign this procedural texture (aka 3D texture) to the Diffuse Map channel.

In the Wood Parameters rollout of the Material Editor, adjust the colors, grain, etc., and render.

19. Look closely at the bowl object, zooming in if necessary. Notice how jagged the edges of the woodgrain look. These harsh, aliased lines are not present in nature. You can try to fix the problem by adjusting the Blur and Blur Offset, but unfortunately, they don't work with this procedural texture. See the illustration below.


jagged, aliased texturesupersampled texture

In order to antialias this 3D texture, we have to enable Supersampling. Click Go To Parent to return to the level of the material, and then expand the Supersampling rollout. Activate the boxes which say Enable Sampler and Supersamp. Tex. (Supersamp. Tex. should be on by default.) There are many supersampling algorithms to choose from, but you can leave it at MAX 2.5 Star — it's a fast, general purpose supersampler.

Re-render, paying careful attention to the change in the Wood texture aliasing. Also notice how much longer it takes to render. MAX is internally rendering the texture at higher resolution, then averaging the pixel values by downsampling at the final output stage.

Note that supersampling is performed at the Material level. You can't tell MAX to antialias some texture channels and not others.

20. The daisy in this scene has been changed by the modeling team (me). We could have automatically updated the model using MAX's system of external references, but in this case it's easier to simply replace the model manually.

Delete the old flower object: select it and hit the Delete key. Go to the File menu and select Merge. In the Merge dialog, browse for the scene file which you downloaded and unzipped:

flower_new.MAX

When you click Open, you will get a second dialog box. MAX wants you to select which objects in the external file to merge into the current scene. Highlight the flower object and click OK. The new flower should appear in the vase. If it doesn't, then move it into position.

21. Now you will manually create a Multi/Sub-Object material for the flower. (This old-school technique is necessary, because in creating this assignment, I found that dragging sub-materials onto the flower resulted in a minor bug.)

In the Material Editor, select an unused sample slot, and click the Get Material button. In the Material/Map Browser, create a New material of the Type Multi/Sub-Object. Close the Material/Map Browser.

In the Material Editor, change the name of the new material to "flower multi." Then change the number of materials to four, by clicking the Set Number button and entering the number (4).

22. Now, create four new sub-materials within "flower multi." There are many ways to go about this. For example, you can create new materials in different sample slots, then drag them to the appropriate buttons in "flower multi." Or you can open up the sub-materials, and edit their parameters directly. (The Go To Sibling button comes in handy when doing this.) However you go about it, you should end up with a material that looks like this:

23. In the Perspective viewport, right-click the viewport label and select Configure from the pop-up menu. In the Viewport Configuration dialog, under the Rendering Method tab, check the box which says Shade Selected Faces, and then close the dialog by clicking OK.

24. Maximize the Perspective viewport. Make sure the Material Editor is open, and displaying the "flower multi" material. In the Perspective viewport, select the flower and open the Modify panel. Activate Sub-Object Element mode. Scroll down to the bottom of the Modify panel and open the Surface Properties rollout. Now you are able to select object Elements based on their Material ID assignments. (I have already assigned the Material IDs for the new flower, but you should verify them so that you understand how Material IDs correspond to sub-materials in the Material Editor.)

Click the button which says Select By ID. In the Select By Material ID dialog, make sure the Clear Selection option is checked. Enter the number (1) and click OK. You should see the flower head turn red to indicate it is selected. This means that the flower head is assigned to Material ID #1.

Check the rest of the Material IDs to confirm that they match the sub-materials in the Materials Editor.

25. Scroll the Modify panel back up to the top, and exit Sub-Object mode. Then assign the "flower multi" material to the flower object. The flower object should now have the correct colors in the viewport.

26. Open up the "green leaf" sub-material, and assign a new Diffuse Map. This map located at:

C:\Program Files\3dsmax3_1\Maps\organics\LeafGreen.jpg

Again, it is also in the Zip file.

Click the Show Map in Viewport button to display the map in the Perspective view.

27. Note that the leaf texture is mis-aligned on the geometry. In the Coordinates rollout, go to the Angle section and change the W value to -90.

Render the scene. The leaf texture is now rotated into the proper position. The texture is in the right place, but the black box around the leaf looks wrong.

28. In the Materials Editor, go to the Maps rollout of the "green leaf" sub-material. Assign a new Opacity map by clicking the button which says None.

The file you want is in the same directory as LeafGreen.jpg:

C:\Program Files\3dsmax3_1\Maps\organics\Leafo.gif

If the Leafo.gif file is not in the directory, you can find it in the zip file you downloaded. It looks like this:

By default, white areas are interpreted as opaque, and dark areas are transparent. With this opacity map applied to the material, only the leaf texture will render, and its black background will be masked out.

The Opacity map also needs to be rotated into position. In the Coordinates rollout, change the W Angle to -90. Render the scene; the leaf is now corrected.

29. Save the scene, as you will need it for the next tutorial, #13: Mapping Coordinates (Still Life part 3).


Return to 3D Studio MAX 3 tutorials


CGLearn.com home page