Пример #1
0
 public void DisposeResources(SceneContext sc)
 {
     foreach (var r in _renderables)
     {
         r.DisposeResources(sc);
     }
 }
Пример #2
0
        public RenderTarget(IRenderTarget target, SceneContext self)
        {
            _self  = self;
            Target = target;

            target.Resize  += OnResize;
            _resizeRequired = Target.Width != target.Swapchain.Framebuffer.Width || Target.Height != Target.Swapchain.Framebuffer.Height;

            _commandList = _self.Device.ResourceFactory.CreateCommandList();
        }
Пример #3
0
 public void RenderAlpha(CommandList cl, SceneContext sc, IRenderContext rc, Vector3 cameraLocation)
 {
     foreach (var rp in sc.Pipelines.OrderBy(x => x.Order))
     {
         rp.SetPipeline(cl, sc, rc);
         foreach (var renderable in _renderables.Where(x => x.Pipeline == rp.Name).OrderBy(x => x.Order))
         {
             renderable.RenderAlpha(sc, cl, rc, cameraLocation);
         }
     }
 }
Пример #4
0
        public void Render(CommandList cl, SceneContext sc, IRenderContext rc)
        {
            foreach (var r in _newRenderables)
            {
                r.CreateResources(sc);
            }
            _newRenderables.Clear();

            foreach (var rp in sc.Pipelines.OrderBy(x => x.Order))
            {
                rp.SetPipeline(cl, sc, rc);
                foreach (var renderable in _renderables.Where(x => x.Pipeline == rp.Name).OrderBy(x => x.Order))
                {
                    renderable.Render(sc, cl, rc);
                }
            }
        }