Jump to content
  • Advertisement

Archived

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

supergeek2k

Direct3D Mip Mapping

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

Hi all I am learning Direct3D and I am attempting to create a common API which will work on both DIrect3D and OpenGL platforms. In OpenGL if I use mipmapping and the GL_LINEAR_MIPMAP_NEAREST minification filter and the GL_LINEAR mag filter textures will look smooth when looked at from an angle although slightly blurred. I am trying to acheive a similary type of mipmapping with Direct3D and I cant seem to get it. I keep getting jagged rough textures when looking at an angle or a distance. I am creating my textures using D3DXCreateTextureFromFileEx like this: hr=D3DXCreateTextureFromFileEx( d3dDevice, filename, 0, 0, 0, 0, D3DFMT_UNKNOWN, D3DPOOL_DEFAULT, D3DX_FILTER_TRIANGLE, D3DX_FILTER_TRIANGLE, 0, NULL, NULL, &d3dtextures[numtextures] ); I have tried with different combinations of filter types and the result is the same. I also set the min and mag filters with SetTextureStageState calls and I have tried every combination of filters that are shown in the DX8 docs. A screenshot of the difference can be seen here: http://www.chilloutmarine.com/ss.html The top image is the result from DirectX and the bottom image is from OpenGL. Any ideas on what I might be doing wrong would be greatly appreciated Thanks alot, Geek

Share this post


Link to post
Share on other sites
Advertisement
Hey, there! Now I understand your problem because I had the same problem with my project but I am not on my computer so I can''t tell you the exact syntax of the line. You need to set the texture stages for the texture so that the minfilter and maxfilter are set to linear..
Search for the texture stage min and max in the docs to give the exact syntax. After you have that set before you render you should be fine.

~Wavewash

Share this post


Link to post
Share on other sites
Hi Wave thanks for the response.

I am setting my min and mag filters like this:

d3dDevice->SetTextureStageState(0,D3DTSS_MINFILTER, D3DTEXF_LINEAR);

d3dDevice->SetTextureStageState(0,D3DTSS_MAGFILTER, D3DTEXF_LINEAR);

is this what you are talking about?

This doesn''t seem to help I have also tried this with the different filters and same result.

Or are you talking about something different?

Thanks,
Geek

Share this post


Link to post
Share on other sites
Well I figured out my problem.
I was setting minification and magnification filter but Direct3D also has a MIP filter for mip map stages. I set my mip filter like this:

d3dDevice->SetTextureStageState(0,D3DTSS_MIPFILTER, D3DTEXF_LINEAR);

and it looks alot better now

Thanks,
Geek

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!