ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libgender/vsh.cg
Revision: 1.10
Committed: Wed Oct 6 10:06:20 2004 UTC (19 years, 8 months ago) by root
Branch: MAIN
Changes since 1.9: +2 -0 lines
Log Message:
*** empty log message ***

File Contents

# Content
1 struct vertexIn {
2 float4 Position : POSITION;
3 float4 Normal : NORMAL;
4 float4 UV : TEXCOORD0;
5 };
6
7 struct vertexOut {
8 float4 HPosition : POSITION;
9 float4 TexCoord : TEXCOORD0;
10 float3 LightVec : TEXCOORD1;
11 float3 EyeVec : TEXCOORD2;
12 float3 WorldNormal : TEXCOORD3;
13 float3 WorldView : TEXCOORD4;
14 float3 test1 : TEXCOORD5;
15 float3 test2 : TEXCOORD5;
16 };
17
18 vertexOut main(vertexIn IN)
19 {
20 vertexOut OUT;
21
22 float4 LightPos = { 0, 2, 1000, 1 };
23
24 float3 wpos = mul (glstate.matrix.modelview[0], IN.Position).xyz;
25
26 OUT.WorldNormal = normalize (mul (glstate.matrix.invtrans.modelview[0], IN.Normal).xyz);
27 OUT.EyeVec = normalize (wpos);
28 OUT.WorldView = normalize (glstate.matrix.invtrans.projection[3].xyz - wpos);
29 OUT.LightVec = normalize (mul (glstate.matrix.modelview[0], LightPos).xyz - wpos);
30 OUT.HPosition = mul (glstate.matrix.mvp, IN.Position);
31 OUT.TexCoord = IN.UV;
32
33 return OUT;
34 }
35