public static InnerImageProcessingRenderer Create(string textureFilename = @"Textures\edgeDetection.bmp")
        {
            var model = new ImageProcessingModel();
            ShaderCode[] simpleShader = new ShaderCode[2];
            simpleShader[0] = new ShaderCode(File.ReadAllText(@"shaders\ImageProcessingRenderer\ImageProcessing.vert"), ShaderType.VertexShader);
            simpleShader[1] = new ShaderCode(File.ReadAllText(@"shaders\ImageProcessingRenderer\ImageProcessing.frag"), ShaderType.FragmentShader);
            var propertyNameMap = new AttributeMap();
            propertyNameMap.Add("vert", "position");
            propertyNameMap.Add("uv", "uv");
            var renderer = new InnerImageProcessingRenderer(
                model, simpleShader, propertyNameMap, ImageProcessingModel.strposition);
            renderer.textureFilename = textureFilename;

            return renderer;
        }
 protected override void DoInitialize()
 {
     {
         var computeProgram = new ShaderProgram();
         var shaderCode = new ShaderCode(File.ReadAllText(
             @"06ImageProcessing\ImageProcessing.comp"), ShaderType.ComputeShader);
         var shader = shaderCode.CreateShader();
         computeProgram.Create(shader);
         shader.Delete();
         this.computeProgram = computeProgram;
     }
     {
         Bitmap bitmap = new System.Drawing.Bitmap(this.textureFilename);
         if (bitmap.Width != 512 || bitmap.Height != 512)
         {
             bitmap = (Bitmap)bitmap.GetThumbnailImage(512, 512, null, IntPtr.Zero);
         }
         OpenGL.GenTextures(1, this.input_image);
         OpenGL.BindTexture(OpenGL.GL_TEXTURE_2D, this.input_image[0]);
         //  Lock the image bits (so that we can pass them to OGL).
         BitmapData bitmapData = bitmap.LockBits(
             new Rectangle(0, 0, bitmap.Width, bitmap.Height),
             ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb);
         //GL.ActiveTexture(GL.GL_TEXTURE0);
         OpenGL.TexImage2D(OpenGL.GL_TEXTURE_2D, 0, (int)OpenGL.GL_RGBA32F,
             bitmap.Width, bitmap.Height, 0, OpenGL.GL_BGRA, OpenGL.GL_UNSIGNED_BYTE,
             bitmapData.Scan0);
         //  Unlock the image.
         bitmap.UnlockBits(bitmapData);
         /* We require 1 byte alignment when uploading texture data */
         //GL.PixelStorei(GL.GL_UNPACK_ALIGNMENT, 1);
         /* Clamping to edges is important to prevent artifacts when scaling */
         OpenGL.TexParameteri(OpenGL.GL_TEXTURE_2D, OpenGL.GL_TEXTURE_WRAP_S, (int)OpenGL.GL_CLAMP_TO_EDGE);
         OpenGL.TexParameteri(OpenGL.GL_TEXTURE_2D, OpenGL.GL_TEXTURE_WRAP_T, (int)OpenGL.GL_CLAMP_TO_EDGE);
         /* Linear filtering usually looks best for text */
         OpenGL.TexParameteri(OpenGL.GL_TEXTURE_2D, OpenGL.GL_TEXTURE_MIN_FILTER, (int)OpenGL.GL_LINEAR);
         OpenGL.TexParameteri(OpenGL.GL_TEXTURE_2D, OpenGL.GL_TEXTURE_MAG_FILTER, (int)OpenGL.GL_LINEAR);
         bitmap.Dispose();
     }
     {
         //GL.ActiveTexture(GL.GL_TEXTURE0);
         OpenGL.GenTextures(1, this.intermediate_image);
         OpenGL.BindTexture(OpenGL.GL_TEXTURE_2D, this.intermediate_image[0]);
         OpenGL.TexStorage2D(TexStorage2DTarget.Texture2D, 8, OpenGL.GL_RGBA32F, 512, 512);
     }
     {
         // This is the texture that the compute program will write into
         //GL.ActiveTexture(GL.GL_TEXTURE0);
         OpenGL.GenTextures(1, this.output_image);
         OpenGL.BindTexture(OpenGL.GL_TEXTURE_2D, this.output_image[0]);
         OpenGL.TexStorage2D(TexStorage2DTarget.Texture2D, 8, OpenGL.GL_RGBA32F, 512, 512);
     }
     {
         var bufferable = new ImageProcessingModel();
         ShaderCode[] simpleShader = new ShaderCode[2];
         simpleShader[0] = new ShaderCode(File.ReadAllText(@"06ImageProcessing\ImageProcessing.vert"), ShaderType.VertexShader);
         simpleShader[1] = new ShaderCode(File.ReadAllText(@"06ImageProcessing\ImageProcessing.frag"), ShaderType.FragmentShader);
         var propertyNameMap = new PropertyNameMap();
         propertyNameMap.Add("vert", "position");
         propertyNameMap.Add("uv", "uv");
         var pickableRenderer = new PickableRenderer(
             bufferable, simpleShader, propertyNameMap, "position");
         pickableRenderer.Name = string.Format("Pickable: [ImageProcessingRenderer]");
         pickableRenderer.Initialize();
         pickableRenderer.SetUniform("output_image",
             new samplerValue(
                 BindTextureTarget.Texture2D, this.output_image[0], OpenGL.GL_TEXTURE0));
         this.renderer = pickableRenderer;
     }
 }