Example #1
0
        private static void IssueOcclusionQuery(MyOcclusionQuery query, bool depthTest)
        {
            MinerWars.AppCode.Game.Render.MyRender.GetRenderProfiler().StartProfilingBlock("IssueOcclusionQuery");
            BlendState previousBlendState = BlendState.Current;

            MyStateObjects.DisabledColorChannels_BlendState.Apply();
            RasterizerState.CullNone.Apply();

            if (MyRenderConstants.RenderQualityProfile.ForwardRender)
            {
                DepthStencilState.DepthRead.Apply();
            }
            else
            {
                DepthStencilState.None.Apply();
            }

            query.Begin();

            //generate and draw bounding box of our renderCell in occlusion query
            MySimpleObjectDraw.DrawOcclusionBoundingBox(m_occlusionBox, 1.0f, depthTest, true);

            query.End();

            previousBlendState.Apply();

            MinerWars.AppCode.Game.Render.MyRender.GetRenderProfiler().EndProfilingBlock();
        }
Example #2
0
        public MyLightGlare(MyLight light)
        {
            m_parent       = light;
            m_occlusionBox = new BoundingBox();

            m_occlusionQuery   = MyOcclusionQueries.Get();
            m_measurementQuery = MyOcclusionQueries.Get();
        }
Example #3
0
        public void LoadContent()
        {
            System.Diagnostics.Debug.Assert(m_occlusionQuery == null);
            System.Diagnostics.Debug.Assert(m_measurementQuery == null);

            m_occlusionQuery   = MyOcclusionQueries.Get();
            m_measurementQuery = MyOcclusionQueries.Get();
        }
Example #4
0
        public void UnloadContent()
        {
            if (m_occlusionQuery != null)
            {
                //occlusion queries are managed automatically
                MyOcclusionQueries.Return(m_occlusionQuery);
                MyOcclusionQueries.Return(m_measurementQuery);

                m_occlusionQuery   = null;
                m_measurementQuery = null;
            }
        }
Example #5
0
        private void IssueOcclusionQuery(MyOcclusionQuery query, bool depthTest)
        {
            MyRender.GetRenderProfiler().StartProfilingBlock("Issue query");

            BlendState previousBlendState = BlendState.Current;;

            MyStateObjects.DisabledColorChannels_BlendState.Apply();
            RasterizerState.CullNone.Apply();
            DepthStencilState.None.Apply();

            query.Begin();

            //generate and draw bounding box of our renderCell in occlusion query
            MyDebugDraw.DrawOcclusionBoundingBox(m_occlusionBox, 1.0f, depthTest);

            previousBlendState.Apply();

            query.End();

            MyRender.GetRenderProfiler().EndProfilingBlock();
        }
Example #6
0
        private void IssueOcclusionQuery(MyOcclusionQuery query, bool depthTest)
        {
            MyRender.GetRenderProfiler().StartProfilingBlock("Issue query");

            BlendState previousBlendState = BlendState.Current; ;
            MyStateObjects.DisabledColorChannels_BlendState.Apply();
            RasterizerState.CullNone.Apply();
            DepthStencilState.None.Apply();

            query.Begin();

            //generate and draw bounding box of our renderCell in occlusion query 
            MyDebugDraw.DrawOcclusionBoundingBox(m_occlusionBox, 1.0f, depthTest);

            previousBlendState.Apply();

            query.End();

            MyRender.GetRenderProfiler().EndProfilingBlock();
        }
Example #7
0
        public void UnloadContent()
        {
            if (m_occlusionQuery != null)
            {
                //occlusion queries are managed automatically
                MyOcclusionQueries.Return(m_occlusionQuery);
                MyOcclusionQueries.Return(m_measurementQuery);

                m_occlusionQuery = null;
                m_measurementQuery = null;
            }
        }
Example #8
0
        public void LoadContent()
        {
            System.Diagnostics.Debug.Assert(m_occlusionQuery == null);
            System.Diagnostics.Debug.Assert(m_measurementQuery == null);

            m_occlusionQuery = MyOcclusionQueries.Get();
            m_measurementQuery = MyOcclusionQueries.Get();
        }