Jump to content
  • Advertisement
Sign in to follow this  
streamer

background texture problem

This topic is 4756 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 made a texture 800*600 and opened rendering screen exactly 800*600, but when I render a quad with texture aplied on it texture seems dithered, ad doesn't look exactly as original texture. I tried to change parameters n D3DXCreateTextureFromFile on D3DX_FILTER_**** but that doesn't seem to solve my problem. What can be the problem? Thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement
1) Directly mapping texels to pixels

2) If you're using the fixed function pipeline and transformed vertices, make sure the RHW element of your vertices is set to 1.0.

3) If your application is running in windowed mode, make sure the *client* area of the window is adjusted to 800x600. When you open a window with a size of 800x600, that size includes the title bar and frame of the window, use AdjustWindowRect() to adjust the size to take those into account.

Share this post


Link to post
Share on other sites
A screenshot helps when we have to approach such mistakes such as "quality" problems. If you are talking about the texture loosing quality or it's edges are dithered you might want to consider looking at filtering.

When you are creating textures you should keep at power of 2 textures to ensure unexpected results. 800x600 isn't a power of 2 texture compliant texture. Something like a 512x512 texture is a power of 2 compliant texture.

You can look at setting the texture sampler states.
IDirect3DDevice9::SetSamplerState() takes a parameter that specifies the type of filtering you want to apply on the texture.

i.e.
IDirect3DDevice9::SetSamplerState(0, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR);
IDirect3DDevice9::SetSamplerState(0, D3DSAMP_MINFILTER, D3DTEXF_LINEAR);
sets the minification and the magnification filters when the texture is stretched etc...

If you want to make sure that there is filtering applied when you are using mipmaps you can specify that too
i.e.
IDirect3DDevice9::SetSamplerState(0, D3DSAMP_MIPFILTER, D3DTEXF_LINEAR);

I hope this helps buddy.
Take care.

Share this post


Link to post
Share on other sites
Thanks for you reply.
Here is a screenshoot.

I'm using a directx 8:
so min & mag filters are:
m_pd3dDevice->SetTextureStageState(0, D3DTSS_MAGFILTER, D3DTEXF_NONE); m_pd3dDevice->SetTextureStageState(0, D3DTSS_MINFILTER, D3DTEXF_NONE);

or LINER etc..
but that don't work...
my client area is 800x600, I had set UV coordinates normaly (0.0f - 1.0f for corners), RHW element of vertices are set to 1.0...

Share this post


Link to post
Share on other sites
I think you mean the sort of rectangular things all over the image. Is this correct, or is this an effect you're trying to deliberatly do?

Also, an image of the original could well help understanding exactly what the difference is.

Also, any chance the image is in 32bit color and you're using 16bits in game? Also, (though I'm not sure how relevant this is), is the image in RGB color, or some different type like CMYK or something ;).

Hope this helps.

Share this post


Link to post
Share on other sites
Are you using any kind of texture compression? Also make doubly sure that D3DSAMP_MIPFILTER is set to D3DTEXF_NONE, and run it through the debug runtimes to see if that is spitting anything out at you.

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!