Ejemplo n.º 1
0
 protected override void UpdateBuffers(DeviceContextHolder holder, IShadowsDraw draw)
 {
     foreach (var split in Splits)
     {
         holder.DeviceContext.OutputMerger.SetTargets(split.Buffer.DepthView);
         holder.DeviceContext.ClearDepthStencilView(split.Buffer.DepthView, DepthStencilClearFlags.Depth, 1f, 0);
         draw.DrawSceneForShadows(holder, split.Camera);
     }
 }
Ejemplo n.º 2
0
 protected override void UpdateBuffers(DeviceContextHolder holder, IShadowsDraw draw)
 {
     for (var i = 0; i < 6; i++)
     {
         var view = _targetView[i];
         holder.DeviceContext.OutputMerger.SetTargets(view);
         holder.DeviceContext.ClearDepthStencilView(view, DepthStencilClearFlags.Depth, 1.0f, 0);
         draw.DrawSceneForShadows(holder, _cameras[i]);
     }
 }
Ejemplo n.º 3
0
        protected override void UpdateBuffers(DeviceContextHolder holder, IShadowsDraw draw)
        {
            holder.DeviceContext.OutputMerger.SetTargets(_buffer.DepthView);
            holder.DeviceContext.ClearDepthStencilView(_buffer.DepthView, DepthStencilClearFlags.Depth, 1.0f, 0);

            for (var i = 0; i < 6; i++)
            {
                holder.DeviceContext.Rasterizer.SetViewports(new Viewport(0, i * _buffer.Width, _buffer.Width, _buffer.Width, 0f, 1f));
                draw.DrawSceneForShadows(holder, _cameras[i]);
            }
        }
Ejemplo n.º 4
0
        public void DrawScene(DeviceContextHolder holder, IShadowsDraw draw)
        {
            holder.SaveRenderTargetAndViewport();

            holder.DeviceContext.Rasterizer.SetViewports(_viewport);
            holder.DeviceContext.OutputMerger.DepthStencilState = null;
            holder.DeviceContext.OutputMerger.BlendState        = null;
            holder.DeviceContext.Rasterizer.State = _rasterizerState;

            foreach (var split in Splits)
            {
                holder.DeviceContext.OutputMerger.SetTargets(split.Buffer.DepthView);
                holder.DeviceContext.ClearDepthStencilView(split.Buffer.DepthView, DepthStencilClearFlags.Depth | DepthStencilClearFlags.Stencil, 1f, 0);
                draw.DrawSceneForShadows(holder, split.Camera);
                holder.DeviceContext.GenerateMips(split.Buffer.View);
            }

            holder.DeviceContext.Rasterizer.State = null;
            holder.DeviceContext.OutputMerger.DepthStencilState = null;
            holder.RestoreRenderTargetAndViewport();
        }
Ejemplo n.º 5
0
 protected override void UpdateBuffers(DeviceContextHolder holder, IShadowsDraw draw)
 {
     holder.DeviceContext.OutputMerger.SetTargets(_buffer.DepthView);
     holder.DeviceContext.ClearDepthStencilView(_buffer.DepthView, DepthStencilClearFlags.Depth, 1f, 0);
     draw.DrawSceneForShadows(holder, _camera);
 }
Ejemplo n.º 6
0
        public void DrawScene(DeviceContextHolder holder, IShadowsDraw draw) {
            holder.SaveRenderTargetAndViewport();

            holder.DeviceContext.Rasterizer.SetViewports(_viewport);
            holder.DeviceContext.OutputMerger.DepthStencilState = null;
            holder.DeviceContext.OutputMerger.BlendState = null;
            holder.DeviceContext.Rasterizer.State = _rasterizerState;

            foreach (var split in Splits) {
                holder.DeviceContext.OutputMerger.SetTargets(split.Buffer.DepthView);
                holder.DeviceContext.ClearDepthStencilView(split.Buffer.DepthView, DepthStencilClearFlags.Depth | DepthStencilClearFlags.Stencil, 1f, 0);
                draw.DrawSceneForShadows(holder, split.Camera);
                holder.DeviceContext.GenerateMips(split.Buffer.View);
            }

            holder.DeviceContext.Rasterizer.State = null;
            holder.DeviceContext.OutputMerger.DepthStencilState = null;
            holder.RestoreRenderTargetAndViewport();
        }