Vertex shader problem continues
I've posted my problem a few days back. So I went and checked out PIX and learned a lot about it (thanks Sirob!), and also fixed my code, but to no avail.
My situation is like this -
1. I don't see my cube at all when the VS is enabled. When it's not, all is good.
2. In PIX, the mesh is never changed at all in the PostVS tab.
3. When I try to debug one of the mesh vertices, I get an error message telling me "An error occurred while preparing to debug the shader". In the debugger itself I get two lines; the first one says "Pixel history", and the other says "Pixel (0,0) of Render targer 0x00000000, Frame 1009".
4. My Direct3D settings are maximum Debug Output Level (and I get no errors in my log), Use debug version, Enable shader debugging, Allow hardware acceleration. The rest is turned off.
I don't know if this is related or not, but when I try to continue working with PIX, it gets dead after a few operations.
I'm completely lost, and checking other posts on GD I saw I'm not alone - any idea what this might be?
Thanks!
Looking at your vertex shader (in the previous), it looks like a pass-through shader. That is, one that only takes the vertex, and passes it through unchanged.
When drawing 3D geometry, the vertex shader is expected to transform the position of the vertex from world-space to clip-space, my multiplying it by the World-View-Projection matrices. Your VS, from what you pasted, never does this.
This means that vertices are not output correctly from the VS, and as such, won't be placed on the right place on screen.
Hope this helps.
When drawing 3D geometry, the vertex shader is expected to transform the position of the vertex from world-space to clip-space, my multiplying it by the World-View-Projection matrices. Your VS, from what you pasted, never does this.
This means that vertices are not output correctly from the VS, and as such, won't be placed on the right place on screen.
Hope this helps.
Maybe I'm missing something here. The VS runs:
While the code puts the transformation matrix into C0..C3 in here -
Isn't that supposed to transform v0 into oPos by multiplying v0 with the matrix?
m4x4 oPos, v0, c0
While the code puts the transformation matrix into C0..C3 in here -
m_pDevice->SetVertexShaderConstantF(SCR_WORLD2VIEWMAT, transposed.Get(), 4);
Isn't that supposed to transform v0 into oPos by multiplying v0 with the matrix?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement