Jump to content
  • Advertisement
Sign in to follow this  
Magnus Wootton

help with D3DXComputeTangentFrameEX

This topic is 4873 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

i cant get computetagentframeex to work, it returns D3DERR_INVALIDCALL, and i also dont know how to fill in some of the parameters. i was wondering if someone could help me. heres how i call the function: sorry if the code looks ugly i couldnt format it right for some reason
[source="c++"]
  modl->GenerateAdjacency(0.001f, adjacency);

  LPD3DXBUFFER buffer=NULL;

  HRESULT hr;

  hr=D3DXComputeTangentFrameEx(modl,
D3DDECLUSAGE_TEXCOORD,0, 
D3DDECLUSAGE_TANGENT, 1,
D3DDECLUSAGE_BINORMAL, 2, 
D3DDECLUSAGE_NORMAL,3,
NULL, adjacency,  
cos(1.57f), 
0.1f,
cos(1.57f), &mod, &buffer);

  if(FAILED(hr)) 
  {
   if(hr==D3DERR_INVALIDCALL) state=NULL;
   return;
  }



and this is the vertex type used with the meshes
[source="c++"]
#define D3DFVF_BUMPVERTEX D3DFVF_XYZ | D3DFVF_NORMAL| D3DFVF_TEX4|D3DFVF_TEXCOORDSIZE2(0)|D3DFVF_TEXCOORDSIZE3(1)
|D3DFVF_TEXCOORDSIZE3(2)|D3DFVF_TEXCOORDSIZE3(3)

struct bumpvertex
{
 VEC pos;
 VEC nor;
 FLOAT u,v;
 VEC tangent;
 VEC binormal;
 VEC normal;
};



im doing something wrong, can you help and please explain the function to me properly.

Share this post


Link to post
Share on other sites
Advertisement
Try linking with D3DX9D.LIB rather than D3DX9.LIB then run your app in the debugger with the debug D3D runtime enabled.

D3DX9D.LIB is the debug version of the D3DX library - when it returns an error code, it will output the reason *why* the error was returned to the Output window of your debugger.

D3DERR_INVALIDCALL is usually returned when one of the parameters you pass is wrong - the debug version of D3DX should give you a clue about which parameter it doesn't like.

Share this post


Link to post
Share on other sites
yeh i had it on but i wasnt using it *slaps himself in the head*

it says "u partial channel not in output mesh"

which means ive got the fvf and vertex structure wrong, could you have
a look at it to see if there is anything wrong?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!