コード例 #1
0
 /// <summary>
 /// Draws the icons.
 /// </summary>
 protected virtual void Draw(ref RenderContext renderContext)
 {
     for (int i = 0; i < Level.ScenesCount; i++)
     {
         var scene = Level.GetScene(i);
         ViewportIconsRenderer.DrawIcons(ref renderContext, scene);
     }
 }
コード例 #2
0
            /// <inheritdoc />
            public override void Render(GPUContext context, SceneRenderTask task, GPUTexture input, GPUTexture output)
            {
                Profiler.BeginEventGPU("Editor Primitives");

                for (int i = 0; i < SceneManager.ScenesCount; i++)
                {
                    var scene = SceneManager.GetScene(i);
                    ViewportIconsRenderer.DrawIcons(context, task, input, task.Buffers.DepthBuffer, scene);
                }

                Profiler.EndEventGPU();
            }
コード例 #3
0
            /// <inheritdoc />
            public override void Render(GPUContext context, ref RenderContext renderContext, GPUTexture input, GPUTexture output)
            {
                Profiler.BeginEventGPU("Editor Primitives");

                // Prepare
                var renderList = RenderList.GetFromPool();
                var prevList   = renderContext.List;

                renderContext.List      = renderList;
                renderContext.View.Pass = DrawPass.Forward;

                // Bind output
                float width  = input.Width;
                float height = input.Height;

                context.SetViewport(width, height);
                var depthBuffer       = renderContext.Buffers.DepthBuffer;
                var depthBufferHandle = depthBuffer.View();

                if ((depthBuffer.Flags & GPUTextureFlags.ReadOnlyDepthView) == GPUTextureFlags.ReadOnlyDepthView)
                {
                    depthBufferHandle = depthBuffer.ViewReadOnlyDepth();
                }
                context.SetRenderTarget(depthBufferHandle, input.View());

                // Collect draw calls
                for (int i = 0; i < Level.ScenesCount; i++)
                {
                    var scene = Level.GetScene(i);
                    ViewportIconsRenderer.DrawIcons(ref renderContext, scene);
                }

                // Sort draw calls
                renderList.SortDrawCalls(ref renderContext, true, DrawCallsListType.Forward);

                // Perform the rendering
                renderList.ExecuteDrawCalls(ref renderContext, DrawCallsListType.Forward);

                // Cleanup
                RenderList.ReturnToPool(renderList);
                renderContext.List = prevList;

                Profiler.EndEventGPU();
            }
コード例 #4
0
 protected override void Draw(ref RenderContext renderContext)
 {
     ViewportIconsRenderer.DrawIcons(ref renderContext, Viewport.Instance);
 }