Archived

This topic is now archived and is closed to further replies.

Lazy303

Multitextureing

Recommended Posts

Lazy303    122
I just want to blend to textures together. I copied this code from the "Direct3D 7 Immediate Mode Framework Programming 3: Multitexturing " article. But it doesn''t work! I'' checked the hardware, and it supports multitextureing. I even use the same textures... but I use dxsdk81 instead of 7.0 m_pd3dDevice->SetTexture(0, D3DTextr_GetSurface("wall.bmp")); m_pd3dDevice->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE); m_pd3dDevice->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_SELECTARG1); // Set darkmap m_pd3dDevice->SetTexture(1, D3DTextr_GetSurface("env0.bmp")); m_pd3dDevice->SetTextureStageState(1, D3DTSS_COLORARG1, D3DTA_TEXTURE); m_pd3dDevice->SetTextureStageState(1, D3DTSS_COLORARG2, D3DTA_CURRENT);

Share this post


Link to post
Share on other sites
Dean Harding    546
You also need to set the D3DTSS_COLOROP texture state for stage 1. The default for stage 0 is D3DTOP_MODULATE, and for all other stages it''s D3DTOP_DISABLE. That means you need to add the following:

m_pd3dDevice->SetTextureStageState( 1, D3DTSS_COLOROP, D3DTOP_MODULATE );

Replace D3DTOP_MODULATE with whatever effect you''re looking to achieve (modulate multiples the inputs, which may not be what you want...)


codeka.com - Just click it.

Share this post


Link to post
Share on other sites
Lazy303    122
I''ve tried that too...
only on texture is shown... but it''s alot darker.

I''ve used the same textures that are used in the multitexturing article
http://www.gamedev.net/reference/articles/article1028.asp

Share this post


Link to post
Share on other sites
Lazy303    122
I just noticed that it does blend the to textures together...!
but it only uses the pixelcolor of the first pixel in the second texture.
Why is that?

Share this post


Link to post
Share on other sites