Showing the changes to libraries/render-utils/src/RenderDeferredTask.cpp (1 of 72 files). Show all
Unified · Split
| @@ -35,16 +35,18 @@ · 34 unmodified lines | |||
| 35 | #include "TextureCache.h" | 35 | #include "TextureCache.h" |
| 36 | #include "ZoneRenderer.h" | 36 | #include "ZoneRenderer.h" |
| 37 | #include "FadeEffect.h" | 37 | #include "FadeEffect.h" |
| 38 | #include "RenderUtilsLogging.h" | ||
| 38 | 39 | ||
| 39 | #include "AmbientOcclusionEffect.h" | 40 | #include "AmbientOcclusionEffect.h" |
| 40 | #include "AntialiasingEffect.h" | 41 | #include "AntialiasingEffect.h" |
| 41 | #include "ToneMappingEffect.h" | 42 | #include "ToneMappingEffect.h" |
| 42 | #include "SubsurfaceScattering.h" | 43 | #include "SubsurfaceScattering.h" |
| 43 | #include "DrawHaze.h" | 44 | #include "DrawHaze.h" |
| 44 | #include "OutlineEffect.h" | 45 | #include "HighlightEffect.h" |
| 45 | 46 | ||
| 46 | #include <gpu/StandardShaderLib.h> | 47 | #include <gpu/StandardShaderLib.h> |
| 47 | 48 | ||
| 49 | #include <sstream> | ||
| 48 | 50 | ||
| 49 | using namespace render; | 51 | using namespace render; |
| 50 | extern void initOverlay3DPipelines(render::ShapePlumber& plumber, bool depthTest = false); | 52 | extern void initOverlay3DPipelines(render::ShapePlumber& plumber, bool depthTest = false); |
| @@ -58,6 +60,18 @@ void RenderDeferredTask::configure(const Config& config) · 7 unmodified lines | |||
| 58 | { | 60 | { |
| 59 | } | 61 | } |
| 60 | 62 | ||
| 63 | const render::Varying RenderDeferredTask::addSelectItemJobs(JobModel& task, const char* selectionName, | ||
| 64 | const render::Varying& metas, | ||
| 65 | const render::Varying& opaques, | ||
| 66 | const render::Varying& transparents) { | ||
| 67 | const auto selectMetaInput = SelectItems::Inputs(metas, Varying(), std::string()).asVarying(); | ||
| 68 | const auto selectedMetas = task.addJob<SelectItems>("MetaSelection", selectMetaInput, selectionName); | ||
| 69 | const auto selectMetaAndOpaqueInput = SelectItems::Inputs(opaques, selectedMetas, std::string()).asVarying(); | ||
| 70 | const auto selectedMetasAndOpaques = task.addJob<SelectItems>("OpaqueSelection", selectMetaAndOpaqueInput, selectionName); | ||
| 71 | const auto selectItemInput = SelectItems::Inputs(transparents, selectedMetasAndOpaques, std::string()).asVarying(); | ||
| 72 | return task.addJob<SelectItems>("TransparentSelection", selectItemInput, selectionName); | ||
| 73 | } | ||
| 74 | |||
| 61 | void RenderDeferredTask::build(JobModel& task, const render::Varying& input, render::Varying& output) { | 75 | void RenderDeferredTask::build(JobModel& task, const render::Varying& input, render::Varying& output) { |
| 62 | const auto& items = input.get<Input>(); | 76 | const auto& items = input.get<Input>(); |
| 63 | auto fadeEffect = DependencyManager::get<FadeEffect>(); | 77 | auto fadeEffect = DependencyManager::get<FadeEffect>(); |
| @@ -95,15 +109,6 @@ void RenderDeferredTask::build(JobModel& task, const render::Varying& input, ren · 31 unmodified lines | |||
| 95 | // draw a stencil mask in hidden regions of the framebuffer. | 109 | // draw a stencil mask in hidden regions of the framebuffer. |
| 96 | task.addJob<PrepareStencil>("PrepareStencil", primaryFramebuffer); | 110 | task.addJob<PrepareStencil>("PrepareStencil", primaryFramebuffer); |
| 97 | 111 | ||
| 98 | // Select items that need to be outlined | ||
| 99 | const auto selectionName = "contextOverlayHighlightList"; | ||
| 100 | const auto selectMetaInput = SelectItems::Inputs(metas, Varying()).asVarying(); | ||
| 101 | const auto selectedMetas = task.addJob<SelectItems>("PassTestMetaSelection", selectMetaInput, selectionName); | ||
| 102 | const auto selectMetaAndOpaqueInput = SelectItems::Inputs(opaques, selectedMetas).asVarying(); | ||
| 103 | const auto selectedMetasAndOpaques = task.addJob<SelectItems>("PassTestOpaqueSelection", selectMetaAndOpaqueInput, selectionName); | ||
| 104 | const auto selectItemInput = SelectItems::Inputs(transparents, selectedMetasAndOpaques).asVarying(); | ||
| 105 | const auto selectedItems = task.addJob<SelectItems>("PassTestTransparentSelection", selectItemInput, selectionName); | ||
| 106 | |||
| 107 | // Render opaque objects in DeferredBuffer | 112 | // Render opaque objects in DeferredBuffer |
| 108 | const auto opaqueInputs = DrawStateSortDeferred::Inputs(opaques, lightingModel).asVarying(); | 113 | const auto opaqueInputs = DrawStateSortDeferred::Inputs(opaques, lightingModel).asVarying(); |
| 109 | task.addJob<DrawStateSortDeferred>("DrawOpaqueDeferred", opaqueInputs, shapePlumber); | 114 | task.addJob<DrawStateSortDeferred>("DrawOpaqueDeferred", opaqueInputs, shapePlumber); |
| @@ -178,10 +183,15 @@ void RenderDeferredTask::build(JobModel& task, const render::Varying& input, ren · 68 unmodified lines | |||
| 178 | const auto toneMappingInputs = ToneMappingDeferred::Inputs(lightingFramebuffer, primaryFramebuffer).asVarying(); | 183 | const auto toneMappingInputs = ToneMappingDeferred::Inputs(lightingFramebuffer, primaryFramebuffer).asVarying(); |
| 179 | task.addJob<ToneMappingDeferred>("ToneMapping", toneMappingInputs); | 184 | task.addJob<ToneMappingDeferred>("ToneMapping", toneMappingInputs); |
| 180 | 185 | ||
| 181 | const auto outlineRangeTimer = task.addJob<BeginGPURangeTimer>("BeginOutlineRangeTimer", "Outline"); | 186 | const auto outlineRangeTimer = task.addJob<BeginGPURangeTimer>("BeginHighlightRangeTimer", "Highlight"); |
| 182 | const auto outlineInputs = DrawOutlineTask::Inputs(selectedItems, shapePlumber, deferredFramebuffer, primaryFramebuffer, deferredFrameTransform).asVarying(); | 187 | // Select items that need to be outlined |
| 183 | task.addJob<DrawOutlineTask>("DrawOutline", outlineInputs); | 188 | const auto selectionBaseName = "contextOverlayHighlightList"; |
| 184 | task.addJob<EndGPURangeTimer>("EndOutlineRangeTimer", outlineRangeTimer); | 189 | const auto selectedItems = addSelectItemJobs(task, selectionBaseName, metas, opaques, transparents); |
| 190 | |||
| 191 | const auto outlineInputs = DrawHighlightTask::Inputs(items.get0(), deferredFramebuffer, primaryFramebuffer, deferredFrameTransform).asVarying(); | ||
| 192 | task.addJob<DrawHighlightTask>("DrawHighlight", outlineInputs); | ||
| 193 | |||
| 194 | task.addJob<EndGPURangeTimer>("HighlightRangeTimer", outlineRangeTimer); | ||
| 185 | 195 | ||
| 186 | { // DEbug the bounds of the rendered items, still look at the zbuffer | 196 | { // DEbug the bounds of the rendered items, still look at the zbuffer |
| 187 | task.addJob<DrawBounds>("DrawMetaBounds", metas); | 197 | task.addJob<DrawBounds>("DrawMetaBounds", metas); |
| @@ -191,6 +201,9 @@ void RenderDeferredTask::build(JobModel& task, const render::Varying& input, ren · 3 unmodified lines | |||
| 191 | task.addJob<DrawBounds>("DrawLightBounds", lights); | 201 | task.addJob<DrawBounds>("DrawLightBounds", lights); |
| 192 | task.addJob<DrawBounds>("DrawZones", zones); | 202 | task.addJob<DrawBounds>("DrawZones", zones); |
| 193 | task.addJob<DrawFrustums>("DrawFrustums"); | 203 | task.addJob<DrawFrustums>("DrawFrustums"); |
| 204 | |||
| 205 | // Render.getConfig("RenderMainView.DrawSelectionBounds").enabled = true | ||
| 206 | task.addJob<DrawBounds>("DrawSelectionBounds", selectedItems); | ||
| 194 | } | 207 | } |
| 195 | 208 | ||
| 196 | // Layered Overlays | 209 | // Layered Overlays |
| @@ -237,9 +250,6 @@ void RenderDeferredTask::build(JobModel& task, const render::Varying& input, ren · 40 unmodified lines | |||
| 237 | } | 250 | } |
| 238 | 251 | ||
| 239 | task.addJob<DebugZoneLighting>("DrawZoneStack", deferredFrameTransform); | 252 | task.addJob<DebugZoneLighting>("DrawZoneStack", deferredFrameTransform); |
| 240 | |||
| 241 | // Render.getConfig("RenderMainView.DrawSelectionBounds").enabled = true | ||
| 242 | task.addJob<DrawBounds>("DrawSelectionBounds", selectedItems); | ||
| 243 | } | 253 | } |
| 244 | 254 | ||
| 245 | // AA job to be revisited | 255 | // AA job to be revisited |
| @@ -455,6 +465,7 @@ void Blit::run(const RenderContextPointer& renderContext, const gpu::Framebuffer · 209 unmodified lines | |||
| 455 | auto blitFbo = renderArgs->_blitFramebuffer; | 465 | auto blitFbo = renderArgs->_blitFramebuffer; |
| 456 | 466 | ||
| 457 | if (!blitFbo) { | 467 | if (!blitFbo) { |
| 468 | qCWarning(renderutils) << "Blit::run - no blit frame buffer."; | ||
| 458 | return; | 469 | return; |
| 459 | } | 470 | } |
| 460 | 471 | ||