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

Comparing libgender/fsh.cg (file contents):
Revision 1.15 by root, Wed Oct 6 09:41:48 2004 UTC vs.
Revision 1.21 by root, Mon Oct 18 14:31:36 2004 UTC

3 float4 TexCoord : TEXCOORD0; 3 float4 TexCoord : TEXCOORD0;
4 float3 LightVec : TEXCOORD1; 4 float3 LightVec : TEXCOORD1;
5 float3 EyeVec : TEXCOORD2; 5 float3 EyeVec : TEXCOORD2;
6 float3 WorldNormal : TEXCOORD3; 6 float3 WorldNormal : TEXCOORD3;
7 float3 WorldView : TEXCOORD4; 7 float3 WorldView : TEXCOORD4;
8 float3 test1 : TEXCOORD5;
9 float3 test2 : TEXCOORD6;
8}; 10};
9 11
10struct pixelOut { 12struct pixelOut {
11 float4 col : COLOR; 13 float4 col : COLOR;
12}; 14};
14pixelOut main(vertexOut IN, uniform sampler2D Texture) 16pixelOut main(vertexOut IN, uniform sampler2D Texture)
15{ 17{
16 pixelOut OUT; 18 pixelOut OUT;
17 19
18 half SpecExpon = 200; 20 half SpecExpon = 200;
19 float4 AmbiColor = { 0.5, 0.5, 0.5, 1.0 };
20 float4 LightColor = { 1, 1, 1, 1 }; 21 float4 LightColor = { 1, 1, 1, 1 };
21 float4 diffuse_color = tex2D (Texture, IN.TexCoord.xy); 22 float4 diffuse_color = tex2D (Texture, IN.TexCoord.xy);
22 23
23 half3 Ln = normalize (IN.LightVec); 24 half3 Ln = normalize (IN.LightVec);
24 half3 Nn = normalize (IN.WorldNormal); 25 half3 Nn = normalize (IN.WorldNormal);
27 half3 Hn = normalize (Ln + Vn); 28 half3 Hn = normalize (Ln + Vn);
28 half ldn = dot (Ln, Nn); 29 half ldn = dot (Ln, Nn);
29 half hdn = dot (Hn, Nn); 30 half hdn = dot (Hn, Nn);
30 31
31 half4 litV = lit (ldn, hdn, SpecExpon); 32 half4 litV = lit (ldn, hdn, SpecExpon);
32 //half4 diffContrib = glstate.material.diffuse * (litV.y * LightColor + glstate.lightmodel.ambient); 33 half4 diffContrib = diffuse_color * ((litV.y + 0.3) * LightColor + glstate.lightmodel.ambient);
33 //half4 specContrib = litV.y * litV.z * LightColor; 34 half4 specContrib = litV.y * litV.z * LightColor;
34 //half4 result = diffContrib + specContrib; 35 half4 result = diffContrib + specContrib;
35 half4 result = diffuse_color * litV.y + LightColor * litV.z; 36 //half4 result = diffuse_color * litV.y + LightColor * litV.z;
36 // half4 result = AmbiColor + glstate.material.diffuse * litV.y + LightColor * litV.z;
37 37
38 OUT.col = result; 38 OUT.col = result;
39 return OUT; 39 return OUT;
40} 40}
41 41

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines