Jump to content
  • Advertisement
Sign in to follow this  
zurekx

[.net] Mipmapping i C# looks strange

This topic is 3751 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've started to write some DirectX code in C#. The problem is that mip-mapping looks ugly, cause you can clearly see when the mipmap is changed. I have a rotating box and you see "lines" on it due to different mip-levels, it looks really weird. I load my textures using texture = Texture.FromBitmap(DX_Device, testImage, Usage.AutoGenerateMipMap, Pool.Managed); and I set DX_Device.SamplerState[0].MipFilter = TextureFilter.Anisotropic; Any ideas? Edit: I opened NVIDIA control panel and set Anisotropic Filtering to 16x, which seems to have solved the problem. Can I set this from DX?

Share this post


Link to post
Share on other sites
Advertisement
A couple of suggestions:

1) Try to set the mip filter to linear and see if that works.

2) Try to do this instead:

DX_Device.SetSamplerState(0, SamplerStageStates.MipFilter, (int)TextureFilter.Linear);

Share this post


Link to post
Share on other sites
Thanks! It seems to work with DX_Device.SetSamplerState. How come I get a different result using that instead of DX_Device.SamplerState[0]..?

Share this post


Link to post
Share on other sites
Quote:
Original post by zurekx
It seems to work with DX_Device.SetSamplerState. How come I get a different result using that instead of DX_Device.SamplerState[0]..?


No idea, I just remember having a similar problem so I thought I'd suggest it. As far as I know, MDX has it's fair share of problems, so you should probably switch to SlimDX.

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!