public override void Render(Camera[] cameras, RenderLoop renderLoop) { foreach (var camera in cameras) { CullResults cullResults; CullingParameters cullingParams; if (!CullResults.GetCullingParameters(camera, out cullingParams)) { continue; } m_ShadowPass.UpdateCullingParameters(ref cullingParams); cullResults = CullResults.Cull(ref cullingParams, renderLoop); ShadowOutput shadows; m_ShadowPass.Render(renderLoop, cullResults, out shadows); renderLoop.SetupCameraProperties(camera); UpdateLightConstants(cullResults.visibleLights, ref shadows); var settings = new DrawRendererSettings(cullResults, camera, new ShaderPassName("ForwardBase")); settings.rendererConfiguration = RendererConfiguration.PerObjectLightProbe | RendererConfiguration.PerObjectReflectionProbes; settings.sorting.sortOptions = SortOptions.SortByMaterialThenMesh; renderLoop.DrawRenderers(ref settings); renderLoop.Submit(); } // Post effects }
void RenderOpaqueRenderList(CullResults cull, Camera camera, RenderLoop renderLoop, string passName) { if (!debugParameters.displayOpaqueObjects) { return; } DrawRendererSettings settings = new DrawRendererSettings(cull, camera, new ShaderPassName(passName)); settings.sorting.sortOptions = SortOptions.SortByMaterialThenMesh; settings.inputCullingOptions.SetQueuesOpaque(); renderLoop.DrawRenderers(ref settings); }
void RenderTransparentRenderList(CullResults cull, Camera camera, RenderLoop renderLoop, string passName) { if (!debugParameters.displayTransparentObjects) { return; } var settings = new DrawRendererSettings(cull, camera, new ShaderPassName(passName)) { rendererConfiguration = RendererConfiguration.PerObjectLightProbe | RendererConfiguration.PerObjectReflectionProbes, sorting = { sortOptions = SortOptions.SortByMaterialThenMesh } }; settings.inputCullingOptions.SetQueuesTransparent(); renderLoop.DrawRenderers(ref settings); }