Torque/LightingSystem/Interior Detail Mapping

From TDN

Introduction

Adding detail mapping to interior surfaces. (NOTE: Detail mapping is disabled in TGEA.)

Contents


Interior Detail Mapping

Detail mapping makes interior surfaces look highly detailed even when viewed up close without resorting to excessively large textures. Detail mapping works by blending a gray-scale texture with baked-in lighting over-top of interior surfaces. Though both the diffuse and detail textures are relatively small the blending creates significantly more detail than either of the individual textures. Equally as important detail textures can be shared among several diffuse textures minimizing memory and disk usage.

Image:TLK-Detail.jpg

Detail textures are gray-scale images containing baked-in bump data with an average intensity of 127 (out of 255 - use your texture editor's histogram to verify the average intensity). It's best to avoid distinct patterns and heavy detail, otherwise tiling can become apparent.

Image:TLK-Wall_detail.png

Detail textures are applied to interior surfaces with Torque's built in material system using the following script call:

addMaterialMapping("<diffuse texture name>" , "detail: <full path to detail texture>");

Which is usually called in "~/data/ini.cs" so it's mapped on the client and the server. This call maps the referenced detail texture to the material that contains the target diffuse texture. Whenever the diffuse texture is applied to an interior surface the detail texture is also applied.

Detail mapping only works on video cards with four or more texture units (TGE's Direct X wrapper only supports two texture units, so detail mapping is unavailable in Direct X mode).