Vertex shader problem continues

Started by
2 comments, last by DadleFish 16 years, 10 months ago
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!
Dubito, Cogito ergo sum.
Advertisement
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.
Sirob Yes.» - status: Work-O-Rama.
Maybe I'm missing something here. The VS runs:

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?
Dubito, Cogito ergo sum.
Ok, problem solved - there was another stupid bug in the way I transposed the matrix.

The PIX problem persists however... Any idea about that?
Dubito, Cogito ergo sum.

This topic is closed to new replies.

Advertisement