mirror of
https://github.com/overte-org/overte.git
synced 2025-04-13 14:52:19 +02:00
trying...
This commit is contained in:
parent
b24a2d33bf
commit
50fcd7f40a
11 changed files with 56 additions and 45 deletions
|
@ -206,12 +206,17 @@ void SecondaryCameraRenderTask::build(JobModel& task, const render::Varying& inp
|
|||
const auto cachedArg = task.addJob<SecondaryCameraJob>("SecondaryCamera");
|
||||
const auto items = task.addJob<RenderFetchCullSortTask>("FetchCullSort", cullFunctor, render::ItemKey::TAG_BITS_1, render::ItemKey::TAG_BITS_1);
|
||||
assert(items.canCast<RenderFetchCullSortTask::Output>());
|
||||
|
||||
// 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, cascadeSceneBBoxes).asVarying();
|
||||
const auto renderInput = RenderDeferredTask::Input(items, lightingStageFramesAndZones, cascadeSceneBBoxes).asVarying();
|
||||
task.addJob<RenderDeferredTask>("RenderDeferredTask", renderInput, false);
|
||||
} else {
|
||||
task.addJob<RenderForwardTask>("Forward", items);
|
||||
const auto renderInput = RenderForwardTask::Input(items, lightingStageFramesAndZones).asVarying();
|
||||
task.addJob<RenderForwardTask>("Forward", renderInput);
|
||||
}
|
||||
task.addJob<EndSecondaryCameraFrame>("EndSecondaryCamera", cachedArg);
|
||||
}
|
|
@ -29,9 +29,9 @@ void GLBackend::do_setProjectionTransform(const Batch& batch, size_t paramOffset
|
|||
}
|
||||
|
||||
void GLBackend::do_setProjectionJitter(const Batch& batch, size_t paramOffset) {
|
||||
_transform._projectionJitter.x = batch._params[paramOffset]._float;
|
||||
_transform._projectionJitter.y = batch._params[paramOffset+1]._float;
|
||||
_transform._invalidProj = true;
|
||||
_transform._projectionJitter.x = batch._params[paramOffset]._float;
|
||||
_transform._projectionJitter.y = batch._params[paramOffset+1]._float;
|
||||
_transform._invalidProj = true;
|
||||
}
|
||||
|
||||
void GLBackend::do_setViewportTransform(const Batch& batch, size_t paramOffset) {
|
||||
|
|
|
@ -7,46 +7,49 @@
|
|||
//
|
||||
#include "AssembleLightingStageTask.h"
|
||||
|
||||
#include <render/DrawTask.h>
|
||||
|
||||
void FetchCurrentFrames::run(const render::RenderContextPointer& renderContext, Outputs& outputs) {
|
||||
void FetchCurrentFrames::run(const render::RenderContextPointer& renderContext, Output& output) {
|
||||
auto lightStage = renderContext->_scene->getStage<LightStage>();
|
||||
assert(lightStage);
|
||||
outputs.edit0() = std::make_shared<LightStage::Frame>(lightStage->_currentFrame);
|
||||
output.edit0() = std::make_shared<LightStage::Frame>(lightStage->_currentFrame);
|
||||
|
||||
auto backgroundStage = renderContext->_scene->getStage<BackgroundStage>();
|
||||
assert(backgroundStage);
|
||||
outputs.edit1() = std::make_shared<BackgroundStage::Frame>(backgroundStage->_currentFrame);
|
||||
output.edit1() = std::make_shared<BackgroundStage::Frame>(backgroundStage->_currentFrame);
|
||||
|
||||
auto hazeStage = renderContext->_scene->getStage<HazeStage>();
|
||||
assert(hazeStage);
|
||||
outputs.edit2() = std::make_shared<HazeStage::Frame>(hazeStage->_currentFrame);
|
||||
output.edit2() = std::make_shared<HazeStage::Frame>(hazeStage->_currentFrame);
|
||||
|
||||
auto bloomStage = renderContext->_scene->getStage<BloomStage>();
|
||||
assert(bloomStage);
|
||||
outputs.edit3() = std::make_shared<BloomStage::Frame>(bloomStage->_currentFrame);
|
||||
output.edit3() = std::make_shared<BloomStage::Frame>(bloomStage->_currentFrame);
|
||||
}
|
||||
|
||||
|
||||
void RenderUpdateLightingStagesTask::build(JobModel& task, const render::Varying& input, render::Varying& output) {
|
||||
const auto& items = input.get<Inputs>();
|
||||
void AssembleLightingStageTask::build(JobModel& task, const render::Varying& input, render::Varying& output) {
|
||||
const auto& fetchCullSortOut = input.get<Input>();
|
||||
const auto& items = fetchCullSortOut[0];
|
||||
//const auto& items = input.get<Input>();
|
||||
|
||||
const auto& lights = items[RenderFetchCullSortTask::LIGHT];
|
||||
const auto& metas = items[RenderFetchCullSortTask::META];
|
||||
|
||||
// Clear Light, Haze, Bloom, and Skybox Stages and render zones from the general metas bucket
|
||||
const auto zones = task.addJob<ZoneRendererTask>("ZoneRenderer", metas);
|
||||
|
||||
// Draw Lights just add the lights to the current list of lights to deal with. NOt really gpu job for now.
|
||||
task.addJob<DrawLight>("DrawLight", lights);
|
||||
task.addJob<render::DrawLight>("DrawLight", lights);
|
||||
|
||||
// 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 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);
|
||||
|
||||
outputs.edit0() = currentStageFrames;
|
||||
outputs.edit1() = zones;
|
||||
*/
|
||||
output = Output(currentStageFrames, zones);
|
||||
}
|
||||
|
||||
|
|
|
@ -22,19 +22,20 @@
|
|||
|
||||
class FetchCurrentFrames {
|
||||
public:
|
||||
using Outputs = render::VaryingSet4<LightStage::FramePointer, BackgroundStage::FramePointer, HazeStage::FramePointer, BloomStage::FramePointer>;
|
||||
using JobModel = render::Job::ModelO<FetchCurrentFrames, Outputs>;
|
||||
using Output = render::VaryingSet4<LightStage::FramePointer, BackgroundStage::FramePointer, HazeStage::FramePointer, BloomStage::FramePointer>;
|
||||
using JobModel = render::Job::ModelO<FetchCurrentFrames, Output>;
|
||||
|
||||
FetchCurrentFrames() {}
|
||||
|
||||
void run(const render::RenderContextPointer& renderContext, Outputs& outputs);
|
||||
void run(const render::RenderContextPointer& renderContext, Output& output);
|
||||
};
|
||||
|
||||
class AssembleLightingStageTask {
|
||||
public:
|
||||
using Inputs = RenderFetchCullSortTask::BucketList;
|
||||
using Outputs = render::VaryingSet2<FetchCurrentFrames::Outputs, ZoneRendererTask::Outputs>;
|
||||
using JobModel = render::Task::ModelIO<FetchCurrentFrames, Inputs, Outputs>;
|
||||
// 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>;
|
||||
|
||||
AssembleLightingStageTask() {}
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ public:
|
|||
class RenderDeferredTaskDebug {
|
||||
public:
|
||||
using Input = render::VaryingSet9<RenderFetchCullSortTask::Output, RenderShadowTask::Output,
|
||||
ZoneRendererTask::Outputs, SelectItems::Outputs, FetchCurrentFrames::Outputs,
|
||||
ZoneRendererTask::Output, SelectItems::Outputs, FetchCurrentFrames::Output,
|
||||
PrepareDeferred::Outputs, GenerateDeferredFrameTransform::Output, JitterSample::Output, LightingModel>;
|
||||
// using Config = RenderDeferredTaskConfig;
|
||||
using JobModel = render::Task::ModelI<RenderDeferredTaskDebug, Input>;
|
||||
|
@ -152,11 +152,12 @@ void RenderDeferredTask::build(JobModel& task, const render::Varying& input, ren
|
|||
const auto& spatialSelection = fetchedItems[1];
|
||||
|
||||
// Extract the Lighting Stages Current frame ( and zones)
|
||||
const auto& lightingStageInputs = inputs[1];
|
||||
//const auto lightingStageInputs = inputs[1];
|
||||
const auto lightingStageInputs = input[1];
|
||||
// Fetch the current frame stacks from all the stages
|
||||
const auto& currentStageFrames = lightingStageInputs[0];
|
||||
const auto& lightFrame = currentStageFrames[0];
|
||||
const auto& backgroundFrame = currentStageFrames[1];
|
||||
const auto currentStageFrames = lightingStageInputs[0];
|
||||
const auto lightFrame = currentStageFrames[0];
|
||||
const auto backgroundFrame = currentStageFrames[1];
|
||||
const auto& hazeFrame = currentStageFrames[2];
|
||||
const auto& bloomFrame = currentStageFrames[3];
|
||||
|
||||
|
|
|
@ -137,14 +137,14 @@ signals:
|
|||
|
||||
class RenderDeferredTask {
|
||||
public:
|
||||
using Input = render::VaryingSet3<RenderFetchCullSortTask::Output, AssembleLightingStageTask::Outputs, RenderShadowTask::Output>;
|
||||
using Input = render::VaryingSet3<RenderFetchCullSortTask::Output, AssembleLightingStageTask::Output, RenderShadowTask::Output>;
|
||||
using Config = RenderDeferredTaskConfig;
|
||||
using JobModel = render::Task::ModelI<RenderDeferredTask, Input, Config>;
|
||||
|
||||
RenderDeferredTask();
|
||||
|
||||
void configure(const Config& config);
|
||||
void build(JobModel& task, const render::Varying& inputs, render::Varying& outputs, bool renderShadows);
|
||||
void build(JobModel& task, const render::Varying& input, render::Varying& output, bool renderShadows);
|
||||
|
||||
private:
|
||||
static const render::Varying addSelectItemJobs(JobModel& task,
|
||||
|
|
|
@ -19,12 +19,12 @@
|
|||
|
||||
class RenderForwardTask {
|
||||
public:
|
||||
using Input = render::VaryingSet2<RenderFetchCullSortTask::Output, AssembleLightingStageTask::Outputs>;
|
||||
using Input = render::VaryingSet2<RenderFetchCullSortTask::Output, AssembleLightingStageTask::Output>;
|
||||
using JobModel = render::Task::ModelI<RenderForwardTask, Input>;
|
||||
|
||||
RenderForwardTask() {}
|
||||
|
||||
void build(JobModel& task, const render::Varying& inputs, render::Varying& outputs);
|
||||
void build(JobModel& task, const render::Varying& input, render::Varying& output);
|
||||
};
|
||||
|
||||
class PrepareFramebuffer {
|
||||
|
|
|
@ -59,7 +59,7 @@ void RenderShadowTask::build(JobModel& task, const render::Varying& input, rende
|
|||
// FIXME: calling this here before the zones/lights are drawn during the deferred/forward passes means we're actually using the frames from the previous draw
|
||||
// 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 lightFrame = currentFrames.getN<FetchCurrentFrames::Output>(0);
|
||||
|
||||
const auto setupOutput = task.addJob<RenderShadowSetup>("ShadowSetup", lightFrame);
|
||||
const auto queryResolution = setupOutput.getN<RenderShadowSetup::Outputs>(1);
|
||||
|
|
|
@ -21,8 +21,8 @@ void RenderViewTask::build(JobModel& task, const render::Varying& input, render:
|
|||
const auto items = task.addJob<RenderFetchCullSortTask>("FetchCullSort", cullFunctor, tagBits, tagMask);
|
||||
assert(items.canCast<RenderFetchCullSortTask::Output>());
|
||||
|
||||
|
||||
const auto lightingStageFramesAndZones = task.addJob<AssembleLightingStageTask>("AssembleStages", items[0]);
|
||||
// const auto lightingStageFramesAndZones = task.addJob<AssembleLightingStageTask>("AssembleStages", items[0]);
|
||||
const auto lightingStageFramesAndZones = task.addJob<AssembleLightingStageTask>("AssembleStages", items);
|
||||
|
||||
if (isDeferred) {
|
||||
// Warning : the cull functor passed to the shadow pass should only be testing for LOD culling. If frustum culling
|
||||
|
@ -31,7 +31,8 @@ void RenderViewTask::build(JobModel& task, const render::Varying& input, render:
|
|||
const auto renderInput = RenderDeferredTask::Input(items, lightingStageFramesAndZones, cascadeSceneBBoxes).asVarying();
|
||||
task.addJob<RenderDeferredTask>("RenderDeferredTask", renderInput, true);
|
||||
} else {
|
||||
task.addJob<RenderForwardTask>("Forward", items, lightingStageFramesAndZones);
|
||||
const auto renderInput = RenderForwardTask::Input(items, lightingStageFramesAndZones).asVarying();
|
||||
task.addJob<RenderForwardTask>("Forward", renderInput);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ void ZoneRendererTask::build(JobModel& task, const Varying& input, Varying& outp
|
|||
output = zoneItems;
|
||||
}
|
||||
|
||||
void SetupZones::run(const RenderContextPointer& context, const Inputs& inputs) {
|
||||
void SetupZones::run(const RenderContextPointer& context, const Input& input) {
|
||||
// Grab light, background, haze, and bloom stages and clear them
|
||||
auto lightStage = context->_scene->getStage<LightStage>();
|
||||
assert(lightStage);
|
||||
|
@ -70,7 +70,7 @@ void SetupZones::run(const RenderContextPointer& context, const Inputs& inputs)
|
|||
bloomStage->_currentFrame.clear();
|
||||
|
||||
// call render over the zones to grab their components in the correct order first...
|
||||
render::renderItems(context, inputs);
|
||||
render::renderItems(context, input);
|
||||
|
||||
// Finally add the default lights and background:
|
||||
lightStage->_currentFrame.pushSunLight(lightStage->getDefaultLight());
|
||||
|
|
|
@ -21,12 +21,12 @@
|
|||
|
||||
class SetupZones {
|
||||
public:
|
||||
using Inputs = render::ItemBounds;
|
||||
using JobModel = render::Job::ModelI<SetupZones, Inputs>;
|
||||
using Input = render::ItemBounds;
|
||||
using JobModel = render::Job::ModelI<SetupZones, Input>;
|
||||
|
||||
SetupZones() {}
|
||||
|
||||
void run(const render::RenderContextPointer& context, const Inputs& inputs);
|
||||
void run(const render::RenderContextPointer& context, const Input& input);
|
||||
};
|
||||
|
||||
class ZoneRendererConfig : public render::Task::Config {
|
||||
|
@ -51,14 +51,14 @@ public:
|
|||
static const render::Selection::Name ZONES_SELECTION;
|
||||
|
||||
|
||||
using Inputs = render::ItemBounds;
|
||||
using Outputs = render::ItemBounds;
|
||||
using Input = render::ItemBounds;
|
||||
using Output = render::ItemBounds;
|
||||
using Config = ZoneRendererConfig;
|
||||
using JobModel = render::Task::ModelIO<ZoneRendererTask, Inputs, Outputs, Config>;
|
||||
using JobModel = render::Task::ModelIO<ZoneRendererTask, Input, Output, Config>;
|
||||
|
||||
ZoneRendererTask() {}
|
||||
|
||||
void build(JobModel& task, const render::Varying& inputs, render::Varying& output);
|
||||
void build(JobModel& task, const render::Varying& input, render::Varying& output);
|
||||
|
||||
void configure(const Config& config) { _maxDrawn = config.maxDrawn; }
|
||||
|
||||
|
|
Loading…
Reference in a new issue