Jump to content
  • Advertisement
Sign in to follow this  
xissburg

Bluring textures

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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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?!?

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!