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

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

28 float3 Ln = normalize(IN.LightVec); 28 float3 Ln = normalize(IN.LightVec);
29 float3 Nn = normalize(IN.WorldNormal); 29 float3 Nn = normalize(IN.WorldNormal);
30 float3 Vn = normalize(IN.WorldView); 30 float3 Vn = normalize(IN.WorldView);
31 float3 Hn = normalize(Vn + Ln); 31 float3 Hn = normalize(Vn + Ln);
32 // scalar product between light and normal vectors: 32 // scalar product between light and normal vectors:
33 float ldn = dot(Ln,Nn); 33 float ldn = abs(dot(Ln,Nn));
34 // scalar product between halfway and normal vectors: 34 // scalar product between halfway and normal vectors:
35 float hdn = dot(Hn,Nn); 35 float hdn = abs(dot(Hn,Nn));
36 // specialized "lit" function computes weights for 36 // specialized "lit" function computes weights for
37 // diffuse and specular parts: 37 // diffuse and specular parts:
38 float4 litV = lit(ldn,hdn,SpecExpon); 38 float4 litV = lit(ldn,hdn,SpecExpon);
39 float4 diffContrib = glstate.material.diffuse * ( litV.y * LightColor + glstate.lightmodel.ambient); 39 float4 diffContrib = glstate.material.diffuse * ( litV.y * LightColor + glstate.lightmodel.ambient);
40 float4 specContrib = litV.y*litV.z * LightColor; 40 float4 specContrib = litV.y*litV.z * LightColor;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines