Bluring textures

Started by
2 comments, last by matthughson 18 years, 7 months ago
I have loaded a model into a D3DXMESH and rendered it by the simplest way. The textures are too sharp. When I open it in the mesh viewer the texture appears blured. I wanna know how can I do this blur. Thanks
.
Advertisement
I think you may be refering to the sample filtering. Try adding this to your initialization code:
        // DirectX 9	// This gets rid of the pixelated look of textures	m_pD3DDevice->SetSamplerState ( 0, D3DSAMP_MINFILTER, D3DTEXF_LINEAR );	m_pD3DDevice->SetSamplerState ( 0, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR );	m_pD3DDevice->SetSamplerState ( 0, D3DSAMP_MIPFILTER, D3DTEXF_LINEAR );        // DirectX 8 (and below I think)	m_pD3DDevice->SetTextureStageState ( 0, D3DTSS_MINFILTER, D3DTEXF_LINEAR );	m_pD3DDevice->SetTextureStageState ( 0, D3DTSS_MAGFILTER, D3DTEXF_LINEAR );	m_pD3DDevice->SetTextureStageState ( 0, D3DTSS_MIPFILTER, D3DTEXF_LINEAR );        // You only need to use one block or the other depending on what version of DX you are using

Also, running your game at a higher resolution can help too.

Matt Hughson
__________________________________[ Website ] [ Résumé ] [ [email=contact[at]matthughson[dot]com]Contact[/email] ][ Have I been Helpful? Hook me up! ]
hey this method works(I prefer the D3DTEXF_GAUSSIANCUBIC :)).Thanks.
But, there is not a way for me to control the bluring level through a number?!?
.
Not to my knowledge, just the different filter algorithms (which you seem to have discovered already). The filtering isn't really meant to be an actual special effect. If you want an actual blur effect, you will most likely need some sort of shader.

Matt Hughson
__________________________________[ Website ] [ Résumé ] [ [email=contact[at]matthughson[dot]com]Contact[/email] ][ Have I been Helpful? Hook me up! ]

This topic is closed to new replies.

Advertisement