Jump to content
  • Advertisement
Sign in to follow this  
schupf

DX9: Rendering a simple quad

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

Hello,

I have made a main menu texture of size 360x500 in GIMP:
http://imageshack.us/f/850/gtqmenugimp.png/
The corners are transparent.

Now I map this texture in my DX9 application on a quad of size 360x500 (to be more precise: I render the quad with 4 vertices that are in normalized device space). The texture coordinates go from (0,0) to (1,1), thus the texture should me mapped once over the quad.

The rendering looks like this:
http://imageshack.us/photo/my-images/846/gtqmainmenuingame.png/
As you can see there is a strange grey line at the top of the main menu. I checked the texture in several images viewers and there is no grey line at the top of the texture! My address mode is wrap, Min/Mag/Mip Filters are Linear.
Has anyone an idea what could cause this line and how I remove it?

Second: I added text in GIMP to the texture (the text is anti-aliased) and if I watch the texture in any viewer the text looks pretty sharp. But when I render the quad with this texture the texture looks much blurier:
http://imageshack.us/f/804/gtqmainmenuheader.png/
I thought this could be a filter problem, so I changed Min/Mag/Mip Filters from Linear to Point, but then the text looks blocky/pixelated. Anyone an idea why the text in my texture looks so blurry when I render it even though it looks sharp on any image viewer?

Thanks!

Share this post


Link to post
Share on other sites
Advertisement
Have you generated mip maps for this texture? You can double check this with a frame grab from PIX, and then inspect the texture to see if there is more than one mip-level in it. If you only have the top level, then you will be forced to do bilateral filtering of the high res texture instead of using the mip maps to select an appropriately sized sub-image.

Regarding the gray line, it may have something to do with the one-half pixel offset from pixels to texels. If you google for it you will find lots of information about what it is, and how to correct it.

Share this post


Link to post
Share on other sites
Looks like you have AA turned on in the graphic cards settings. Also I noticed in the rounded corners that they need to be cleaned up (a few light grey pixels on both corners). If you were using DSprites then the issue would be non-square images but you said you did it with a quad (for the blurry image)....

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!