home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Bitfellas Bitjam
/
bitfellasbitjamcdbitfellas2007.iso
/
interface
/
intro
/
bump.vs
< prev
next >
Wrap
Text File
|
2007-08-01
|
788b
|
23 lines
float4x4 view_proj_matrix;
float4x4 view_matrix;
struct VS_OUTPUT {
float4 Pos: POSITION;
float2 texCoord: TEXCOORD0;
float3 lightVec: TEXCOORD1;
};
VS_OUTPUT main(float4 Pos: POSITION, float3 normal: NORMAL, float3 tangent: TANGENT, float3 binormal: BINORMAL) {
VS_OUTPUT Out;
Out.Pos = mul(view_proj_matrix, Pos);
Out.texCoord.x = Pos.x * .0065 + .46;
Out.texCoord.y = Pos.z * .0065 + .46;
float3 Pview = -mul(view_matrix, Pos);
float3 vtang = mul(view_matrix, tangent);
float3 vbinorm = mul(view_matrix, binormal);
float3 vnorm = mul(view_matrix, normal);
float3 lightVec = Pview;
Out.lightVec.x = dot(lightVec, vtang);
Out.lightVec.y = dot(lightVec, vbinorm);
Out.lightVec.z = dot(lightVec, vnorm);
return Out;
}