コード例 #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);
     }
 }
コード例 #2
0
ファイル: ShadowsPoint.cs プロジェクト: windygu/actools
 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]);
     }
 }
コード例 #3
0
ファイル: ShadowsPointFlat.cs プロジェクト: windygu/actools
        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]);
            }
        }
コード例 #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();
        }
コード例 #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);
 }
コード例 #6
0
ファイル: ShadowsDirectional.cs プロジェクト: gro-ove/actools
        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();
        }