Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / TOUGH QUESTION: How to compute tangent vector of each vertex?

Author
Message
Bulleyes
23
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Cyberjaya, Malaysia
Posted: 14th Jun 2003 17:40
Hi, I had created pixel shader routine. It requires the tangent vector appears in the texture coordinate of a 3D object, i.e. it will be a 3D texture coordinate. In DirectX SDK, there is a function called D3DXComputeTangent() which is able to calculate the tagent vectors of each vertex.

Is there anyway in DBpro can achieve that? Will CONVERT OBJECT FVF able to do this?

If I had no choice, then I had to get my hand dirty to code a DLL for this. I wanna avoid this if possible, as it involves a lot of conversion between DBpro's object and mesh used in DirectX SDK.

Any ideas? Thanks!
Bad Nose Entertainment - Where games are forged from the flames of talent and passion.

http://www.badnose.com/
Bulleyes
23
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Cyberjaya, Malaysia
Posted: 14th Jun 2003 17:54
Hmmm.... seems like I am not really in luck. When I look thru the DBpro help on COVERT OVJECT FVF, it doesn't support the D3DFVF_TEXCOORDSIZE3 flag, which I need it for 3-D texture coordinate.

I would be really grateful to anyone that can help me. Raven? IanM? RobK? Anyone? :-s

Bad Nose Entertainment - Where games are forged from the flames of talent and passion.

http://www.badnose.com/
Shadow Robert
23
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 14th Jun 2003 18:49
you can get it by adding a Tangent to the model...
i'm not sure if DBP support Tangents on models though

but in the shader a tangent code will be 'tan'

check the help i remember seeing Tangent as the streaming data you can export into the shader ... i'll look into it and let you know later once i've figured it

Within the Epic battle of the fates the Shadow and the Angel will meet. With it will harbinger the very fight of good vs evil!
Bulleyes
23
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Cyberjaya, Malaysia
Posted: 16th Jun 2003 04:14
Thanks Raven, have you figure out anything that might help me out?
Thanks a lot!

Bad Nose Entertainment - Where games are forged from the flames of talent and passion.

http://www.badnose.com/

Login to post a reply

Server time is: 2026-07-11 14:55:32
Your offset time is: 2026-07-11 14:55:32