コード例 #1
0
        /// <summary>
        /// Render depth and normals of windows to the specified target
        /// REMARK: Only on the windows with decals
        /// </summary>
        /// <returns>True if windows to be rendered found</returns>
        internal static bool RenderWindowsDepthOnly(MyDepthStencil depthStencil, MyBindableResource gbuffer1)
        {
            if (m_windowCount == 0)
            {
                return(false);
            }

            TransferDataBillboards(WindowCountSafe, ref m_arrayDataWindows);

            RC.BindDepthRT(depthStencil, DepthStencilAccess.ReadWrite, gbuffer1);
            BindResourcesCommon();

            RC.SetBS(null);
            RC.SetVS(m_vsDepthOnly);
            RC.SetPS(m_psDepthOnly);


            if (!MyStereoRender.Enable)
            {
                RC.DeviceContext.DrawIndexed(m_windowCount * 6, 0, 0);
            }
            else
            {
                MyStereoRender.DrawIndexedBillboards(RC, m_windowCount * 6, 0, 0);
            }

            RC.SetRS(null);
            return(true);
        }
コード例 #2
0
        internal static void Resize(int width, int height, int samplesNum, int samplesQuality)
        {
            if (m_resolvedDepth != null) {
                m_resolvedDepth.Release();
                m_ambientOcclusionHelper.Release();
                m_ambientOcclusion.Release();
                m_tileIndexes.Release();
            }

            m_resolvedDepth = new MyDepthStencil(width, height, 1, 0);
            m_ambientOcclusionHelper = new MyRenderTarget(width, height, Format.R8G8B8A8_UNorm, 1, 0);
            m_ambientOcclusion = new MyRenderTarget(width, height, Format.R8G8B8A8_UNorm, 1, 0);
            
            int tilesNum = ((width + MyLightRendering.TILE_SIZE - 1) / MyLightRendering.TILE_SIZE) * ((height + MyLightRendering.TILE_SIZE - 1) / MyLightRendering.TILE_SIZE);
            TilesNum = tilesNum;
            TilesX = (width + MyLightRendering.TILE_SIZE - 1) / MyLightRendering.TILE_SIZE;
            m_tileIndexes = new MyRWStructuredBuffer(tilesNum + tilesNum * MyRender11Constants.MAX_POINT_LIGHTS, sizeof(uint));
        }
コード例 #3
0
ファイル: MyGbuffer.cs プロジェクト: Chrus/SpaceEngineers
        internal static void Resize(int width, int height, int samplesNum, int samplesQuality)
        {
            if (m_resolvedDepth != null) {
                m_resolvedDepth.Release();
                m_ambientOcclusionHelper.Release();
                m_ambientOcclusion.Release();
                m_tileIndices.Release();
            }

            m_resolvedDepth = new MyDepthStencil(width, height, 1, 0);
            m_ambientOcclusionHelper = new MyRenderTarget(width, height, Format.R8G8B8A8_UNorm, 1, 0);
            m_ambientOcclusion = new MyRenderTarget(width, height, Format.R8G8B8A8_UNorm, 1, 0);
            
            TilesX = (width + MyLightRendering.TILE_SIZE - 1) / MyLightRendering.TILE_SIZE;
            TilesY = ((height + MyLightRendering.TILE_SIZE - 1) / MyLightRendering.TILE_SIZE);
            TilesNum = TilesX * TilesY;
            m_tileIndices = new MyRWStructuredBuffer(TilesNum + TilesNum * MyRender11Constants.MAX_POINT_LIGHTS, sizeof(uint), MyRWStructuredBuffer.UAVType.Default, true, "MyScreenDependants::tileIndices");
        }
コード例 #4
0
        internal static void Resize(int width, int height, int samplesNum, int samplesQuality)
        {
            if (m_resolvedDepth != null)
            {
                m_resolvedDepth.Release();
                m_ambientOcclusionHelper.Release();
                m_ambientOcclusion.Release();
                m_tileIndices.Release();
            }

            m_resolvedDepth          = new MyDepthStencil(width, height, 1, 0);
            m_ambientOcclusionHelper = new MyRenderTarget(width, height, Format.R8G8B8A8_UNorm, 1, 0);
            m_ambientOcclusion       = new MyRenderTarget(width, height, Format.R8G8B8A8_UNorm, 1, 0);

            TilesX        = (width + MyLightRendering.TILE_SIZE - 1) / MyLightRendering.TILE_SIZE;
            TilesY        = ((height + MyLightRendering.TILE_SIZE - 1) / MyLightRendering.TILE_SIZE);
            TilesNum      = TilesX * TilesY;
            m_tileIndices = new MyRWStructuredBuffer(TilesNum + TilesNum * MyRender11Constants.MAX_POINT_LIGHTS, sizeof(uint), MyRWStructuredBuffer.UAVType.Default, true, "MyScreenDependants::tileIndices");
        }
コード例 #5
0
        internal static void Resize(int width, int height, int samplesNum, int samplesQuality)
        {
            if (m_resolvedDepth != null)
            {
                m_resolvedDepth.Release();
                m_ambientOcclusionHelper.Release();
                m_ambientOcclusion.Release();
                m_tileIndexes.Release();
            }

            m_resolvedDepth          = new MyDepthStencil(width, height, 1, 0);
            m_ambientOcclusionHelper = new MyRenderTarget(width, height, Format.R8G8B8A8_UNorm, 1, 0);
            m_ambientOcclusion       = new MyRenderTarget(width, height, Format.R8G8B8A8_UNorm, 1, 0);

            int tilesNum = ((width + MyLightRendering.TILE_SIZE - 1) / MyLightRendering.TILE_SIZE) * ((height + MyLightRendering.TILE_SIZE - 1) / MyLightRendering.TILE_SIZE);

            TilesNum      = tilesNum;
            TilesX        = (width + MyLightRendering.TILE_SIZE - 1) / MyLightRendering.TILE_SIZE;
            m_tileIndexes = new MyRWStructuredBuffer(tilesNum + tilesNum * MyRender11Constants.MAX_POINT_LIGHTS, sizeof(uint));
        }
コード例 #6
0
 public void OnDeviceInit(MyDepthStencil owner, ShaderResourceViewDescription desc)
 {
     m_owner = owner;
     m_srv = new ShaderResourceView(MyRender11.Device, m_owner.Resource, desc);
     m_srv.DebugName = owner.Name;
 }
コード例 #7
0
 internal MyDepthView(MyDepthStencil from)
 {
     m_owner = from;
 }
コード例 #8
0
 internal MyDepthView(MyDepthStencil from)
 {
     m_owner = from;
 }
コード例 #9
0
 internal void ClearDepthStencil(MyDepthStencil depthStencil, float depth, byte stencil)
 {
     DeviceContext.ClearDepthStencilView(depthStencil.m_DSV, DepthStencilClearFlags.Depth | DepthStencilClearFlags.Stencil, depth, stencil);
     MyRender11.ProcessDebugOutput();
 }
コード例 #10
0
 internal void ClearDepthStencil(MyDepthStencil depthStencil, float depth, byte stencil)
 {
     Context.ClearDepthStencilView(depthStencil.m_DSV, DepthStencilClearFlags.Depth | DepthStencilClearFlags.Stencil, depth, stencil);
 }
コード例 #11
0
 internal void ClearDepthStencil(MyDepthStencil depthStencil, float depth, byte stencil)
 {
     Context.ClearDepthStencilView(depthStencil.m_DSV, DepthStencilClearFlags.Depth | DepthStencilClearFlags.Stencil, depth, stencil);
 }
コード例 #12
0
        /// <summary>
        /// Render depth and normals of windows to the specified target
        /// REMARK: Only on the windows with decals
        /// </summary>
        /// <returns>True if windows to be rendered found</returns>
        internal static bool RenderWindowsDepthOnly(MyDepthStencil depthStencil, MyBindableResource gbuffer1)
        {
            if (m_windowCount == 0)
                return false;

            TransferDataBillboards(WindowCountSafe, ref m_arrayDataWindows);

            RC.BindDepthRT(depthStencil, DepthStencilAccess.ReadWrite, gbuffer1);
            BindResourcesCommon();

            RC.SetBS(null);
            RC.SetVS(m_vsDepthOnly);
            RC.SetPS(m_psDepthOnly);


            if (!MyStereoRender.Enable)
                RC.DeviceContext.DrawIndexed(m_windowCount * 6, 0, 0);
            else
                MyStereoRender.DrawIndexedBillboards(RC, m_windowCount * 6, 0, 0);

            RC.SetRS(null);
            return true;
        }