Jump to content
  • Advertisement

Archived

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

Metin

My texture becomes turbid. Why?

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

Please look at this image and tell me the reason of this turbidity. http://alizee.super-people.com/image.bmp (58kb) ----------------------- Some part of code: ... D3DXCreateTextureFromFileEx(g_pd3dDevice, "img1.bmp", 0, 0, 0, 0, D3DFMT_UNKNOWN, D3DPOOL_MANAGED, D3DX_DEFAULT, D3DX_DEFAULT ,0xFFFF6AB5, NULL, NULL, &pTexture); ... ... g_pd3dDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE); g_pd3dDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA); g_pd3dDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA); g_pd3dDevice->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_MODULATE); ...

Share this post


Link to post
Share on other sites
Advertisement
try chaning the min/mag filter :

this->d3dDevice->SetTextureStageState(0, D3DTSS_MINFILTER, $ANOTHER_FILTER);
this->d3dDevice->SetTextureStageState(0, D3DTSS_MAGFILTER, $ANOTHER_FILTER);

where $ANOTHER_FILTER is one of the ones found here:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dx8_c/hh/dx8_c/graphics_enum_4wc3.asp

I''m a newbie though (now you''re warned )

zilch_

Share this post


Link to post
Share on other sites
I think you need your geometry to overlap every corner by 0.5 (assuming transformed vertices) pixels in order to avoid any filtering, search msdn for the exact article, and I remember a thread about that here @ gamedev, too...

Share this post


Link to post
Share on other sites
Thank you for your replies,

I''ve solved my problem by changing the Filter to "D3DX_FILTER_POINT".


-------------
D3DXCreateTextureFromFileEx(g_pd3dDevice, "d1.bmp", 78, 64, 0, 0,
D3DFMT_A8R8G8B8 , D3DPOOL_MANAGED, D3DX_FILTER_POINT ,
D3DX_DEFAULT ,0xFFFF6AB5, NULL, NULL, &pTexture);
-------------

Share this post


Link to post
Share on other sites
Is that the same as setting the TextureStageState (SetTextureStageState)? Or is it a completely different thing?

zilch_

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!