My texture becomes turbid. Why?

Started by
4 comments, last by Metin 22 years ago
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); ...
Advertisement
_First - Im not sure if sending 0 fir width/hegith is right, Im not sure. Try passing D3DX_DEFAULT

_2 - For Miplevels, try passing 1.

_3 - For Format pass D3DFMT_A8R8G8B8

[ my engine ][ my game ][ my email ]
SPAM
Rate me up.
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_
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...
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);
-------------

Is that the same as setting the TextureStageState (SetTextureStageState)? Or is it a completely different thing?

zilch_

This topic is closed to new replies.

Advertisement