43 |
|
|
44 |
""", "arbvp1")), |
""", "arbvp1")), |
45 |
] |
] |
46 |
|
|
47 |
|
edgefp = GL.createProgram(cg.compile(""" |
48 |
|
void main( |
49 |
|
float4 incol: COLOR0, |
50 |
|
float4 wpos : WPOS, |
51 |
|
uniform sampler2D tex0, |
52 |
|
out float4 col : COLOR) { |
53 |
|
float2 tc = wpos.xy / 1024.0; |
54 |
|
float d = tex2D(tex0, tc).w; |
55 |
|
float d1 = tex2D(tex0, tc + (0,1/1024.0)).w; |
56 |
|
float d2 = tex2D(tex0, tc + (0,-1/1024.0)).w; |
57 |
|
float d3 = tex2D(tex0, tc + (1/1024.0,0)).w; |
58 |
|
float d4 = tex2D(tex0, tc + (-1/1024.0,0)).w; |
59 |
|
|
60 |
|
float4 color; |
61 |
|
color.xyz = 100*(abs(d1-d) + abs(d2-d) + abs(d3-d) + abs(d4-d)); |
62 |
|
color.y = (d > .5 ? 1 : 0); |
63 |
|
color.xz = 0; |
64 |
|
color.x = tex2D(tex0, tc).x; |
65 |
|
color.y = (d == 1 ? 1 : 0); |
66 |
|
// color.z = wpos.x / 1024; |
67 |
|
color.w = 1; |
68 |
|
|
69 |
|
col = color; |
70 |
|
} |
71 |
|
|
72 |
|
""", "fp30")) |