Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


DX9: Fuzzy Textures: Brain fart: help

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

For the life of me I have no idea what I am doing wrong. I am setting up my device thus:
	// get the display mode
	g_pD3D9->GetAdapterDisplayMode(D3DADAPTER_DEFAULT, &d3ddm);

	// set the presentation parameters
	ZeroMemory(&d3dpp, sizeof(d3dpp));

    d3dpp.SwapEffect = D3DSWAPEFFECT_FLIP;
    d3dpp.BackBufferFormat = D3DFMT_UNKNOWN;
	d3dpp.BackBufferWidth = width;
	d3dpp.BackBufferHeight = height;
	d3dpp.BackBufferCount = 3;
	d3dpp.BackBufferFormat = d3ddm.Format;
	d3dpp.SwapEffect = D3DSWAPEFFECT_FLIP;
	d3dpp.Windowed = !fullscreen;
	d3dpp.EnableAutoDepthStencil = false;
	d3dpp.AutoDepthStencilFormat = D3DFMT_UNKNOWN;
//	d3dpp.EnableAutoDepthStencil = true;
//	d3dpp.AutoDepthStencilFormat = D3DFMT_D16;
	d3dpp.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT;
	d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
	d3dpp.MultiSampleType = D3DMULTISAMPLE_NONE ;

	// create the device
		return E_FAIL;
I am rendering thus:
	hResult = pD3DDevice9->SetRenderState(D3DRS_CULLMODE,D3DCULL_NONE);
	hResult = pD3DDevice9->SetRenderState(D3DRS_LIGHTING, FALSE );
	hResult = pD3DDevice9->SetRenderState(D3DRS_MULTISAMPLEANTIALIAS, FALSE);
	hResult = pD3DDevice9->SetRenderState(D3DRS_DITHERENABLE , FALSE);

	hResult = pD3DDevice9->SetTexture( 0, m_pInvaders );
	hResult = pD3DDevice9->SetSamplerState( 0, D3DSAMP_MIPFILTER, D3DTEXF_NONE);
	hResult = pD3DDevice9->SetSamplerState( 0, D3DSAMP_MAGFILTER, D3DTEXF_NONE);
	hResult = pD3DDevice9->SetSamplerState( 0, D3DSAMP_ADDRESSU, D3DTADDRESS_CLAMP);
	hResult = pD3DDevice9->SetSamplerState( 0, D3DSAMP_ADDRESSV, D3DTADDRESS_CLAMP);

	hResult = pD3DDevice9->SetStreamSource( 0, m_pVB, 0, sizeof(CUSTOMVERTEX) );
	hResult = pD3DDevice9->SetFVF( D3DFVF_CUSTOMVERTEX );

	hResult = pD3DDevice9->DrawPrimitive( D3DPT_TRIANGLELIST, 0, m_cSwarm.size() * 2);
My texture is a 32x32, the texture coordinates are correct because I can tell all the bits of the sprite are correct, but for the life of me I cannot figure out why on earth when the sprite on the screen is larger than the 32x32 texture its all fuzzy. I know its got to do with antialiasing, but as you can see I have disabled the mip mapping (there are no mips anyway, its just incase), and disabled the magfilter. Why then are my textures all fuzzed out? I''m having a major brain fart, its driving me nuts.

Share this post

Link to post
Share on other sites
/kisses S1CA on the forehead

Now I just need to figure out a way to disable the features my video card provides automatically, which being a Mobile ATI 9000, you can set texture preferences between performance to quality. The higher the quality the more fuzzy when you ''stretch'' the texture.

Not good when you are writing Space Invaders.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!