Skip to main content
GameDev.net gamedev.net
🔒 Locked

Bluring textures

Started by xissburg Aug 27, 2005 at 4:25 PM 2 replies 600+ views
Original Post
xissburg
xissburg
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
.
matthughson
matthughson
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! ]
xissburg
xissburg
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?!?
.
matthughson
matthughson
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! ]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.