Пример #1
0
        public Vector4 ProcessFragment()
        {
            var pixel = new float[4];

            _rtt.Activate();
            GL.Viewport(0, 0, 1, 1);
            GL.ClearColor(0.1f, 0.3f, 0.6f, 0.9f);
            GL.Clear(ClearBufferMask.ColorBufferBit);
            //GL.Arb.ClampColor(ArbColorBufferFloat.ClampFragmentColorArb, ArbColorBufferFloat.RgbaFloatModeArb);
            //GL.Arb.ClampColor(ArbColorBufferFloat.ClampVertexColorArb, ArbColorBufferFloat.RgbaFloatModeArb);
            //GL.Arb.ClampColor(ArbColorBufferFloat.ClampReadColorArb, ArbColorBufferFloat.RgbaFloatModeArb);
            //GL.ClampColor(ClampColorTarget.ClampVertexColor, ClampColorMode.False);
            //GL.ClampColor(ClampColorTarget.ClampFragmentColor, ClampColorMode.False);
            //GL.ClampColor(ClampColorTarget.ClampReadColor, ClampColorMode.False);

            GL.Begin(BeginMode.Points);
            GL.Vertex3(0, 0, 0);
            GL.End();
            GL.Flush();
            GL.ReadPixels(0, 0, 1, 1, PixelFormat.Rgba, PixelType.Float, pixel);
            _rtt.Finish();
            Utilities.CheckGL();

            //_context.SwapBuffers();

            return(new Vector4(pixel[0], pixel[1], pixel[2], pixel[3]));
        }