예제 #1
0
        public override void OnDraw(float time)
        {
            //Render gui text
            gui.Material.Textures["_tex"].Clear();
            Vector2 p = ActiveCamera.WorldToScreen(new Vector3(10, 0, 10));

            gui.DrawText("Time: " + time, defaultFont, 0.6f, p, new Vector4(1, 0.5f, 0.5f, 1));
            gui.DrawText("FPS:  " + Fps, defaultFont, 0.6f, new Vector2(p.X, p.Y + 100), new Vector4(1, 0.5f, 0.5f, 1));

            //Render multisampler

            SceneRenderer.RenderMultisampled(ActiveCamera, multisampler, time);

            multisampler.CloneTo(postEffect.Textures["_tex"]);

            canvas.Clear();
            canvas.DrawMaterial(postEffect);
            GL.BindFramebuffer(FramebufferTarget.Framebuffer, 0);
            GL.Viewport(0, 0, Window.Width, Window.Height);
            postEffect.Use();
            Helper.DrawScreenQuad();
            GL.UseProgram(0);
        }