コード例 #1
0
        internal void Clear(VRageMath.Color clearColor)
        {
            RC.ClearDsv(DepthStencil,
                        DepthStencilClearFlags.Depth | DepthStencilClearFlags.Stencil, MyRender11.DepthClearValue, 0);

            var v3 = clearColor.ToVector3();

            RC.ClearRtv(m_gbuffer0, new Color4(v3.X, v3.Y, v3.Z, 1));
            RC.ClearRtv(m_gbuffer1, Color4.Black);
            RC.ClearRtv(m_gbuffer2, Color4.Black);
            RC.ClearRtv(m_lbuffer, Color4.Black);
        }
コード例 #2
0
        internal void Clear(VRageMath.Color clearColor)
        {
            MyRender11.DeviceContext.ClearDepthStencilView(DepthStencil.m_DSV,
                                                           DepthStencilClearFlags.Depth | DepthStencilClearFlags.Stencil, MyRender11.DepthClearValue, 0);

            foreach (var res in m_resources)
            {
                var rt = res as IRenderTargetBindable;
                if (rt != null)
                {
                    var v3 = clearColor.ToVector3();
                    MyRender11.DeviceContext.ClearRenderTargetView(rt.RTV,
                                                                   new Color4(v3.X, v3.Y, v3.Z, 1
                                                                              ));
                }

                var uav = res as IUnorderedAccessBindable;
                if (uav != null)
                {
                    MyRender11.DeviceContext.ClearUnorderedAccessView(uav.UAV, Int4.Zero);
                }
            }
        }