My Skybox处于透视图中,我越接近它。我也禁用了D3DRS_ZWRITEENABLE。
Device->SetTransform(D3DTS_WORLD,GetTransform());
Device->SetRenderState( D3DRS_LIGHTING,FALSE);
Device->SetRenderState(D3DRS_ZWRITEENABLE,FALSE);
Device->SetSamplerState( 0, D3DSAMP_ADDRESSU, D3DTADDRESS_CLAMP );
Device->SetSamplerState( 0, D3DSAMP_ADDRESSV, D3DTADDRESS_CLAMP );
Device->SetFVF(SKYBOX_VERTEX::FVF);
Device->SetStreamSource(0,m_pVertexBuffer,0,sizeof(SKYBOX_VERTEX));
Device->SetIndices(m_pIndexBuffer);
for(int i=0;i<6;i++)
{
Device->SetTexture(0,m_skyTextures[i].TextureFile);
Device->DrawIndexedPrimitive(D3DPT_TRIANGLELIST,0,0,4,i*6,2);
//Device->DrawPrimitive(D3DPT_TRIANGLEFAN,i*4,2);
}
Device->SetRenderState(D3DRS_ZWRITEENABLE,TRUE);
Device->SetRenderState( D3DRS_LIGHTING,TRUE);
Device->SetSamplerState( 0, D3DSAMP_ADDRESSU, D3DTADDRESS_WRAP );
Device->SetSamplerState( 0, D3DSAMP_ADDRESSV, D3DTADDRESS_WRAP );
我希望它看起来很远。