Jump to content
  • Advertisement
Sign in to follow this  
DesignerX

Multitexturing (DX8)

This topic is 5398 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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)

Share this post


Link to post
Share on other sites
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 :) )

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!