Jump to content
  • Advertisement
Sign in to follow this  
jakovo

Using mipmaps with RT's in DirectX9

This topic is 2250 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,

I've been trying to create a texture as a RenderTarget, and I want to use mipmapping with that texture, so I create it with D3DUSAGE_RENDERTARGET | D3DUSAGE_AUTOGENERATEMIPMAP.

However, doesn't matter if I explicitly tell it to use X number of mipmaps or not, or if I use GenerateMipSubLevels() at some point, it will always have only 1 level.

I haven't found in the Doc's any information that DirectX9 does not support using mipmaps on a RT, however, I have google for any successfull case, and many have the same problem.

The only diference is when people are using XNA, in which case it is possible, but XNA docs state that mipmapping on RT does not work on XB360.. which makes me believe that natively XNA does something to support mipmapping with RT's that it is not supported by default on DX9.

Can anyone confirm this?... why does MSDN docs don't state that this is not possible?..

Thanks! Edited by ???

Share this post


Link to post
Share on other sites
Advertisement

However, doesn't matter if I explicitly tell it to use X number of mipmaps or not, or if I use GenerateMipSubLevels() at some point, it will always have only 1 level.
IIRC, you're supposed to explicitly specify 0 mip-maps when using auto-generation. Also, you will have a full-mip chain if you inspect the texture in PIX, but if you query via the API, the object will report that it only has 1 mip-level.

Share this post


Link to post
Share on other sites
Thanks Hodgman,

Yes, I have specified 0 mip-maps also, with same result.

using tex2dlod() in the pixel shader always returns the same level, and as you mentioned the API always report it has only 1 mip-level.

so, apparently there is no support for mipmaping on RT's using DX9.

but I can't confirm my assumption.

Thanks!

Share this post


Link to post
Share on other sites
using tex2dlod() in the pixel shader always returns the same level ... so, apparently there is no support for mipmaping on RT's using DX9
Hmm, that is strange... I have used them before, so it is possible.

Try using PIX to investigate the state of the RT, by capturing a frame from your game.
Also, what kind of GPU are you using? Older ones may not support this feature:
D3DUSAGE_AUTOGENMIPMAP is only a hint ... To check for support for automatic generation of mipmaps, check to see that D3DCAPS2_CANAUTOGENMIPMAP is set. If it is, call CheckDeviceFormat with D3DUSAGE_AUTOGENMIPMAP. If the return value is D3D_OK, the mipmaps are guaranteed to be autogenerated. If the return value is D3DOK_NOAUTOGEN, this means that the create call will succeed, but there won't be any mipmaps generated.[/quote] Edited by Hodgman

Share this post


Link to post
Share on other sites
Thanks Hodgman,

I have an ATI Radeon HD 5800 GPU (which supports Dx11), so at least the video card is not the problem.

Also, I have checked the return value I get from CheckDeviceFormat(), as the quote you sent... but it returns D3D_OK. :S

Share this post


Link to post
Share on other sites
Thanks kubera,

I have read the thread you sent, but I'm actually using plain DirectX9 in my application (not DX11 with a lower Feature Level), so in this case both Vertex and Pixel shaders are 3.0... but thanks anyways ;)

Has anyone else had any successful story trying to create a Render Target with Mipmaps?... and if so do you remember what else did you did to achieve that?

Share this post


Link to post
Share on other sites
One other thing you could check is your sampler state when using [font=courier new,courier,monospace]tex2dlod[/font] - maybe the problem is with [font=courier new,courier,monospace]D3DSAMP_MIPMAPLODBIAS[/font]/etc instead of with the creation of the texture?

Share this post


Link to post
Share on other sites
Thanks kubera,

Yes, I had already tryied to post a message on MS's forums to get ant response, unfortunateley the page is buggy and when you try to write the post (or send it when you have had luck to write it) errors keep appearing in the page and in the end no message is sent to the forums :(

Good observation Hodgman, I have just checked if the problem was there... however it doesn't seem to be the problem sad.png

looks like right now the only option is to get some confirmation by someone at Microsoft that this is really not possible (and if it is, what is the approriate way to do it)... the application's code is relativeley small so there should not be many weird things happening inside that could make it to miss behave the way it does.

if I get any news about it I will let you know.

Thanks! Edited by ???

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!