Accessibility
 
Home > Products > Director > Support > Basics of Director 3D
Macromedia Director Support Center - Basics of Director 3D
Texturing and mapping

Texturing and mapping are important ways to control the size of your models. Throughout the history of 3D games, carefully painted texture maps have supplied the details for lightweight models. Constraints imposed by video cards that lacked acceleration and had limited memory, as well as primitive shaders and slow CPUs, have produced a specialized niche of artists creating those detailed textures. Today these limitations are still present in Shockwave 3D, but they are rapidly easing. You can now acquire an accelerated video card with 16 MB RAM for less than $100, and the best cards available make W3D movies run at frame rates that are better than video and film.

 
About shaders, materials, and texture maps
3D modeling tools use the terms shader, material, and map in a specialized way.

Shaders are the algorithms that define the overall look of a mesh. Examples are Gouraud, Phong, Lambert, and Blinn, named after their creators. The shader defines how any material created in it will handle shininess, opacity, bumps, and so on. Shockwave 3D, like most game engines, supports only the Gouraud shader. If you author in 3D Studio Max, it is recommended that you use either the Phong or Blinn shader because of the look they produce and because they translate well to Gouraud (which isn't an option in 3D Studio Max). If your package supports Gouraud shading, it's likely to be easier to develop with this shader.

Material refers to the totality of the look made within the shader. Since Shockwave 3D supports only one shader, Director's documentation doesn't draw the distinction you'll find in the 3D modeler's documentation. The material includes the color, transparency, shininess, and bump. For example, the same red can be applied to glassware, a motorcycle gas tank, or a brick wall, and you won't notice the similarity because of the other material characteristics.

A texture map (also called a map or texture) can be a bitmap image or a gradient, and it applies to only one of a material's attributes. For example, a model's texture color (or diffuse color) can contain an image or a gradient. Your 3D package likely supports maps (or multiple maps) in each map channel (such as ambient, diffuse, specular, glossiness, bump, opacity, filter). Each of these channels can contain multiple maps combined into complex blends or composites (map trees). Generally, a diffuse color map (for example, a picture) overrides the diffuse color (for example, blue). In modelers such as 3D Studio Max, you can apply a map at less than 100% opacity, in which case the diffuse color and texture map are blended in the given proportion. However, Shockwave 3D does not support map trees.

Shockwave 3D supports texture maps that are either bitmaps or 2D procedural maps (for example, checker or gradient), and only in certain map channels. That is, you can apply a texture map to the diffuse channel, including a file with an alpha mask (such as Targa or TIFF). On export, all texture maps are converted to the JPEG format (24 bits), including the 8-bit alpha channel; the texture will export and appear properly. Two-dimensional procedural maps, such as checker and gradient maps, are likewise converted to JPEG images during export. Although texture maps in the bump and opacity channels will export, they will not appear in this version of Shockwave 3D.

The exporter allows you to choose compression settings for textures. Since JPEG is a lossy compression format, take care when using the exporter settings. A texture that is already in JPEG format undergoes two compressions—one when the image is created, and another during export. This won't occur if you use Targa, TIFF, or even a procedural texture map, because they undergo only one JPEG compression.

The texture map file format affects the size of the W3D file. A JPEG source results in a smaller file than a Targa source, but a JPEG file cannot have an alpha channel. You can create a diffuse texture by taking advantage of an alpha channel with Targa or TIFF, but at the expense of increasing file size.

Although you can't use a texture map to set shininess, opacity, or self-illumination, you can affect the material's look using the settings in the material itself. You can't use a bitmap on a highlight on the model, but you can set the amount and color of the shininess that makes up the highlight. (The Lingo programmer can apply the same texture map to the specular channel). Animated textures are not supported. You can't blend or composite texture maps within a single map channel (for example, create hierarchical map trees), but you can supply separate maps for this purpose in Director. As with modeling, texturing for Shockwave 3D involves dividing labor between the 3D and Director tools. Lingo permits you to assemble up to eight texture maps, which can be blended, composited, and spread across multiple map channels, enabling the Shockwave 3D artist to come very close to the original look as rendered in a Gouraud shader without anti-aliasing.

 
Simulating bump maps
The Shockwave 3D renderer does not support bump maps. Bump maps are texture maps that use the grayscale value of a map to add the look of bumps or pits to a rendered surface. They are a product of lighting and have no effect on the geometry. For example, suppose you have a bump map that makes the surface of a basket appear bumpy; if you examine the image edges closely, you'll see that no actual bumps are added to the profile.

To create the illusion of a bump map, you need a displacement map, which may or may not be supported, depending on your 3D modeler. In 3D Studio Max, for example, you can deform geometry based on a bitmap grayscale by applying a displace modifier to the mesh. The deformed mesh will export, but its resolution depends on the mesh's density. 3D Studio Max also supports subdivision surfaces (SDS) displacement—a more selective, efficient solution—but does so through the Material Editor's displacement map channel, which is not supported by Shockwave 3D and won't export.

You can compensate for the lack of bump maps in two ways:

Add detail by subdividing polygons, as discussed in Using adaptive resolution technologies.
Use a gradient texture with 2D Noise. Specifically, create a gradient with a single hue, with one extreme using a fully saturated color and the other one using an unsaturated one. Add noise to the gradient. Use this as a diffuse texture map, and keep the shininess low.

 
Using reflection and refraction maps
Reflection maps export properly in Shockwave 3D. Refraction maps export, but do not produce a refraction effect; instead, they appear as self-illuminated specular maps. When applied, these maps export at full force; varying the percentage or density within the 3D application has no effect. This means reflections may block out the diffuse color or map.

 
Working with opacity and transparency
Opacity and transparency present a special problem, because Shockwave 3D doesn't support two-sided materials: only one side of the face is rendered. If you reduce opacity, you see through the front surface but do not see the back or inside surface of the object. To portray an object like a bottle, you must clone the geometry, flip the face normals on the clone, and apply the same transparent material; this displays the inside and outside of the bottle. But with transparent objects like bottles, the opacity is greatest at the center and falls off at the edges. Shockwave 3D doesn't support fall-off transparency. The best workaround is to build the fall-off effect into the reflection map image using your image editor.

Shockwave 3D also doesn't support effects such as filtered light or "caustics," where light is colored as it passes through the translucent medium. You can achieve caustic effects in Lingo by applying colors to lights and creatively texturing the surface of the environment, such as the table a vase sits on, or the bottom of a swimming pool.

 
Working with shadows
Shadows require more care than other 3D elements. For simple ambient shadows or indirect lighting, you can tint portions of a bitmap texture or paint shadows on it and then set complementary lights in the scene. You can also use attenuation/fall-off settings in spotlights to limit what the light illuminates: the dark areas become shadows by default.

For shadows cast by objects, the Lingo programmer can animate a gray, translucent planar object with appropriate alpha masking to simulate shadows. To achieve complex shadows or reflections, you can place a camera in line with the character and the light source, then project that silhouette back into the scene, so the shadow moves in sync with the animation. Depending on how you do this, it may involve another rendering pass. But if speed is the important factor, shadow detail is likely to be of secondary importance.

 
Mapping textures
Texture mapping refers to how a texture is positioned on a mesh; you specify texture coordinates as points on models. Don't confuse texture mapping with environment mapping, which refers to how textures are applied to the scene background at infinite range from the camera. (Environment mapping is not supported during export to W3D, but you can apply it in Director using Lingo.)

Texture coordinates are distinguished from geometric points in space (that is, XYZ) with U,V, and W values. In fact, UVW is the texture equivalent of XYZ. Shockwave 3D supports UVW coordinates; this means that it supports the 3D Studio Max UVW Map and Unwrap UVW modifiers and other third-party plug-ins or applications based on UVW coordinates. For example, Right Hemisphere's Deep Paint 3D or Maya's Paint Effects module will work with Shockwave 3D.

Your means of adjusting mapping coordinates will depend on which modeler you are using. In 3D Studio Max, UVW coordinates may be built in, as is the case with primitives or loft objects. In addition, you can impose a new set of coordinates by applying a UVW modifier at the top of the model's modifier stack. The modifier lets you choose a type of coordinate projection (such as planar, cylindrical, spherical, box, face); orientation along the X, Y, or Z axis; and the size and position of the coordinates. Shockwave 3D supports mapping adjustments though the modifier, but not those made through the Material Editor. (This can prove problematic for the 3D Studio Max artist who is trained to adjust the coordinates globally in the Material Editor and refine them on individual objects using the settings in the UVW map modifier.)

There are two parts to 3D Studio Max's UVW map modifier: the user interface controls and the "Sub-Object Gizmo."

The user interface controls allow you choose the type of coordinates and their axis orientation; it also allows you to scale, tile, and flip the texture map coordinates.

The Sub-Object Gizmo (accessible through the Sub-Object button) provides another way to scale and tile the bitmap and is the only way to move or rotate texture coordinates. There is no way to mirror coordinates or turn off tiling in the modifier. If you want to apply a single texture map to a surface, or apply several different texture maps to an object, you must use a multi/sub-object material. This involves two operations:

1 At the face or polygon sub-object level of the editable mesh, make the desired face selections and assign each a material ID.
2 Make a multi/sub-object material consisting of sub-object materials corresponding to each material ID. (The number of the sub-object material in the Material Editor corresponds to the material ID number.)
Shockwave 3D supports a maximum of eight texture maps per shader. In 3D Studio Max, each standard material is a separate shader. A multi/sub-object material for Shockwave 3D in theory could have 999 sub-object materials, each with up to eight texture maps. The real limitation is the hardware capability of the target platform; your decisions concerning your target audience should set your limits.

To Table of Contents Back to Previous document Forward to next document