1
Technical forum / Access to tangent/bitangent data in shader code
« on: October 07, 2010, 04:17:22 PM »
Hi there,
I'm trying to implement a normal mapping shader for use in WME, but it seems that the vertex data coming from the engine doesn't contain precalculated values for the tangent and bitangent vectors. When I'm using the vertex shader semantics like this -
- only "normal" contains usable values (if the 3D model provides them, of course).
Am I doing something wrong?
(I hope the other vectors aren't also expected to be baked in the model or something like that.)
Thanks.
I'm trying to implement a normal mapping shader for use in WME, but it seems that the vertex data coming from the engine doesn't contain precalculated values for the tangent and bitangent vectors. When I'm using the vertex shader semantics like this -
Code: WME Script
- // some code
- struct VS_INPUT
- {
- float4 position : POSITION;
- float2 texCoord : TEXCOORD0;
- float4 normal : NORMAL;
- float4 tangent : TANGENT;
- float4 bitangent : BINORMAL;
- };
- // some code
- // ...
- only "normal" contains usable values (if the 3D model provides them, of course).
Am I doing something wrong?
(I hope the other vectors aren't also expected to be baked in the model or something like that.)
Thanks.