2009-07-06 74 views
1

有什麼不對的:繪製全屏Quad?

pVertexBuffer[0].Position = D3DXVECTOR3(0.0f,0.0f,0.0f); 
pVertexBuffer[0].TexCoord = D3DXVECTOR2(0.0f,0.0f); 

pVertexBuffer[1].Position = D3DXVECTOR3(m_ScreenResolutionX,0.0f,0.0f); 
pVertexBuffer[1].TexCoord = D3DXVECTOR2(1.0f,0.0f); 

pVertexBuffer[2].Position = D3DXVECTOR3(0.0f,m_ScreenResolutionY,0.0f); 
pVertexBuffer[2].TexCoord = D3DXVECTOR2(0.0f,1.0f); 

pVertexBuffer[3].Position = D3DXVECTOR3(0.0f,m_ScreenResolutionY,0.0f); 
pVertexBuffer[3].TexCoord = D3DXVECTOR2(0.0f,1.0f); 

pVertexBuffer[4].Position = D3DXVECTOR3(m_ScreenResolutionX,0.0f,0.0f); 
pVertexBuffer[4].TexCoord = D3DXVECTOR2(1.0f,0.0f); 

pVertexBuffer[5].Position = D3DXVECTOR3(m_ScreenResolutionX,m_ScreenResolutionY,0.0f); 
pVertexBuffer[5].TexCoord = D3DXVECTOR2(1.0f,1.0f); 

,如果我嘗試呈現此,我什麼也沒看到。在頂點着色器中,我使用這些頂點位置而不改變它們。

回答

4

頂點着色器以均勻的屏幕空間座標輸出頂點;他們通常是獨立的屏幕分辨率。換句話說,你應該輸出從(-1,-1,0)到(1,1,0)的座標。