Microsoft C++ exception: long at memory
Clearly, you don't know what a memory leak is.
Regardless, turn on the Debug Runtimes, and check the return code of all your DX calls, especially those for creating an effect. They are likely failing.
Regardless, turn on the Debug Runtimes, and check the return code of all your DX calls, especially those for creating an effect. They are likely failing.
Quote:Original post by core8583Nope. It means that your vertex declaration doesn't have any tangent in it, so the vertex shader doesn't know where it's supposed to get the tangent from.
Have done i get the error.
(ERROR) :Vertex shader function usage (D3DDECLUSAGE_TANGENT, 0) does not have corresponding usage in the current vertex declaration.
Just to make sure i'm reading the error correctly it's saying that my Tangent are all coming as 0. Yes?
Quote:Original post by core8583D3DDECLUSAGE_TANGENT isn't a FVF code, that like makes as much sense to D3D as:
I thought I did here,
struct CUSTOMVERTEX
{
D3DXVECTOR3 position; // vertex position
D3DXVECTOR3 normal; // surface normal at vertex
FLOAT tu, tv;
D3DXVECTOR3 tangent;
};
#define D3DFVF_CUSTOMVERTEX (D3DFVF_XYZ|D3DFVF_NORMAL|D3DFVF_TEX1|D3DDECLUSAGE_TANGENT)
Is this right?
#define D3DFVF_CUSTOMVERTEX (D3DFVF_XYZ|D3DFVF_NORMAL|D3DFVF_TEX1|D3DDEVTYPE_HAL)
unfortunately [smile]
If you're using shaders, I'd highly recommend using vertex declarations instead of FVF codes, since you get much more control over what goes into your shader.
Quote:Original post by core8583I'm not even sure that's right actually, it might just happen to work in this case. At any rate, you're only specifying a 2D value instead of 3D. As far as I know, there's no way to specify tangents when using FVF codes. Again, vertex declarations are the way to go to fix this.
After changing D3DDECLUSAGE_TANGENT to D3DFVF_TEX2 and changing
float3 Tangent : TANGENT to float3 Tangent : TEXTCOORD1 it works.
Quote:Original post by core8583Google has all the answers [smile]
My next Question is how to i would out Tangents? Anyone got the Math forumla for them ?
In the future, please do not edit away the contents of your posts after the fact like this. It makes it extremely difficult for other users to benefit from the discussion the thread supported, which is detrimental to the community as a whole.
I'm closing this now.
I'm closing this now.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement