Jump to content
  • Advertisement

Archived

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

Lazy303

Multitextureing

This topic is 5928 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

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
Advertisement
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
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
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

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!