// Adds to commandLists the command lists containing the rendering commands for the renderables given in renderablesDBVH internal void Render(Queue <CommandList> commandLists, bool updateEnvironmentMap = false) { ProfilerShort.Begin("MyGeometryRenderer.Render"); MyGpuProfiler.IC_BeginBlock("MyGeometryRenderer.Render"); ProfilerShort.Begin("Culling"); PrepareFrame(); ProfilerShort.Begin("Prepare culling"); var shadowmapQueries = m_shadowHandler.PrepareQueries(); MyVisibilityCuller.PrepareCullQuery(m_cullQuery, shadowmapQueries, updateEnvironmentMap); ProfilerShort.BeginNextBlock("Perform culling"); m_visibilityCuller.PerformCulling(m_cullQuery, m_renderablesDBVH); ProfilerShort.End(); ProfilerShort.End(); ProfilerShort.BeginNextBlock("Record command lists"); m_renderingDispatcher.RecordCommandLists(m_cullQuery, commandLists); ProfilerShort.BeginNextBlock("Send output messages"); SendOutputMessages(m_cullQuery); ProfilerShort.BeginNextBlock("Frame cleanup"); EndFrame(); MyGpuProfiler.IC_EndBlock(); ProfilerShort.End(); // End function block }
internal void AddDepthPass(MyShadowmapQuery shadowmapQuery) { var worldToProjection = shadowmapQuery.ProjectionInfo.WorldToProjection; int frustumMask = AddFrustum(ref worldToProjection); MyDepthPass pass = MyObjectPoolManager.Allocate <MyDepthPass>(); pass.DebugName = MyVisibilityCuller.ToString(shadowmapQuery.QueryType); pass.ProcessingMask = frustumMask; pass.ViewProjection = shadowmapQuery.ProjectionInfo.CurrentLocalToProjection; pass.Viewport = shadowmapQuery.Viewport; pass.FrustumIndex = shadowmapQuery.Index; pass.Dsv = shadowmapQuery.DepthBuffer; bool isCascade = shadowmapQuery.QueryType == MyFrustumEnum.ShadowCascade; pass.IsCascade = isCascade; pass.DefaultRasterizer = isCascade ? MyRasterizerStateManager.CascadesRasterizerStateOld : MyRasterizerStateManager.ShadowRasterizerState; pass.PerFrame(); RenderingPasses[Size - 1] = pass; }
internal MyGeometryRenderer(MyDynamicAABBTreeD renderablesDBVH, MyShadows shadowHandler) { m_renderablesDBVH = renderablesDBVH; m_shadowHandler = shadowHandler; m_cullQuery = new MyCullQuery(); m_visibilityCuller = new MyFrustumCuller(); m_renderingDispatcher = new MyRenderingDispatcher(); }
internal MyCullQuery PrepareCullQuery(bool updateEnvironmentMap = false) { PrepareFrame(); var shadowmapQueries = m_shadowHandler.PrepareQueries(); MyVisibilityCuller.PrepareCullQuery(m_cullQuery, shadowmapQueries, updateEnvironmentMap); return(m_cullQuery); }