I am trying to render a skybox in DirectX9 with fixed function pipeline (without shader or effect file). I can view the cube rendering. When I set the texture all faces are getting painted with a single strange color (not white or blank). The texture file is a correct cube map.I think some texture setting is not set. Below is the code snippet
// for creating the cube and the cube texture
HRESULT apiResult = D3DXCreateBox(g_pd3dDevice,1,1,1,&g_pMesh,NULL);
apiResult = D3DXCreateCubeTextureFromFile(g_pd3dDevice,L"cubeMap.dds",&g_pTexture);
both APIs are returning S_OK.
// for renderin the skybox
g_pd3dDevice->SetSamplerState(0,D3DSAMP_MIPFILTER,D3DTEXF_LINEAR);
g_pd3dDevice->SetSamplerState(0,D3DSAMP_MAGFILTER,D3DTEXF_LINEAR);
g_pd3dDevice->SetSamplerState(0,D3DSAMP_MINFILTER,D3DTEXF_LINEAR);
// set texture
g_pd3dDevice->SetTexture(0,g_pTexture);
// Begin the scene
if( SUCCEEDED( g_pd3dDevice->BeginScene() ) )
{
g_pMesh->DrawSubset(0);
g_pd3dDevice->EndScene();
}
// Present the backbuffer contents to the display
g_pd3dDevice->Present( NULL, NULL, NULL, NULL );
Which setting is missing ?