Original Post
Hey everyone. I am trying to create a new cube map from a mip map of another cube map. Basically i am trying to access a smaller mip level of a cube map and store it as another cube map. The reason is that i have data stored in a cube map that i can not just linearly interpolate on the GPU but instead need to do some other operations. Does anyone know how to copy a mip level from a cube? Currently, i have tried creating a new cube map and copying each mip map surface of the cube to it but i do not get correct results. If you can figure out what is wrong with this then I do not need another solution but ideally there has to be a simpler method to do this.
V_RETURN( D3DXCreateCubeTextureFromFileEx( pd3dDevice, strPath, 512, 10, 0, D3DFMT_A16B16G16R16F,
D3DPOOL_MANAGED, D3DX_FILTER_LINEAR, D3DX_FILTER_LINEAR, 0, NULL, NULL, &m_pEnvironmentMap ) );
DWORD levelCount = m_pEnvironmentMap->GetLevelCount() - 1;
LPDIRECT3DSURFACE9 faceSurface;
LPDIRECT3DSURFACE9 mipFaceSurface;
int size = 1;
for (DWORD i = 0; i <= levelCount; i++)
{
D3DXCreateCubeTexture ( pd3dDevice, size, 1, 0, D3DFMT_A16B16G16R16F,
D3DPOOL_MANAGED, &m_pEnvironmentMipMaps);
size *= 2;
}// for