INSIDE 3DS MAX® 7 [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

INSIDE 3DS MAX® 7 [Electronic resources] - نسخه متنی

Adobe Creative Team

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید











  • Texture Mapping


    No doubt you are eager to delve into the basics of applying these materials in a real scene. First, we'll examine applying mapping to procedural objects.

    Mapping Procedural Objects


    Procedural objects such as Standard primitives, Extended primitives, and Patch Grids that are created using the path Create panel > Geometry are generated with mapping coordinates already in placethe relevant check box is selected by default (Figure 10.8)so maps can render properly for them. You can also render Spline objects (lines, circles, rectangles, and so on), although their Renderable and Generate Mapping Coordinates options (under each object's Rendering rollout) are off by default. (This is so you don't have leftover construction splines and shapes rendering in your animations by mistake.)

    Figure 10.8. Procedural objects in 3ds max 7 have their mapping coordinates selected by default.

    Certain compound objects, notably loft objects, allow you to generate mapping coordinates upon creation (Figure 10.9). This is very helpful, since it can be quite difficult to apply standard UVW mapping to a complex lofted object such as a length of cable or hose snaking around a 3D car engine. Maintaining the existing mapping on procedural objects in your scene will save you time and trouble later when you begin applying materials.

    Figure 10.9. Lofted objects get mapping coordinates when they are created.

    [View full size image]

    Note

    Collapsing procedural objects into Editable Meshes, Patches, Poly objects, or NURBS objects preserves their original mapping coordinates, but if you apply a UVW Map on top of these objects and then collapse them again, your original Procedural mapping coordinates will be lost.

    Mapping Modifiers


    Now let's look at the various options for modifying the application of maps to objects.

    Unless you're creating a scene consisting entirely of untouched procedural objects (which is unlikely!), you'll probably want to apply specific UVW mapping coordinates to your objects. These allow you to custom-fit your textures to almost any object or group of faces.

    UVW mapping gizmos operate in both World space (global coordinates) and Object space (local coordinates.) You find both types in the Command panel > Modify tab > Modifier List menu.

    These are the World-Space UVW Map modifiers in 3ds max 7:

    • Camera Map
      Projects the map from the camera's view; used for "front projection" special effects in your scene.

    • MapScaler
      Preserves a UVW-mapped object's map size in relationship to World space when you scale the underlying object.

    • Surface Mapper
      Takes a map assigned to a NURBS surface and projects it onto a modified object. Only useful if you build NURBS objects in 3ds max.


    These are the Object-Space UVW Map (and Material) modifiers in 3ds max 7:

    • MapScaler
      Preserves a UVW-mapped object's map size in relationship to Object space when you scale the underlying object.

    • Material
      Assigns specific materials to objects, faces, and elements in your scene.

    • MaterialByElement
      Applies different material IDs to objects containing multiple elements, either to specific elements or randomly.

    • Unwrap UVW
      Modifies the placement of a bitmap's details on the surface of an object at the face/edge/vertex level. You can see this in action in the Unwrap UVW modifier menu (Figure 10.10) after you click the Edit button under this modifier's Parameters rollout.

      Figure 10.10. The Unwrap UVW menu. This file, Unwrap UVW Example.max, is on this book's DVD.

      [View full size image]

    • UVW Map
      The standard workhorse modifier for applying mapping coordinates to meshes, patches, and polys. The coordinate types are Planar, Cylindrical, Spherical, Shrink Wrap, Box, Face, and XYZ to UVW (converts from one coordinate system to another).

    • UVW Mapping Add
      Used in conjunction with the Channel Info Utility (Command panel > Utility tab > More > Channel Info). It's mainly for game developers who need low-level access to vertex color and mapping data of 3D objects that they'll later export to a game engine.

    • UVW Mapping Clear
      Clears the previous UVW channel information.

    • UVW Xform
      Adjusts the tiling and offset in existing UVW coordinates. Also used to tweak the default mapping coordinates of procedural objects.

    • VertexPaint
      Another game developer tool, enabling artists and programmers to modify low-poly model textures for output to game engines.


    Note

    The Shell modifier (under Object-Space Modifiers) is different from the Shell material. The former allows you to create "thickness" in the walls of your 3D geometry; the latter is used to bake procedural textures into a single bitmap.

    That covers the core 3ds max 7 shaders, maps, material types, and map-related modifiers (all that are not specific to mental ray). Now let's play with a couple of fast and easy mapping tricks.

    Mapping Tricks


    In the following example, we'll take a quick look at the difference between Object-Space mapping and World-Space mapping and explain how you can use these differences to create some interesting texture effects.


    1.

    From the DVD, load the file Object Space vs World Space.max (Figure 10.11).

    Figure 10.11. The Object Space vs World Space.max scene.

    [View full size image]

    2.

    Scroll the Time Slider bar to see two spheres that travel across the screen in front of a checkerboard background. Both spheres have UVW Map modifiers applied, with Spherical mapping coordinates.

    3.

    Open the Material Editor, and inspect the materials in the scene. There are two different materials (one for each sphere), both using the Checker map. Another Checker map (with Screen mapping coordinates) forms the Environment Background image.

    4.

    Select the first material (Object-Space Mapping), and open its Diffuse Color map slot, loaded with the Checker map. Under the Coordinates rollout, you'll see that the Texture radio button is checked and that the Mapping coordinates are set to Explicit Map Channel.

    5.

    Select the second material (World-Space Mapping), and open its Diffuse Color map slot. Under its Coordinates rollout, you'll see that the Environment button is checked, with the Mapping coordinates set to Screenthe same parameters used in the background map.

    6.

    Activate the Camera01 viewport, and render a still image of this scene on frame 0 (Figure 10.12). You'll see that the top sphere has a distinctive checker pattern on it that wraps around the object. However, the bottom sphere blends into the background. Its mapping coordinates match the background's coordinates, so it is virtually invisibleonly its shadow helps you discern the sphere's shape.

    Figure 10.12. The top sphere uses explicit (object-space) mapping coordinates; the bottom sphere uses environment (world-space) mapping coordinates.

    7.

    From the DVD, select the file OSM vs WSM 1.avi. This 320-by-240 .avi shows the spheres flying through the scene. The movement clearly shows how the object-space coordinates on the top sphere move with the sphere, while the sphere below appears to move "through" the background texture.

    8.

    Now return to the Material Editor. Select the second (World-Space) material, and click the Go To Parent button to go to the top level of this material. Under the Blinn Basic Parameters rollout, drag the Self-Illumination slider from 0 to 100.

    9.

    Activate your Camera01 viewport again, and render a test image. You'll notice that the bottom sphere completely disappears. It is mapped with the background image and there are no shadows on it, so it's effectively invisible.


    At this point, you may well be wondering why you would want to create an invisible object in this way. Even if you needed an invisible object to, say, cast shadows on another object, you could simply apply a Matte/Shadow material to it to make it transparent to the back ground but still cast shadows on other objects. Or you could use a Camera Map (WSM) on the object instead.

    Both of those techniques will work. However, by applying Environmental mapping coordinates to objects, you can produce a number of special effects that you can't duplicate with the Matte/Shadow material. Take the following example:


    1.

    Return to the Material Editor, go to the WSM material, open its Checker diffuse map, and under the Checker Parameters rollout, click the Swap button to switch the black and white color swatches. Now render another test image. Result: You see that the sphere appears to invert the background image texture, but only where the sphere appears "over" the background image.

    2.

    Return to the Material Editor again, and in the WSM material, click the Swap button to return the color swatches to their original positions. Under the Coordinates rollout, change Blur Offset from 0.0 to 0.1, then render another test image of the Camera01 viewport. Result: The bottom sphere appears to blur the background map, but again, only where the sphere appears "over" the background image.

    3.

    Return to the Material Editor once more, go to the WSM material, turn Blur Offset back to 0.0, and click the Color #1 swatch to open the Color Selector. Change the black Color #1 swatch to RGB coordinates (0, 0, 255), bright blue; then select the Color #2 swatch and change it to RGB (255, 255, 0), bright yellow.

    4.

    Render the Camera01 viewport. The colors that you switched on the foreground sphere (while retaining identical mapping coordinates on the background) cause the self-illuminated bottom sphere to "colorize" the background over which it passes. You can also reverse this effect: Make the background Checker pattern colorful, but have the sphere appear to turn it black and white.


    You will probably use Object-Space mapping coordinates for the overwhelming majority of 3D objects in your scenes, but remember that World-Space mapping coordinates have their place as well. By slightly differentiating your WSM "foreground" object map from an existing and similar Environment Background map, you can produce an illusion of diffuse transmission such as the one that appeared in the move Predator (the alien Predator wore an cloaking device that slightly but characteristically distorted anything he passed in front of). This and other nifty rendering effects can be generated "in camera" and without using complex compositing tricksa real boon if you don't have access to a compositing program such as discreet's combustion or Adobe After Effects.

    Note

    To properly match the anti-aliasing and texture filtering of the background image (or background plate, in VFX jargon), you should pick the Plate Match/MAX 2.5 filter from the Render tab of the Render Scene dialog and use that for your final rendering.

    Multi/Sub-Objects


    Multi/Sub-Object mapping is a way for 3ds max 7 users to select various components of their 3D geometry (such as groups of faces), assign different mapping ID numbers to them, and then apply one "master" material (consisting of two or more submaterials) that corresponds to each individual mapping ID number, for each group of previously selected faces.

    If you think that's a convoluted definition, it's less complex than actually doing the process on a complex mesh. (A basic 3ds max primitive object is less of a challenge.) Regardless of the complexity, let's take a quick look at Multi/Sub-Object mapping as it pertains to one of the most common questions asked by newcomers to 3ds max: "How do I map a different texture onto every side of a box?"

    Mapping the Sides of a Box


    Odd as it seems, the common task of mapping the sides of a box in 3ds max 7 is actually not quite as intuitive as one might hope. The key is knowing that when you create a Box primitive in 3ds max 7, it already has Material ID numbers set on each face, and that you can change these ID assignments if you need to. Here's the process:


    1.

    Go to Command panel > Create tab > Standard primitives and create a Box primitive in the scene of 100 units on each side.

    2.

    Click the Modify tab, make sure the box is selected, and from the Modifiers panel, apply an Edit Mesh modifier to the box.

    3.

    Go to the Edit Mesh modifier's Polygon sub-object level, select the top polygon of the box (in the Perspective viewport, say), and then go to the Surface Properties rollout in the Modify panel. Under Material, the Set ID number should be set to 1 (Figure 10.13). Click other faces on the box, and notice how the Material ID number changes. From this rollout you can also modify the ID numbers that 3ds max 7 automatically assigns to the box faces.

    Figure 10.13. Each face of a Box primitive has Material ID numbers assigned automatically upon creation.

    [View full size image]

    4.

    The job of assigning a different map to each face on this box is where the Multi/Sub-Object material comes in. From the DVD, load the file Box Multi-Sub Object Mapping.max. When the file loads, select the box, open the Material Editor, and take a look at the Material Settings.

    The first material slot contains the initial Multi/Sub-Object Material used on the box. It has six slots, one per box face and Material ID number (Figure 10.14).

    Figure 10.14. The Box primitive in the scene with a Multi/Sub-Object material applied. Each of the six Material ID numbers corresponds to one side of the box.

    [View full size image]

    5.

    Activate the Camera01 viewport, and render the scene (Figure 10.15). Each of the (self-illuminated) submaterials has one bitmap assigned to its Diffuse Color channel. These bitmaps are simply big, colorful numbers that correspond to each Material ID number.

    Figure 10.15. Each face of the box gets a different map, courtesy of the Multi/Sub-Object material.

    6.

    To create your own Multi/Sub-Object material, click an empty Material slot, click the Standard button, and from the Material/Map Browser, pick Multi/Sub-Object. Discard the existing Standard material unless you began with a Standard material that you want to use as a submaterial in the final Multi/Sub-Object material.

    Under the Multi/Sub-Object Basic Parameters rollout, you'll see a default of ten different sub-object materials. Change this number, if desired, by clicking the Set Number button. Then open each Sub-Material slot, and adjust its parameters as needed.


    Mapping the Sides of Complex Objects


    Suppose you would like to assign Box Multi/Sub-Object materials to more complex objects that you've built from scratch. The basic process is as follows: Apply Edit Mesh or Edit Poly modifiers to your object, select the specific faces you want to map, assign Material ID numbers to them, apply UVW mapping coordinates to each group of faces, and then repeat the process until you have the entire object mapped. If you require, say, 12 different submaterials to cover the entire object, create a new Multi/Sub-Object material, set the submaterial number to 12, and create the appropriate materials for each group of numbered faces.

    Let's explore this method in detail:


    1.

    Load the entitled Box Multi-Sub Object Map 2.max from this book's DVD. It is a tesseract-shaped objectbasically, a box with each of its six faces extruded and a MeshSmooth modifier applied to chamfer the corners and sharp edges (Figure 10.16).

    Figure 10.16. A complex object gets an equally complex series of Edit Mesh and UVW mapping coordinates assigned to its faces.

    [View full size image]

    2.

    Activate the Camera01 or Camera02 viewport, and render the scene (Figure 10.17). This object has a modified version of the previous scene's Multi/Sub-Object material. (The default U and V tiling on some of the submaterial bitmaps has been changed to make them more noticeable on the different parts of the object.)

    Figure 10.17. The tesseract shows the Multi/Sub-Object material assigned to its faces, using a variety of different mapping coordinates.

    3.

    Select the box, then go to the Modify tab in the Command panel and look at this object's modifier stack. Yow! This object has a complex stack of Edit Mesh and UVW Map modifiers applied to create the final effect. In addition, the UVW Map modifiers are of different typesPlanar, Cylindrical, and Sphericaland are oriented differently on each of their assigned groups of faces.


    The Model Kit Approach


    Unless you absolutely must use the above type of mapping, it may be easier to cut your model up into its component pieces like those in a plastic model kit and apply your textures to each piece. Here's how to do this:


    1.

    Go to the Edit Geometry rollout of the Modify panel. Detach the desired group (or groups) of selected faces, and give each new object a unique name. Then apply separate Standard (not Multi/Sub-Object) materials and mapping coordinates to the individual pieces of the original object.

    2.

    There are times when you can't do this; sometimes you must keep your geometry in one piece. However, you can still cut apart your model, apply materials and mapping coordinates to each piece in turn, and then put the pieces back together.

    3.

    To rebuild, select one collapsed mesh piece, and from the Modify tab of the Command panel, click the Attach or Attach List button under the Edit Geometry rollout. (Or press the H key to bring up the Select By Name menu to speed up this process.) You'll be given the option of Condensing your existing Materials and ID numbers into a new Multi/Sub-Object material (Figure 10.18).

    Figure 10.18. The Attach Options box allows you to pick different types of Multi/Sub-Object material "consolidation" schemes.

    4.

    Go to your Material Editor and modify the components of this new Multi/Sub-Object material as necessary.


    Decal Techniques


    Here's another texture-mapping question commonly asked by newcomers to 3ds max: "How do you place a bitmap 'label'basically, a decalon top of another map?"

    There are many ways to layer textures in 3ds max. You can use Mix maps, Masks, Blend materials, Shellac materials, Composite materials, and combinations of all these. But the simplest way to add a Decal bitmap on another map is to make sure that the decal image has an alpha (masking) channel and then use it in a Mix map in a Standard material Diffuse Color slot.

    Applying a Decal


    Here are the specifics of how to make decals in 3ds max 7:


    1.

    Go to Command panel > Create tab > Create a Sphere, setting the radius to 50 units. Increase the Segments value to 60 to make it smooth, and make sure that the Generate Mapping Coordinates check box is checked (as mentioned earlier, it will be checked automatically unless you've deselected it).

    2.

    Open the Material Editor, click the first material slot, and go down to the Maps rollout. Click the Diffuse Color map button. When the Material/Map Browser appears, double-click Mix.

    3.

    In the Mix Parameters rollout, next to the Color #1 (black) swatch, click the Maps button, and from the Material/Map Browser, pick Noise. Leave the Noise settings as they are, then click the Go To Parent button to return to the top level of the Mix map.

    4.

    Click the Maps button next to the Color #2 swatch. From the Material/Map Browser, pick Bitmap. When the Select Bitmap Image File menu appears, go to the DVD and select the file Decal with Alpha.tga, then click the View button. The Decal with Alpha.tga image is a 32-bit image of beveled text.

    5.

    In the View window, click the Display Alpha Channel button to the right of the three (selected) RGB color component buttons. The text turns pure white. This is the alpha or masking channel for the color text.

    6.

    Close the View window, and then click Open to load the bitmap image into the Mix map Color #2 slot. Under the Bitmap Parameters rollout, click the Alpha radio button under the Mono Channel Output section of the menu. Then click the Go To Parent button to return to the top level of the Mix map.

    7.

    Left-click-drag the Color #2 Decal bitmap down to the Mix Amount map slot. When the Copy (Instance) Map menu appears, make sure Instance is selected, then click OK.

    8.

    Finally, make sure your sphere is selected, click the Assign Material to Selection button, then activate your Perspective viewport and render the scene. Your rendering should look something like the ActiveShade Perspective viewport (Figure 10.19). (Note that, for this illustration, the Show Map in Viewport button of the Decal bitmap is checked so that the bitmap appears also in the Shaded Perspective viewport.)

    Figure 10.19. The Decal bitmap with the alpha channel appears over the Noise texture on the sphere.

    [View full size image]

    Now you've got a Decal bitmap floating on top of the underlying Noise texture, but the decal is wrapped around the sphere using the default mapping coordinates. (It's also stretched horizontally, but we'll fix that in a second.) This is not the effect you would normally wantyou more likely want the decal to look like a label applied to a smaller area of the sphere.

    9.

    To do this, go back to the Material Editor, click one of the Instanced Decal with Alpha bitmap slots to open it, and under the Coordinates rollout, change both the U and the V Tiling from 1.0 to 4.0. Now rerender your scene (Figure 10.20).

    Figure 10.20. The Decal bitmap with U and V Tiling changed to 4.0.

    [View full size image]

    Now the decal is smaller on the sphere, but it's also tiled across the surface, and you want it to appear only once. You also want to fix the stretch problem, which is caused by the fact that the square Decal bitmap is made to appear twice as wide by the sphere's inherent Spherical mapping coordinates. Fixing both problems is not difficult.

    10.

    Return to the Material Editor. Under Coordinates, change the U Tiling from 4.0 to 8.0 (leave the V Tiling of 4.0 unchanged), then uncheck both the U and the V Tile buttons. (Don't check the Mirror buttons, eitherleave them blank as well.) Then rerender your scene (Figure 10.21). The Decal bitmap now appears smaller on the sphere, and the surrounding Tiled images of it disappear, since you unchecked the Tile boxes.

    Figure 10.21. The Decal bitmap with U Tiling changed to 8.0 and the Tile boxes unchecked.

    [View full size image]

    11.

    To reposition the decal on the surface of the sphere (while not affecting the underlying Noise texture), return to the Material Editor, and under Coordinates, adjust the U and V Offset values. Changing these will enable you to place the Decal bitmap anywhere you want. Experiment with these settings, and do some test renderings to see the results.



    • / 193