# Image Rendering Quality Is Low?

This topic is 4623 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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 on other sites
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 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 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 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 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 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 on other sites
 too slow.
Ok, sorry, that was a lame version :)

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 on other sites
Alright, resizing solved the problem! Thanks guys! :D

1. 1
2. 2
frob
16
3. 3
4. 4
5. 5

• 18
• 13
• 14
• 76
• 22

×