views:

436

answers:

1

What's wrong with this:

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);

if i try to render this, i don't see anything. in the vertex shader i use these vertex positions without transforming them.

+4  A: 

Vertex shaders output vertices in homogenous screenspace coordinates; they are usually screen resolution independent. In other words, you should output coordinates from (-1,-1,0) to (1, 1, 0).

MSN