Jump to content
  • Advertisement

Archived

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

BlueChip

a quick question about mipmap&d3d

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

hi people, I was beginning to create my texture in various resolutions in order to implement the mipmappig, when I''ve see D3DSAMP_MIPFILTER in SetSamplerState method...so I''ve actived a mipmap filter m_pd3dDevice->SetSamplerState( 0, D3DSAMP_MIPFILTER, D3DTEXF_LINEAR ); Now my far texture is more small than close texture... but I haven''t big and small texture...have the DX made this job for me? Can That filter work fine without all texture? Is better use standar method like this?
  
	for( i = 0; i < 6; ++i )
	{
		g_pMipMapTexture->GetSurfaceLevel( i, &pDestSurface );
		pTexArray[i]->GetSurfaceLevel( 0, &pSrcSurface );

		// Load our custom mip-map texture into the appropiate level by 

		// copying over or erasing the existing texture on that surface.


		D3DXLoadSurfaceFromSurface( pDestSurface, NULL, NULL, 
		                            pSrcSurface,  NULL, NULL, 
								    D3DX_DEFAULT, 0);

		pSrcSurface->Release();
		pDestSurface->Release();
	}
  
where in pTexArray there are the same texture in different scale. I''m a bit confused =)))) good bye

Share this post


Link to post
Share on other sites
Advertisement
If you read the SDK docs, you''ll see that if you create the texture with 0 for the levels parameter, D3D will generate the mipmaps for you:

quote:

HRESULT CreateTexture(
UINT Width,
UINT Height,
UINT Levels,
DWORD Usage,
D3DFORMAT Format,
D3DPOOL Pool,
IDirect3DTexture8** ppTexture
);

Levels
[in] The number of levels in the texture. If this is zero, Microsoft® Direct3D® will generate all texture sublevels down to 1×1 pixels for hardware that supports MIP mapped textures. Otherwise, it will create one level. Call IDirect3DBaseTexture8::GetLevelCount to see the number of levels generated.

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.

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!