57 |
] |
] |
58 |
|
|
59 |
edgefp = GL.createProgram(cg.compile(""" |
edgefp = GL.createProgram(cg.compile(""" |
60 |
|
float dep(float2 tc, uniform samplerRECT tex0) { |
61 |
|
float4 dotvec = { |
62 |
|
1./(256*256) |
63 |
|
, |
64 |
|
1./(256) |
65 |
|
, |
66 |
|
1 |
67 |
|
, |
68 |
|
0 |
69 |
|
}; |
70 |
|
float4 d = texRECT(tex0, tc); |
71 |
|
return dot(d, dotvec); |
72 |
|
} |
73 |
|
|
74 |
void main( |
void main( |
75 |
float4 incol: COLOR0, |
float4 incol: COLOR0, |
76 |
float4 qpos : TEXCOORD0, |
float4 qpos : TEXCOORD0, |
85 |
// tc.y += (1-768/1024.0); |
// tc.y += (1-768/1024.0); |
86 |
float2 tc = wpos.xy; |
float2 tc = wpos.xy; |
87 |
|
|
88 |
float4 dotvec = { |
float de = dep(tc, tex0); |
|
1./(256*256) |
|
|
, |
|
|
1./(256) |
|
|
, |
|
|
1 |
|
|
, |
|
|
0 |
|
|
}; |
|
|
|
|
|
float4 d = texRECT(tex0, tc); |
|
89 |
|
|
|
float de = dot(d, dotvec); |
|
90 |
|
|
91 |
// float d1 = tex2D(tex0, tc + float2(0,2/1024.0)).x; |
// float d1 = tex2D(tex0, tc + float2(0,2/1024.0)).x; |
92 |
// float d2 = tex2D(tex0, tc + float2(0,-2/1024.0)).x; |
// float d2 = tex2D(tex0, tc + float2(0,-2/1024.0)).x; |
113 |
|
|
114 |
*/ |
*/ |
115 |
float4 color; |
float4 color; |
|
color.xyz = d; |
|
116 |
color.xyz = (de-.00199) * 1000; |
color.xyz = (de-.00199) * 1000; |
117 |
// 10000 *abs(d1-d); |
// 10000 *abs(d1-d); |
118 |
/* |
/* |