Jump to content
  • Advertisement
Sign in to follow this  
Aethiron

Image Rendering Quality Is Low?

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

Various artifacts in render In this simple screenshot I am trying to render an image with an alpha channel (have tried both PNG and DDS), but on both formats there are various artifacts, such as on the lower right hand side of "P" in "Pong" (distortions along the edges) and on other various places. These artifacts are then amplified (meaning enlarged) when the application runs fullscreen 640x480. I've been tweeking with many things, such as texture filters and such, but I cant find the source of the problem. Are textures just like this when they have an alpha channel, or is there a way to increase the quality of the render? What factors lead to this problem? (I know its not compression, I've tried all that) Oh, and im using C++ DirectX 8.1 (Using the DirectX9 December 2005 sdk) Here's the way im loading the texure:
hResult = D3DXCreateTextureFromFileEx(m_pD3DDevice, "Data\\gfx\\ttl\\logo.dat",
		D3DX_DEFAULT, D3DX_DEFAULT, 5, 0, D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, D3DX_DEFAULT,
		D3DX_DEFAULT, 0, NULL, NULL, &m_pLogo);
	if (FAILED(hResult))
	{
		MessageBox(m_hWnd, "Failed to load Image Surface",
			"DirectX Error", MB_OK);
		strcpy(m_szErrorMsg, "InitIntro()");
		return hResult;
	}

Any errors? Thanks!!!!

Share this post


Link to post
Share on other sites
Advertisement
It can be done by simply increasing the resolution of your texture, e.g. a 256x256 texture will have significantly less details(=quality) than a 512x512 one.

Share this post


Link to post
Share on other sites
Thanks for the suggestion!

But then an increase in data size would be another factor. I have the texture mapped on a 1:1 pixel ratio, so I dont think there should be those kind of artifacts....


hmmm?

Share this post


Link to post
Share on other sites
Here's the original Logo for comparison:



Its a png with an alpha channel, so thats why it has a grey background in IE.

You can really see the artifacts on the "g", especially on the left and right edges.

Share this post


Link to post
Share on other sites
Be sure to have a look at Directly mapping texels to pixels. (This copy is archived, but it hasn't changed in recent SDKs [lol]).

This could certainly have an effect on rendering quality. Also, you could try setting the MAG, MIN, and MIP filters to point, as a last resort.

Share this post


Link to post
Share on other sites
Thanks for the Link!. I took a look at it and went through most of the MSDN archives earlier and couldnt find any applicable algorithms. It just teaches the concept but not the method. I tried changing the filtering to Point, but it seemed worse than using D3DX_FILTER_TRIANGLE | D3DX_FILTER_DITHER...

Any other suggestions? XDD;;

Share this post


Link to post
Share on other sites
If your image isn't a power of 2 in size it will be resized at load time which could explain the artifacts. Try resizing the image to be 512x256 (just add empty space as appropriate).

Share this post


Link to post
Share on other sites
[edit] too slow.
Ok, sorry, that was a lame version :)

Heres the newer version. Sorry about that :).

Another thing that just popped to mind is the power of two issue. If your texture isn't a power of two, DX might be resizing it to be acceptable in size.

As a test, I'd recommend you use your image software to make the image width and length a power of two (16, 32, 64, 128, 256, 512, 1024, 2048 - just avoiding misunderstandings [lol]).
This might help solve quality problems.

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!