ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libgender/vsh.cg
(Generate patch)

Comparing libgender/vsh.cg (file contents):
Revision 1.8 by root, Tue Oct 5 11:25:19 2004 UTC vs.
Revision 1.9 by root, Wed Oct 6 00:23:27 2004 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines