Ejemplo n.º 1
0
        void vkvgDraw()
        {
            using (vkvg.Context ctx = new vkvg.Context(vkvgSurf)) {
                ctx.Operator = vkvg.Operator.Clear;
                ctx.Paint();
                ctx.Operator = vkvg.Operator.Over;

                ctx.LineWidth = 1;
                ctx.SetSource(0.1, 0.1, 0.1, 0.8);
                ctx.Rectangle(5.5, 5.5, 320, 300);
                ctx.FillPreserve();
                ctx.Flush();
                ctx.SetSource(0.8, 0.8, 0.8);
                ctx.Stroke();

                ctx.FontFace = "mono";
                ctx.FontSize = 8;
                int x = 16;
                int y = 40, dy = 16;
                ctx.MoveTo(x, y);
                ctx.ShowText(string.Format($"fps:     {fps,5} "));
                ctx.MoveTo(x + 200, y - 0.5);
                ctx.Rectangle(x + 200, y - 8.5, 0.1 * fps, 10);
                ctx.SetSource(0.1, 0.9, 0.1);
                ctx.Fill();
                ctx.SetSource(0.8, 0.8, 0.8);
                y += dy;
                ctx.MoveTo(x, y);
                ctx.ShowText(string.Format($"Exposure:{pbrPipeline.matrices.exposure,5} "));
                y += dy;
                ctx.MoveTo(x, y);
                ctx.ShowText(string.Format($"Gamma:   {pbrPipeline.matrices.gamma,5} "));
                y += dy;
                ctx.MoveTo(x, y);
                ctx.ShowText(string.Format($"Light pos:   {lightPos.ToString()} "));

#if PIPELINE_STATS
                if (results == null)
                {
                    return;
                }

                y += dy * 2;
                ctx.MoveTo(x, y);
                ctx.ShowText("Pipeline Statistics");
                ctx.MoveTo(x - 2, 4.5 + y);
                ctx.LineTo(x + 160, 4.5 + y);
                ctx.Stroke();
                y += 4;
                x += 20;

                for (int i = 0; i < statPool.RequestedStats.Length; i++)
                {
                    y += dy;
                    ctx.MoveTo(x, y);
                    ctx.ShowText(string.Format($"{statPool.RequestedStats[i].ToString(),-30} :{results[i],12:0,0} "));
                }

                /*y += dy;
                 * ctx.MoveTo (x, y);
                 * ctx.ShowText (string.Format ($"{"Elapsed microsecond",-20} :{timestampQPool.ElapsedMiliseconds:0.0000} "));*/
#endif
                y += dy;
                ctx.MoveTo(x, y);
                ctx.ShowText(string.Format($"{"Debug draw (numpad 0->6)",-30} : {currentDebugView.ToString ()} "));
                y += dy;
                ctx.MoveTo(x, y);
                ctx.ShowText(string.Format($"{"Debug Prefil Face: (f)",-30} : {pbrPipeline.envCube.debugFace.ToString ()} "));
                y += dy;
                ctx.MoveTo(x, y);
                ctx.ShowText(string.Format($"{"Debug Prefil Mip: (m)",-30} : {pbrPipeline.envCube.debugMip.ToString ()} "));
            }
        }