DirectX - Multi Texturing



DirectX includes the blend of eight textures onto primitives with respect to single iteration. The usage of multiple texture blending is used to increase the frame rate. An application includes a pattern of multiple texture blending to apply various textures and shadows with various lighting formats which is called as specular lighting and diffuse lighting.

To use texture blending, the application should be first evolved. This information is found in the TextureCaps member of DirectX which includes D3DCAPS9 structure.

Texture Stages and the Texture Blending Cascade

Direct3D supports single-pass multiple texture which includes blend of texture stages. A texture stage takes two parameters and performs a blending operation on them, passing the particular result for processing or rasterization. The visualization of texture stage is visible in the following diagram −

Multi Texturing

As per the snapshot mentioned above, texture stages include blend of two arguments by using a specified operator. Common operations include simple modulation or addition of the color or alpha components of the arguments with respect to two dozen operations are supported. The arguments for mentioned stage can be an associated texture, the iterated color or alpha, arbitrary color and alpha stages.

Note − DirectX distinguishes the required color blending from alpha blending. Applications include the set blending operations and arguments which are needed for color and alpha individually, and the results of those settings are actually interdependent on each other.

The combination of arguments and operations are usually used by multiple blending stages which define a simple flow-based blending language. The results are gathered as one stage flow down to another respective stage and so on. The concept of results flowing from one stage to another stage is eventually be rasterized on the mentioned polygon and is often called the texture blending cascade. The following snapshot shows how the respective individual texture stages make up the texture blending cascade.

Texture Blending Cascade

The description of the diagram with respect to the above mentioned diagram is implemented below −

  • DirectX includes eight blending stages which helps to check the device capabilities. Each stage in a device has a zero-based index.

  • The first blending stage is referred as index 0, the second as 1 and the count goes up to index 7.

  • The system includes stages in increasing index order.

  • The system includes blends of the respective two stages and ignores the required stages.

Note − DirectX should implement all the respective stages to create a well-defined multi textured component.

Advertisements