public Process ( GLTexture InputColor, GLTexture InputDepth ) : GLTexture | ||
InputColor | GLTexture | |
InputDepth | GLTexture | |
return | GLTexture |
public GLTexture Process(GLTexture InputColor, GLTexture InputDepth)
{
if (InputColor.Width == 0 || InputColor.Height == 0) throw (new Exception("Smaa can't handle empty textures"));
//if (InputColor.Width != InputDepth.Width || InputColor.Height != InputDepth.Height) throw (new Exception("Color.Size != Texture.Size"));
SetSize(InputColor.Width, InputColor.Height);
var edge_tex = edge_pass(InputColor, InputDepth);
var blend_tex = pass_blend(edge_tex);
var neighborhood_tex = pass_neighborhood(InputColor, blend_tex);
//return edge_tex;
//return blend_tex;
return neighborhood_tex;
}
private static void _MainData() { var Context = GLContextFactory.CreateWindowless().MakeCurrent(); var BitmapIn = new Bitmap(Image.FromFile(@"C:\temp\test.png")); var Smaa = new Smaa(); var TextureIn = GLTextureCreateFromBitmap(BitmapIn); var TextureOut = Smaa.Process(TextureIn, null); new Bitmap(BitmapIn.Width, BitmapIn.Height).SetChannelsDataInterleaved(TextureOut.GetDataFromGpu(), BitmapChannelList.RGBA).Save(@"c:\temp\test.out.png"); File.WriteAllBytes(@"c:\temp\test.out.bin", TextureOut.GetDataFromGpu()); Environment.Exit(0); }