Changeset View
Changeset View
Standalone View
Standalone View
source/renderer/SceneRenderer.cpp
Show First 20 Lines • Show All 583 Lines • ▼ Show 20 Lines | void CSceneRenderer::RenderReflections( | ||||
scissorRect.y = screenScissor.y1; | scissorRect.y = screenScissor.y1; | ||||
scissorRect.width = screenScissor.x2 - screenScissor.x1; | scissorRect.width = screenScissor.x2 - screenScissor.x1; | ||||
scissorRect.height = screenScissor.y2 - screenScissor.y1; | scissorRect.height = screenScissor.y2 - screenScissor.y1; | ||||
deviceCommandContext->SetScissors(1, &scissorRect); | deviceCommandContext->SetScissors(1, &scissorRect); | ||||
deviceCommandContext->SetGraphicsPipelineState( | deviceCommandContext->SetGraphicsPipelineState( | ||||
Renderer::Backend::MakeDefaultGraphicsPipelineStateDesc()); | Renderer::Backend::MakeDefaultGraphicsPipelineStateDesc()); | ||||
deviceCommandContext->BeginFramebufferPass(wm.m_ReflectionFramebuffer.get()); | deviceCommandContext->BeginFramebufferPass(wm.m_ReflectionFramebuffer.get()); | ||||
deviceCommandContext->ClearFramebuffer(); | |||||
CShaderDefines reflectionsContext = context; | CShaderDefines reflectionsContext = context; | ||||
reflectionsContext.Add(str_PASS_REFLECTIONS, str_1); | reflectionsContext.Add(str_PASS_REFLECTIONS, str_1); | ||||
// Render terrain and models | // Render terrain and models | ||||
RenderPatches(deviceCommandContext, reflectionsContext, CULL_REFLECTIONS); | RenderPatches(deviceCommandContext, reflectionsContext, CULL_REFLECTIONS); | ||||
RenderModels(deviceCommandContext, reflectionsContext, CULL_REFLECTIONS); | RenderModels(deviceCommandContext, reflectionsContext, CULL_REFLECTIONS); | ||||
RenderTransparentModels(deviceCommandContext, reflectionsContext, CULL_REFLECTIONS, TRANSPARENT); | RenderTransparentModels(deviceCommandContext, reflectionsContext, CULL_REFLECTIONS, TRANSPARENT); | ||||
▲ Show 20 Lines • Show All 59 Lines • ▼ Show 20 Lines | void CSceneRenderer::RenderRefractions( | ||||
scissorRect.y = screenScissor.y1; | scissorRect.y = screenScissor.y1; | ||||
scissorRect.width = screenScissor.x2 - screenScissor.x1; | scissorRect.width = screenScissor.x2 - screenScissor.x1; | ||||
scissorRect.height = screenScissor.y2 - screenScissor.y1; | scissorRect.height = screenScissor.y2 - screenScissor.y1; | ||||
deviceCommandContext->SetScissors(1, &scissorRect); | deviceCommandContext->SetScissors(1, &scissorRect); | ||||
deviceCommandContext->SetGraphicsPipelineState( | deviceCommandContext->SetGraphicsPipelineState( | ||||
Renderer::Backend::MakeDefaultGraphicsPipelineStateDesc()); | Renderer::Backend::MakeDefaultGraphicsPipelineStateDesc()); | ||||
deviceCommandContext->BeginFramebufferPass(wm.m_RefractionFramebuffer.get()); | deviceCommandContext->BeginFramebufferPass(wm.m_RefractionFramebuffer.get()); | ||||
deviceCommandContext->ClearFramebuffer(); | |||||
// Render terrain and models | // Render terrain and models | ||||
RenderPatches(deviceCommandContext, context, CULL_REFRACTIONS); | RenderPatches(deviceCommandContext, context, CULL_REFRACTIONS); | ||||
// Render debug-related terrain overlays to make it visible under water. | // Render debug-related terrain overlays to make it visible under water. | ||||
ITerrainOverlay::RenderOverlaysBeforeWater(deviceCommandContext); | ITerrainOverlay::RenderOverlaysBeforeWater(deviceCommandContext); | ||||
RenderModels(deviceCommandContext, context, CULL_REFRACTIONS); | RenderModels(deviceCommandContext, context, CULL_REFRACTIONS); | ||||
▲ Show 20 Lines • Show All 159 Lines • ▼ Show 20 Lines | |||||
{ | { | ||||
PROFILE3("render submissions"); | PROFILE3("render submissions"); | ||||
GPU_SCOPED_LABEL(deviceCommandContext, "Render submissions"); | GPU_SCOPED_LABEL(deviceCommandContext, "Render submissions"); | ||||
CShaderDefines context = m->globalContext; | CShaderDefines context = m->globalContext; | ||||
constexpr int cullGroup = CULL_DEFAULT; | constexpr int cullGroup = CULL_DEFAULT; | ||||
{ | |||||
PROFILE3_GPU("clear buffers"); | |||||
// We don't need to clear the color attachment of the framebuffer if the sky | |||||
// is going to be rendered. Because it covers the whole view. | |||||
deviceCommandContext->ClearFramebuffer(!m->skyManager.IsSkyVisible(), true, true); | |||||
} | |||||
m->skyManager.RenderSky(deviceCommandContext); | m->skyManager.RenderSky(deviceCommandContext); | ||||
// render submitted patches and models | // render submitted patches and models | ||||
RenderPatches(deviceCommandContext, context, cullGroup); | RenderPatches(deviceCommandContext, context, cullGroup); | ||||
// render debug-related terrain overlays | // render debug-related terrain overlays | ||||
ITerrainOverlay::RenderOverlaysBeforeWater(deviceCommandContext); | ITerrainOverlay::RenderOverlaysBeforeWater(deviceCommandContext); | ||||
▲ Show 20 Lines • Show All 345 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator