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(); }
public MyLightGlare(MyLight light) { m_parent = light; m_occlusionBox = new BoundingBox(); m_occlusionQuery = MyOcclusionQueries.Get(); m_measurementQuery = MyOcclusionQueries.Get(); }
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(); }
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; } }
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(); }
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(); }