removing comments and dead code, rewiring the debug

This commit is contained in:
sam gateau 2018-12-18 14:42:45 -08:00
parent d8e7305f4a
commit 2f18555ee0
10 changed files with 94 additions and 150 deletions

View file

@ -398,15 +398,6 @@ Menu::Menu() {
if (lightingModelConfig) {
lightingModelConfig->setShadow(action->isChecked());
}
/* auto mainViewShadowTaskConfig = renderConfig->getConfig<RenderShadowTask>("RenderMainView.RenderShadowTask");
if (mainViewShadowTaskConfig) {
if (action->isChecked()) {
mainViewShadowTaskConfig->setPreset("Enabled");
} else {
mainViewShadowTaskConfig->setPreset("None");
}
}*/
}
});
@ -417,22 +408,8 @@ Menu::Menu() {
auto lightingModelConfig = renderConfig->getConfig<MakeLightingModel>("RenderMainView.LightingModel");
if (lightingModelConfig) {
lightingModelConfig->setAmbientOcclusion(action->isChecked());
/* if (action->isChecked()) {
lightingModelConfig->setPreset("Enabled");
}
else {
mainViewAmbientOcclusionConfig->setPreset("None");
}*/
}
/* auto mainViewAmbientOcclusionConfig = renderConfig->getConfig<AmbientOcclusionEffect>("RenderMainView.AmbientOcclusion");
if (mainViewAmbientOcclusionConfig) {
if (action->isChecked()) {
mainViewAmbientOcclusionConfig->setPreset("Enabled");
} else {
mainViewAmbientOcclusionConfig->setPreset("None");
}
}*/
}
}
});
addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::WorldAxes);

View file

@ -272,22 +272,7 @@ public:
void SecondaryCameraRenderTask::build(JobModel& task, const render::Varying& inputs, render::Varying& outputs, render::CullFunctor cullFunctor, bool isDeferred) {
const auto cachedArg = task.addJob<SecondaryCameraJob>("SecondaryCamera");
task.addJob<RenderViewTask>("RenderSecondView", cullFunctor, true, render::ItemKey::TAG_BITS_1, render::ItemKey::TAG_BITS_1);
/*
const auto items = task.addJob<RenderFetchCullSortTask>("FetchCullSort", cullFunctor, render::ItemKey::TAG_BITS_1, render::ItemKey::TAG_BITS_1);
assert(items.canCast<RenderFetchCullSortTask::Output>());
task.addJob<RenderViewTask>("RenderSecondView", cullFunctor, isDeferred, render::ItemKey::TAG_BITS_1, render::ItemKey::TAG_BITS_1);
// const auto lightingStageFramesAndZones = task.addJob<AssembleLightingStageTask>("AssembleStages", items[0]);
const auto lightingStageFramesAndZones = task.addJob<AssembleLightingStageTask>("AssembleStages", items);
if (isDeferred) {
const render::Varying cascadeSceneBBoxes;
const auto renderInput = RenderDeferredTask::Input(items, lightingStageFramesAndZones, cascadeSceneBBoxes).asVarying();
task.addJob<RenderDeferredTask>("RenderDeferredTask", renderInput, false);
} else {
const auto renderInput = RenderForwardTask::Input(items, lightingStageFramesAndZones).asVarying();
task.addJob<RenderForwardTask>("Forward", renderInput);
}
*/
task.addJob<EndSecondaryCameraFrame>("EndSecondaryCamera", cachedArg);
}

View file

@ -43,7 +43,6 @@ void ZoneEntityRenderer::onRemoveFromSceneTyped(const TypedEntityPointer& entity
if (!LightStage::isIndexInvalid(_sunIndex)) {
_stage->removeLight(_sunIndex);
_sunIndex = INVALID_INDEX;
_shadowIndex = INVALID_INDEX;
}
if (!LightStage::isIndexInvalid(_ambientIndex)) {
_stage->removeLight(_ambientIndex);
@ -100,7 +99,6 @@ void ZoneEntityRenderer::doRender(RenderArgs* args) {
// Do we need to allocate the light in the stage ?
if (LightStage::isIndexInvalid(_sunIndex)) {
_sunIndex = _stage->addLight(_sunLight);
// _shadowIndex = _stage->addShadow(_sunIndex, SUN_SHADOW_MAX_DISTANCE, SUN_SHADOW_CASCADE_COUNT);
} else {
_stage->updateLightArrayBuffer(_sunIndex);
}

View file

@ -99,7 +99,6 @@ private:
ComponentMode _bloomMode { COMPONENT_MODE_INHERIT };
indexed_container::Index _sunIndex { LightStage::INVALID_INDEX };
indexed_container::Index _shadowIndex { LightStage::INVALID_INDEX };
indexed_container::Index _ambientIndex { LightStage::INVALID_INDEX };
BackgroundStagePointer _backgroundStage;

View file

@ -45,11 +45,6 @@ void AssembleLightingStageTask::build(JobModel& task, const render::Varying& inp
// Fetch the current frame stacks from all the stages
const auto currentStageFrames = task.addJob<FetchCurrentFrames>("FetchCurrentFrames");
/* const auto lightFrame = currentStageFrames.getN<FetchCurrentFrames::Outputs>(0);
const auto backgroundFrame = currentStageFrames.getN<FetchCurrentFrames::Outputs>(1);
const auto hazeFrame = currentStageFrames.getN<FetchCurrentFrames::Outputs>(2);
const auto bloomFrame = currentStageFrames.getN<FetchCurrentFrames::Outputs>(3);
*/
output = Output(currentStageFrames, zones);
}

View file

@ -32,7 +32,6 @@ public:
class AssembleLightingStageTask {
public:
// using Input = RenderFetchCullSortTask::BucketList;
using Input = RenderFetchCullSortTask::Output;
using Output = render::VaryingSet2<FetchCurrentFrames::Output, ZoneRendererTask::Output>;
using JobModel = render::Task::ModelIO<AssembleLightingStageTask, Input, Output, render::Task::Config>;

View file

@ -603,19 +603,21 @@ void RenderDeferred::configure(const Config& config) {
}
void RenderDeferred::run(const RenderContextPointer& renderContext, const Inputs& inputs) {
auto args = renderContext->args;
auto deferredTransform = inputs.get0();
auto deferredFramebuffer = inputs.get1();
auto lightingModel = inputs.get2();
auto surfaceGeometryFramebuffer = inputs.get3();
auto ssaoFramebuffer = inputs.get4();
auto subsurfaceScatteringResource = inputs.get5();
auto lightClusters = inputs.get6();
auto args = renderContext->args;
auto extraRenderBuffers = inputs.get2();
auto surfaceGeometryFramebuffer = extraRenderBuffers.get0();
auto ssaoFramebuffer = extraRenderBuffers.get1();
auto subsurfaceScatteringResource = extraRenderBuffers.get2();
const auto& lightFrame = inputs.get7();
const auto& shadowFrame = inputs.get8();
const auto& hazeFrame = inputs.get9();
auto lightingModel = inputs.get3();
auto lightClusters = inputs.get4();
const auto& lightFrame = inputs.get5();
const auto& shadowFrame = inputs.get6();
const auto& hazeFrame = inputs.get7();
if (!_gpuTimer) {
_gpuTimer = std::make_shared < gpu::RangeTimer>(__FUNCTION__);
@ -684,7 +686,6 @@ void DefaultLightingSetup::run(const RenderContextPointer& renderContext) {
// Add the global light to the light stage (for later shadow rendering)
// Set this light to be the default
_defaultLightID = lightStage->addLight(lp, true);
// lightStage->addShadow(_defaultLightID);
}
auto backgroundStage = renderContext->_scene->getStage<BackgroundStage>();

View file

@ -174,9 +174,9 @@ using RenderDeferredConfig = render::GPUJobConfig;
class RenderDeferred {
public:
using Inputs = render::VaryingSet10<
DeferredFrameTransformPointer, DeferredFramebufferPointer, LightingModelPointer, SurfaceGeometryFramebufferPointer,
AmbientOcclusionFramebufferPointer, SubsurfaceScatteringResourcePointer, LightClustersPointer, LightStage::FramePointer, LightStage::ShadowFramePointer, HazeStage::FramePointer>;
using ExtraDeferredBuffer = render::VaryingSet3<SurfaceGeometryFramebufferPointer, AmbientOcclusionFramebufferPointer, SubsurfaceScatteringResourcePointer>;
using Inputs = render::VaryingSet8<
DeferredFrameTransformPointer, DeferredFramebufferPointer, ExtraDeferredBuffer, LightingModelPointer, LightClustersPointer, LightStage::FramePointer, LightStage::ShadowFramePointer, HazeStage::FramePointer>;
using Config = RenderDeferredConfig;
using JobModel = render::Job::ModelI<RenderDeferred, Inputs, Config>;

View file

@ -72,28 +72,19 @@ namespace gr {
}
/*
class RenderDeferredTaskDebugConfig : public render::Task::Config {
public:
signals :
void dirty();
};*/
class RenderDeferredTaskDebug {
public:
using ExtraBuffers = render::VaryingSet5<LinearDepthFramebufferPointer, SurfaceGeometryFramebufferPointer, AmbientOcclusionEffect::Output, SubsurfaceScatteringResourcePointer, VelocityFramebufferPointer>;
using Input = render::VaryingSet9<RenderFetchCullSortTask::Output, RenderShadowTask::Output,
AssembleLightingStageTask::Output, LightClusteringPass::Output, LinearDepthFramebufferPointer,
PrepareDeferred::Outputs, GenerateDeferredFrameTransform::Output, JitterSample::Output, LightingModel>;
// using Config = RenderDeferredTaskConfig;
AssembleLightingStageTask::Output, LightClusteringPass::Output,
PrepareDeferred::Outputs, ExtraBuffers, GenerateDeferredFrameTransform::Output,
JitterSample::Output, LightingModel>;
using JobModel = render::Task::ModelI<RenderDeferredTaskDebug, Input>;
RenderDeferredTaskDebug();
// void configure(const Config& config);
void build(JobModel& task, const render::Varying& inputs, render::Varying& outputs);
private:
};
@ -221,8 +212,8 @@ void RenderDeferredTask::build(JobModel& task, const render::Varying& input, ren
const auto lightClusters = task.addJob<LightClusteringPass>("LightClustering", lightClusteringPassInputs);
// DeferredBuffer is complete, now let's shade it into the LightingBuffer
const auto deferredLightingInputs = RenderDeferred::Inputs(deferredFrameTransform, deferredFramebuffer, lightingModel,
surfaceGeometryFramebuffer, ambientOcclusionFramebuffer, scatteringResource, lightClusters, lightFrame, shadowFrame, hazeFrame).asVarying();
const auto extraDeferredBuffer = RenderDeferred::ExtraDeferredBuffer(surfaceGeometryFramebuffer, ambientOcclusionFramebuffer, scatteringResource).asVarying();
const auto deferredLightingInputs = RenderDeferred::Inputs(deferredFrameTransform, deferredFramebuffer, extraDeferredBuffer, lightingModel, lightClusters, lightFrame, shadowFrame, hazeFrame).asVarying();
task.addJob<RenderDeferred>("RenderDeferred", deferredLightingInputs);
// Similar to light stage, background stage has been filled by several potential render items and resolved for the frame in this job
@ -265,7 +256,9 @@ void RenderDeferredTask::build(JobModel& task, const render::Varying& input, ren
// Debugging task is happening in the "over" layer after tone mapping and just before HUD
{ // Debug the bounds of the rendered items, still look at the zbuffer
const auto debugInputs = RenderDeferredTaskDebug::Input(fetchedItems, inputs.get2(), lightingStageInputs, lightClusters, linearDepthTarget, prepareDeferredOutputs, deferredFrameTransform, jitter, lightingModel).asVarying();
const auto extraDebugBuffers = RenderDeferredTaskDebug::ExtraBuffers(linearDepthTarget, surfaceGeometryFramebuffer, ambientOcclusionOutputs, scatteringResource, velocityBuffer);
const auto debugInputs = RenderDeferredTaskDebug::Input(fetchedItems, inputs.get2(), lightingStageInputs, lightClusters, prepareDeferredOutputs, extraDebugBuffers,
deferredFrameTransform, jitter, lightingModel).asVarying();
task.addJob<RenderDeferredTaskDebug>("DebugRenderDeferredTask", debugInputs);
}
@ -289,10 +282,6 @@ void RenderDeferredTask::build(JobModel& task, const render::Varying& input, ren
RenderDeferredTaskDebug::RenderDeferredTaskDebug() {
}
/*
void RenderDeferredTaskDebug::configure(const Config& config) {
}*/
void RenderDeferredTaskDebug::build(JobModel& task, const render::Varying& input, render::Varying& outputs) {
@ -300,20 +289,21 @@ void RenderDeferredTaskDebug::build(JobModel& task, const render::Varying& input
// RenderFetchCullSortTask out
const auto& fetchCullSortTaskOut = inputs.get0();
const auto& items = fetchCullSortTaskOut.get0();
const auto& spatialSelection = fetchCullSortTaskOut[1];
const auto& items = fetchCullSortTaskOut.get0();
// Extract opaques / transparents / lights / metas / overlays InFront and HUD / background
const auto& opaques = items[RenderFetchCullSortTask::OPAQUE_SHAPE];
const auto& transparents = items[RenderFetchCullSortTask::TRANSPARENT_SHAPE];
const auto& lights = items[RenderFetchCullSortTask::LIGHT];
const auto& metas = items[RenderFetchCullSortTask::META];
const auto& overlayOpaques = items[RenderFetchCullSortTask::OVERLAY_OPAQUE_SHAPE];
const auto& overlayTransparents = items[RenderFetchCullSortTask::OVERLAY_TRANSPARENT_SHAPE];
const auto& overlaysInFrontOpaque = items[RenderFetchCullSortTask::LAYER_FRONT_OPAQUE_SHAPE];
const auto& overlaysInFrontTransparent = items[RenderFetchCullSortTask::LAYER_FRONT_TRANSPARENT_SHAPE];
const auto& overlaysHUDOpaque = items[RenderFetchCullSortTask::LAYER_HUD_OPAQUE_SHAPE];
const auto& overlaysHUDTransparent = items[RenderFetchCullSortTask::LAYER_HUD_TRANSPARENT_SHAPE];
// Extract opaques / transparents / lights / metas / overlays InFront and HUD / background
const auto& opaques = items[RenderFetchCullSortTask::OPAQUE_SHAPE];
const auto& transparents = items[RenderFetchCullSortTask::TRANSPARENT_SHAPE];
const auto& lights = items[RenderFetchCullSortTask::LIGHT];
const auto& metas = items[RenderFetchCullSortTask::META];
const auto& overlayOpaques = items[RenderFetchCullSortTask::OVERLAY_OPAQUE_SHAPE];
const auto& overlayTransparents = items[RenderFetchCullSortTask::OVERLAY_TRANSPARENT_SHAPE];
const auto& overlaysInFrontOpaque = items[RenderFetchCullSortTask::LAYER_FRONT_OPAQUE_SHAPE];
const auto& overlaysInFrontTransparent = items[RenderFetchCullSortTask::LAYER_FRONT_TRANSPARENT_SHAPE];
const auto& overlaysHUDOpaque = items[RenderFetchCullSortTask::LAYER_HUD_OPAQUE_SHAPE];
const auto& overlaysHUDTransparent = items[RenderFetchCullSortTask::LAYER_HUD_TRANSPARENT_SHAPE];
const auto& spatialSelection = fetchCullSortTaskOut[1];
// RenderShadowTask out
const auto& shadowOut = inputs.get1();
@ -324,10 +314,10 @@ void RenderDeferredTaskDebug::build(JobModel& task, const render::Varying& input
const auto lightingStageInputs = inputs.get2();
// Fetch the current frame stacks from all the stages
const auto stageCurrentFrames = lightingStageInputs.get0();
const auto lightFrame = stageCurrentFrames[0];
const auto backgroundFrame = stageCurrentFrames[1];
const auto hazeFrame = stageCurrentFrames[2];
const auto bloomFrame = stageCurrentFrames[3];
const auto lightFrame = stageCurrentFrames[0];
const auto backgroundFrame = stageCurrentFrames[1];
const auto hazeFrame = stageCurrentFrames[2];
const auto bloomFrame = stageCurrentFrames[3];
// Zones
const auto& zones = lightingStageInputs[1];
@ -335,11 +325,19 @@ void RenderDeferredTaskDebug::build(JobModel& task, const render::Varying& input
// Light CLuster
const auto& lightClusters = inputs[3];
// linear Depth Target
const auto& linearDepthTarget = inputs[4];
// PrepareDeferred out
const auto& deferredFramebuffer = inputs[5];
const auto& prepareDeferredOutputs = inputs.get4();
const auto& deferredFramebuffer = prepareDeferredOutputs[0];
// extraDeferredBuffer
const auto& extraDeferredBuffer = inputs.get5();
const auto& linearDepthTarget = extraDeferredBuffer.get0();
const auto& surfaceGeometryFramebuffer = extraDeferredBuffer.get1();
const auto& ambientOcclusionOut = extraDeferredBuffer.get2();
const auto& ambientOcclusionFramebuffer = ambientOcclusionOut[0];
const auto& ambientOcclusionUniforms = ambientOcclusionOut[1];
const auto& scatteringResource = extraDeferredBuffer[3];
const auto& velocityBuffer = extraDeferredBuffer[4];
// GenerateDeferredFrameTransform out
const auto& deferredFrameTransform = inputs[6];
@ -412,8 +410,9 @@ void RenderDeferredTaskDebug::build(JobModel& task, const render::Varying& input
// Debugging stages
{
// Debugging Deferred buffer job
/* const auto debugFramebuffers = render::Varying(DebugDeferredBuffer::Inputs(deferredFramebuffer, linearDepthTarget, surfaceGeometryFramebuffer, ambientOcclusionFramebuffer, velocityBuffer, deferredFrameTransform, lightFrame));
const auto debugFramebuffers = DebugDeferredBuffer::Inputs(deferredFramebuffer, linearDepthTarget, surfaceGeometryFramebuffer, ambientOcclusionFramebuffer, velocityBuffer, deferredFrameTransform, lightFrame).asVarying();
task.addJob<DebugDeferredBuffer>("DebugDeferredBuffer", debugFramebuffers);
const auto debugSubsurfaceScatteringInputs = DebugSubsurfaceScattering::Inputs(deferredFrameTransform, deferredFramebuffer, lightingModel,
@ -422,7 +421,7 @@ void RenderDeferredTaskDebug::build(JobModel& task, const render::Varying& input
const auto debugAmbientOcclusionInputs = DebugAmbientOcclusion::Inputs(deferredFrameTransform, deferredFramebuffer, linearDepthTarget, ambientOcclusionUniforms).asVarying();
task.addJob<DebugAmbientOcclusion>("DebugAmbientOcclusion", debugAmbientOcclusionInputs);
*/
// Scene Octree Debugging job
{
task.addJob<DrawSceneOctree>("DrawSceneOctree", spatialSelection);

View file

@ -48,62 +48,53 @@ using namespace render;
extern void initForwardPipelines(ShapePlumber& plumber);
void RenderForwardTask::build(JobModel& task, const render::Varying& input, render::Varying& output) {
const auto& inputs = input.get<Input>();
const auto& fetchedItems = inputs.get0();
// const auto& fetchedItems = inputs[0];
// const auto& items = fetchedItems[0];
const auto& items = fetchedItems.get0();
// Lighting model comes next, the big configuration of the view
const auto& lightingModel = inputs.get1();
const auto& lightingStageInputs = inputs.get2();
// Fetch the current frame stacks from all the stages
const auto& currentStageFrames = lightingStageInputs.get0();
const auto& lightFrame = currentStageFrames[0];
const auto& backgroundFrame = currentStageFrames[1];
const auto& hazeFrame = currentStageFrames[2];
const auto& bloomFrame = currentStageFrames[3];
const auto& zones = lightingStageInputs[1];
auto fadeEffect = DependencyManager::get<FadeEffect>();
// Prepare the ShapePipelines
auto fadeEffect = DependencyManager::get<FadeEffect>();
ShapePlumberPointer shapePlumber = std::make_shared<ShapePlumber>();
initForwardPipelines(*shapePlumber);
// Extract opaques / transparents / lights / metas / overlays / background
const auto& opaques = items[RenderFetchCullSortTask::OPAQUE_SHAPE];
const auto& transparents = items[RenderFetchCullSortTask::TRANSPARENT_SHAPE];
const auto& lights = items[RenderFetchCullSortTask::LIGHT];
const auto& metas = items[RenderFetchCullSortTask::META];
const auto& overlayOpaques = items[RenderFetchCullSortTask::OVERLAY_OPAQUE_SHAPE];
const auto& overlayTransparents = items[RenderFetchCullSortTask::OVERLAY_TRANSPARENT_SHAPE];
const auto& overlaysInFrontOpaque = items[RenderFetchCullSortTask::LAYER_FRONT_OPAQUE_SHAPE];
const auto& overlaysInFrontTransparent = items[RenderFetchCullSortTask::LAYER_FRONT_TRANSPARENT_SHAPE];
const auto& overlaysHUDOpaque = items[RenderFetchCullSortTask::LAYER_HUD_OPAQUE_SHAPE];
const auto& overlaysHUDTransparent = items[RenderFetchCullSortTask::LAYER_HUD_TRANSPARENT_SHAPE];
// Unpack inputs
const auto& inputs = input.get<Input>();
// Separate the fetched items
const auto& fetchedItems = inputs.get0();
const auto& spatialSelection = fetchedItems[1];
const auto& items = fetchedItems.get0();
// Extract opaques / transparents / lights / metas / overlays / background
const auto& opaques = items[RenderFetchCullSortTask::OPAQUE_SHAPE];
const auto& transparents = items[RenderFetchCullSortTask::TRANSPARENT_SHAPE];
const auto& lights = items[RenderFetchCullSortTask::LIGHT];
const auto& metas = items[RenderFetchCullSortTask::META];
const auto& overlayOpaques = items[RenderFetchCullSortTask::OVERLAY_OPAQUE_SHAPE];
const auto& overlayTransparents = items[RenderFetchCullSortTask::OVERLAY_TRANSPARENT_SHAPE];
const auto& overlaysInFrontOpaque = items[RenderFetchCullSortTask::LAYER_FRONT_OPAQUE_SHAPE];
const auto& overlaysInFrontTransparent = items[RenderFetchCullSortTask::LAYER_FRONT_TRANSPARENT_SHAPE];
const auto& overlaysHUDOpaque = items[RenderFetchCullSortTask::LAYER_HUD_OPAQUE_SHAPE];
const auto& overlaysHUDTransparent = items[RenderFetchCullSortTask::LAYER_HUD_TRANSPARENT_SHAPE];
const auto& spatialSelection = fetchedItems.get1();
// Lighting model comes next, the big configuration of the view
const auto& lightingModel = inputs[1];
// Extract the Lighting Stages Current frame ( and zones)
const auto& lightingStageInputs = inputs.get2();
// Fetch the current frame stacks from all the stages
const auto currentStageFrames = lightingStageInputs.get0();
const auto lightFrame = currentStageFrames[0];
const auto backgroundFrame = currentStageFrames[1];
const auto& hazeFrame = currentStageFrames[2];
const auto& bloomFrame = currentStageFrames[3];
const auto& zones = lightingStageInputs[1];
// First job, alter faded
fadeEffect->build(task, opaques);
// Prepare objects shared by several jobs
const auto deferredFrameTransform = task.addJob<GenerateDeferredFrameTransform>("DeferredFrameTransform");
// Filter zones from the general metas bucket
// const auto zones = task.addJob<ZoneRendererTask>("ZoneRenderer", metas);
// Fetch the current frame stacks from all the stages
// const auto currentFrames = task.addJob<FetchCurrentFrames>("FetchCurrentFrames");
// const auto lightFrame = currentFrames.getN<FetchCurrentFrames::Outputs>(0);
// const auto backgroundFrame = currentFrames.getN<FetchCurrentFrames::Outputs>(1);
//const auto hazeFrame = currentFrames.getN<FetchCurrentFrames::Outputs>(2);
//const auto bloomFrame = currentFrames.getN<FetchCurrentFrames::Outputs>(3);
// GPU jobs: Start preparing the main framebuffer
const auto framebuffer = task.addJob<PrepareFramebuffer>("PrepareFramebuffer");