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

Comparing libgender/fsh.cg (file contents):
Revision 1.6 by root, Tue Oct 5 08:14:21 2004 UTC vs.
Revision 1.7 by root, Tue Oct 5 08:28:39 2004 UTC

12struct pixelOut { 12struct pixelOut {
13 float4 col : COLOR; 13 float4 col : COLOR;
14}; 14};
15 15
16// pixel shader 16// pixel shader
17pixelOut main(vertexOut IN // input from vertex shade 17pixelOut main(vertexOut IN)
18 //uniform float SpecExpon, // constant parameters fro
19 //uniform float4 AmbiColor, // application
20 //uniform float4 SurfColor,
21 //uniform float4 LightColor
22 )
23{ 18{
24 float SpecExpon = 120; 19 float SpecExpon = 120;
25 float4 LightColor = { 1, 1, 1, 1 }; 20 float4 LightColor = { 1, 1, 1, 1 };
26 21
27 pixelOut OUT; // output of the pixel shader 22 pixelOut OUT; // output of the pixel shader
28 float3 Ln = normalize(IN.LightVec); 23 float3 Ln = normalize(IN.LightVec);
29 float3 Nn = normalize(IN.WorldNormal); 24 float3 Nn = normalize(IN.WorldNormal);
30 float3 Vn = normalize(IN.WorldView); 25 float3 Vn = (IN.WorldView);
31 float3 Hn = normalize(Vn + Ln); 26 float3 Hn = 0.5 * (Vn + Ln);
32 // scalar product between light and normal vectors: 27 // scalar product between light and normal vectors:
33 float ldn = abs(dot(Ln,Nn)); 28 float ldn = abs(dot(Ln,Nn));
34 // scalar product between halfway and normal vectors: 29 // scalar product between halfway and normal vectors:
35 float hdn = abs(dot(Hn,Nn)); 30 float hdn = abs(dot(Hn,Nn));
36 // specialized "lit" function computes weights for 31 // specialized "lit" function computes weights for

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines