Textures and Texture Maps

Textures add realistic effects to your materials. Your materials can include multiple texture maps. These 2D images or maps are projected onto the face of 3D objects and surfaces to provide photorealistic effects. The texture map is defined by an AcGiMaterialMap object. These objects describe the dimension, source, format, and mapping of the texture to the solids and surfaces to which the material is applied.

The following material channels accept texture maps:

Materials can define multiple channels and enable or disable them individually. Use AcDbMaterial::setChannelFlags() to control which channels are enabled. This is especially useful when rendering complex materials. You can preserve the material settings, while disabling required channels to speed up the render.

Diffuse maps assign an image or pattern to a material’s diffuse color. The colors of the map will replace the material’s diffuse color.

Bump maps bring realism to your scene by adding depth to the map. Dark areas on the map are interpreted as having no depth, while lighter areas are interpreted as projecting. Images selected for the bump map are converted to gray-scale.

Reflection maps simulate the reflection of your scene on the surface of a shiny object. These maps render well only if they have a high resolution and are applied to shiny objects. This is a fast way of simulating a mirror in your scene.

Opacity maps specify areas of opacity and transparency on an object. Like bump maps, the gray-scale value of images is used. Darker areas are seen as transparent and lighter areas as opaque.

In addition, the following texture maps are added to create more organic, real life materials:

These texture maps can be assigned to all material channels — diffuse, reflection, opacity, and bump — and for all material types (Advanced, Advanced Metal, Realistic, and RealisticMetal). An unlimited level of nesting is provided for these texture procedural maps.

A map channel preview window is displayed at each map level. It provides you with a potentially larger, more detailed view of the selected map channel. Any change made on the texture map value at the sub-type level can be viewed independently and also gets reflected in the general material preview swatch. You don’t have to do a final render every time you update a material. The background color of all swatches is changed from (0,0,0) to (51,51,51) to align and be consistent with preview swatch background in 3DS Max.

The AcGiVariant class is used as the basis for the generic data storage for procedural material definitions.

The source of an AcGiMaterialMap can be either a procedural texture or an image file based texture. Image file based textures are defined by AcGiImageFileTexture objects, while procedural textures are defined using AcGiProceduralTexture-derived classes.

Image file based textures project the image data onto the solid or surface to which they are applied. Using image files is time consuming and memory-intensive. Procedural textures provide a higher level of detail in some cases and faster rendering than image file based textures.

Procedural textures provide less resource-intensive texture maps for some materials. A list of textures and their descriptions is as follows:

AcGiWoodTexture

A diffuse component for a material to provide realistic wood grain

AcGiMarbleTexture

A diffuse component for a material to provide realistic marble grains

AcGiGenericTexture

A generic texture that can be used to simulate a checker, tile, or wave pattern along with adding noise and travertine to a material

Advanced lighting overrides create more realistic results from within the material palette. They are:

The values for these can be set using AcDbMaterial::setColorBleedScale(), AcDbMaterial::setReflectanceScale(), AcDbMaterial::setTransmittanceScale(), and AcDbMaterial::setIndirectBumpScale(). The default value is set to 1.

You can also set a two-sided flag using AcDbMaterial::setTwoSided(). It determines whether the material applies to both sides of each face.

When you save a drawing in AutoCAD where some materials are not using the “two sided material“ option and render them in previous AutoCAD releases, they automatically render as two sided. If you save that same drawing in older versions of AutoCAD and render it in the current AutoCAD , then the materials for which the “two sided material” option is disabled remains unchanged.