File: fragment.cg

package info (click to toggle)
libopengl-perl 0.7000%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,312 kB
  • sloc: perl: 10,177; ansic: 8,576; makefile: 113
file content (23 lines) | stat: -rwxr-xr-x 402 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// input fragment
struct FragIn
{
  float2 texcoord : TEXCOORD0;
};
 
// output fragment
struct FragOut
{
  float4 color : COLOR;
};

uniform float4 surfacecolor;
 
// fragment shader main entry
FragOut main(FragIn IN)
{
  FragOut OUT;
  float1 v = 2.0 * IN.texcoord.y;
  v = 1.01f - abs(1.0f - v);  // Some cards have a rounding error
  OUT.color = float4(v,v,v, 1.0f) * surfacecolor;
  return OUT;
}