public void ExecuteStage(VisibiltyManager visibilityManager, Vector3 viewPosition) { if (OverrideFramebuffer == null) { RenderContext.SetDefaultFramebuffer(); } else { RenderContext.SetFramebuffer(OverrideFramebuffer); } RenderContext.SetViewport(0, 0, RenderContext.CurrentFramebuffer.Width, RenderContext.CurrentFramebuffer.Height); _renderQueue.Clear(); visibilityManager.CollectVisibleObjects(_renderQueue, Name, ref _cameraFrustum, viewPosition); if (Comparer != null) { _renderQueue.Sort(Comparer); } else { _renderQueue.Sort(); } foreach (RenderItem item in _renderQueue) { item.Render(RenderContext, Name); } }
public void ExecuteStage(VisibiltyManager visibilityManager, Vector3 cameraPosition) { UpdateLightProjection(); RenderContext.ClearScissorRectangle(); RenderContext.SetFramebuffer(_shadowMapFramebuffer); RenderContext.ClearBuffer(); RenderContext.SetViewport(0, 0, DepthMapWidth, DepthMapHeight); _queue.Clear(); visibilityManager.CollectVisibleObjects(_queue, "ShadowMap", Vector3.Zero); _queue.Sort(); foreach (RenderItem item in _queue) { item.Render(RenderContext, "ShadowMap"); } }
public void ExecuteStage(VisibiltyManager visibilityManager, Vector3 viewPosition) { RenderContext.ClearScissorRectangle(); RenderContext.SetFramebuffer(_shadowMapFramebuffer); RenderContext.ClearBuffer(); RenderContext.SetViewport(0, 0, DepthMapWidth, DepthMapHeight); _queue.Clear(); visibilityManager.CollectVisibleObjects(_queue, "ShadowMap", DirectionalLightPosition); _queue.Sort(); foreach (RenderItem item in _queue) { item.Render(RenderContext, "ShadowMap"); } if (_takeScreenshot) { _takeScreenshot = false; SaveDepthTextureToFile(); } }