Multitexturing (DX8)

Started by
2 comments, last by darookie 19 years, 6 months ago
Can someone tell me in general what is mutlitexturing and how it is used with DirectX8 ? Thanks !
There is nothing that can't be solved. Just people that can't solve it. :)
Advertisement
Multi-texturing is using more than 1 texture at a time, such as a diffuse texture (standard texture), a reflection/environment map texture, a bump map or normal map texture, a lightmap.

Many objects in our game use 4 textures, a diffuse texture, a reflection texture, a reflection mask (some parts are more reflective than others), and a lightmap. When using this combination, we want our resulting color to be:

color = diffusetexture * lighting * lightmap + reflection * reflectionmask.

How do you tell D3D to combine things this way? One was is to use pixel shaders. Another is to use the fixed pipeline via SetTextureStageState.

Read up on SetTextureStageState, try various colorops (and alphaops). Don't stop playing with them until you get it. Use MFCTex (included in SDK samples). Learn the terminology (ie: modulate = multiply, etc)
U see, the reason I asked for multitexturing is beacuse I'm writing a terrain generator and I read about detail maps being a greyscaled texture applyed multiple times over terrain's original (diffuse ???) texture.

To get more detail you need to use the detail map a x number of times over the original texture.
The document suggested using multitexturing or render the object x times adding the detail map texture (very uneffective).

There are eight stages for each texture (is it enough for the mentioned above??)

Can you tell me how it is done ? (in general ofcourse :) )
There is nothing that can't be solved. Just people that can't solve it. :)
Are you talking about texture splatting?
In general you just use SetTextureStage() and modify the pixel transfer settings (as mentioned above, use MFCTex from the SDK - toy around with the settings until you understand how they can be used). You can have as many textures as your hardware supports (usually four to eight) and mix them. They will be processed in one single pass, which is the magic behind multi-texturing. You can still emulate the effect by rendering multiple times with different texture settings and transfer functions.

This topic is closed to new replies.

Advertisement