About ID3DXRenderToEnvMap::Face()

I saw DX9SDK 2002 samples' CubEnvMapping. I followed that and wrote one
program myself. When I ran it, found that the rendered Cubmap is something
wrong(broken), so think to fix it for a long time. At last, I found that
after the
lpRenderToEnvMap->Face( (D3DCUBEMAP_FACES) i, 0 );
means starts to render to a face of cubemap, I add the
lpD3DDev->Clear(0,NULL,D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER,
D3DCOLOR_XRGB(100,100,100),1.0f,0);
in order to clear the surface buffer befor my rendering code. Then it runs
OK. I don't why in MS' code, without clearing surface buffer it still work
well.(Before I thought the ID3DXRenderToEnvMap interface will clear the
buffer automatically when I call the Face(), But in fact it didn't do that)


Answer this question

About ID3DXRenderToEnvMap::Face()

  • About ID3DXRenderToEnvMap::Face()