private GLTexture pass_blend(GLTexture edge_tex)
{
if (blend_shader == null)
{
blend_shader = GLShaderFilter.Create(Width, Height, new GLShader(
VertexHeader + @"
out vec2 texcoord;
out vec2 pixcoord;
out vec4 offset[3];
out vec4 dummy2;
void main()
{
texcoord = a_texcoords.xy;
vec4 dummy1 = vec4(0);
SMAABlendingWeightCalculationVS(dummy1, dummy2, texcoord, pixcoord, offset);
gl_Position = a_position;
}
",
FragmentHeader + @"
uniform sampler2D edge_tex;
uniform sampler2D area_tex;
uniform sampler2D search_tex;
in vec2 texcoord;
in vec2 pixcoord;
in vec4 offset[3];
in vec4 dummy2;
void main()
{
gl_FragColor = SMAABlendingWeightCalculationPS(texcoord, pixcoord, offset, edge_tex, area_tex, search_tex, ivec4(1, 1, 1, 0));
//gl_FragColor = SMAABlendingWeightCalculationPS(texcoord, pixcoord, offset, edge_tex, area_tex, search_tex, ivec4(0));
}
"
));
}
return blend_shader.Process((Shader) =>
{
Shader.GetUniform("edge_tex").Set(GLTextureUnit.CreateAtIndex(0).SetWrap(GLWrap.ClampToEdge).SetFiltering(GLScaleFilter.Linear).SetTexture(edge_tex));
Shader.GetUniform("area_tex").Set(area_tex_unit.SetIndex(1));
Shader.GetUniform("search_tex").Set(search_tex_unit.SetIndex(2));
});
}