Jump to content
  • Advertisement
Sign in to follow this  
gamma_strahler

Unable to create mipmaps

This topic is 4079 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´m trying to use mipmapping, i have read many articles and tutorials, including the microsoft documentation, but i just can´t get mipmapping working in my application. i have a simple cube which i render with normal mapping, and everything works fine, except for the mipmapping issue. i load the textures from file with the D3DXCreateTexureFromFile method, and then call GenerateMipSubLevels, but nothing changes. I also have setup the correct filtering (linear for min, mag and mip filter). I also have tried to create the texture with the D3DXCreateTexureFromFileEx function, passing the D3DX_DEFAULT constant to the MipLevels parameter, which should create an entire mipmap chain (as stated in the microsoft docs). Additionally, using D3DUSAGE_AUTOGENMIPMAP in the useage parameter of D3DXCreateTexureFromFileEx also does not lead to the desired result. I don´t get any error messages, but it seems that i just can´t turn mipmaps on. What could i am doing wrong? My graphics card is an ATI 9600 XT, so i have the hardware to support mipmaps... thanks for any help! gamma_strahler

Share this post


Link to post
Share on other sites
Advertisement
Auto-generated mip-map's are hardware dependent, so it's understandable if they don't work. Make sure you call IDirect3D9::CheckDeviceFormat() with D3DUSAGE_AUTOGENMIPMAP to check.

However, generation of a mip-chain during loading should Just Work™ - what evidence do you have that suggests it isn't? What does IDirect3DTexture9::GetLevelCount() return?

Are you doing anything with setting the LOD or forcing any particular mip-map within your normal mapping shader?

Are you running with the debug runtime? If not, try it and see if you get any info/warnings.

Try running against the reference rasterizer if you think the hardware/drivers may not be doing things correctly.

hth
Jack

Share this post


Link to post
Share on other sites
I have checked the GetLevelCount() function, it returns a value of 10 - this means that the mipmaps are created.

But something is terribly wrong! As my cube rotates, and the shiny specular highlight becomes more apparent, the texels begin to swim and seem to randomly "pop". Overall, it looks typically like texturing without mipmaps. Unfortunately this artefact is not visible from a still screen shot.

Quote:

Are you doing anything with setting the LOD or forcing any particular mip-map within your normal mapping shader?

Are you running with the debug runtime?


No, i do nothing in particular to the LOD, just access the normal and base texture via the tex2D sampler.

How can i use the debug runtime? I´m very new and unfamiliar to Direct3D, since i used to program with OpenGL before.

thanks
Gammastrahler

Share this post


Link to post
Share on other sites
Quote:
Original post by gamma_strahler
How can i use the debug runtime? I´m very new and unfamiliar to Direct3D, since i used to program with OpenGL before.
This page has a detailed overview, but if you're using a recent SDK then don't look in the control panel, but in the 'DirectX Utilities' folder as part of your SDK's start-menu entry...

It would take a bit of effort, but you could try force-filling the different mip-levels with different colours and seeing if it fades between them as expected.

hth
Jack

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!