示例#1
0
        private void Initialize()
        {
            OpenGL.Invoke(() =>
            {
                this.vertexBuffer = new Buffer(BufferTarget.ArrayBuffer);
                this.vertexBuffer.SetData <float>(BufferUsageHint.StaticDraw, new[]
                {
                    -1.0f, -1.0f,
                    -1.0f, 1.0f,
                    1.0f, -1.0f,
                    1.0f, 1.0f
                });

                this.vao = new VertexArray();
                this.vao.Bind();
                this.vertexBuffer.Bind();

                GL.EnableVertexAttribArray(0);
                GL.VertexAttribPointer(0, 2, VertexAttribPointerType.Float, false, 0, 0);

                VertexArray.Unbind();

                this.quadShader = new PostProcessingShader("void main() { fragment = texture(inputTexture, vec2(uv.x, uv.y)); }");
            });
        }
 /// <summary>
 /// Instantiates a new post processing stage with an effect.
 /// </summary>
 /// <param name="effect">The effect for this stage.</param>
 /// <param name="enabled">Determines if the post processing stage is enabled.</param>
 public PostProcessingStage(PostProcessingShader effect, bool enabled)
 {
     this.Effect = effect;
 }
 /// <summary>
 /// Instantiates a new post processing stage with an effect.
 /// </summary>
 /// <param name="effect">The effect for this stage.</param>
 public PostProcessingStage(PostProcessingShader effect)
     : this()
 {
     this.Effect = effect;
 }