This commit is contained in:
Zach Pomerantz 2016-01-22 14:18:59 -08:00
parent 75cddec647
commit 5698be5435
4 changed files with 26 additions and 9 deletions

View file

@ -11,13 +11,20 @@
#include <render/DrawTask.h>
class HitEffectConfig : public render::Job::Config {
Q_OBJECT
public:
HitEffectConfig() : render::Job::Config(false) {}
};
class HitEffect {
public:
using Config = HitEffectConfig;
using JobModel = render::Job::Model<HitEffect, Config>;
HitEffect();
void configure(const Config&) {}
void run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext);
using JobModel = render::Job::Model<HitEffect>;
const gpu::PipelinePointer& getHitEffectPipeline();

View file

@ -69,7 +69,7 @@ void RenderDeferred::run(const SceneContextPointer& sceneContext, const RenderCo
void ToneMappingDeferred::configure(const Config& configuration) {
if (configuration.exposure >= 0) {
_toneMappingEffect.setExposure(configuration.curve);
_toneMappingEffect.setExposure(configuration.exposure);
}
if (configuration.curve >= 0) {
_toneMappingEffect.setToneCurve((ToneMappingEffect::ToneCurve)configuration.curve);
@ -197,8 +197,6 @@ void RenderDeferredTask::run(const SceneContextPointer& sceneContext, const Rend
}
setAntialiasingStatus(renderContext->getFxaaStatus());
setToneMappingExposure(renderContext->getTone().exposure);
setToneMappingToneCurve(renderContext->getTone().toneCurve);
// TODO: Allow runtime manipulation of culling ShouldRenderFunctor
// TODO: For now, lighting is controlled through a singleton, so it is distinct

View file

@ -19,13 +19,22 @@
class ViewFrustum;
class RenderShadowMapConfig : public render::Job::Config {
Q_OBJECT
public:
RenderShadowMapConfig() : render::Job::Config(false) {}
};
class RenderShadowMap {
public:
using Config = RenderShadowMapConfig;
using JobModel = render::Job::ModelI<RenderShadowMap, render::ShapesIDsBounds, Config>;
RenderShadowMap(render::ShapePlumberPointer shapePlumber) : _shapePlumber{ shapePlumber } {}
void configure(const Config&) {}
void run(const render::SceneContextPointer& sceneContext, const render::RenderContextPointer& renderContext,
const render::ShapesIDsBounds& inShapes);
using JobModel = render::Job::ModelI<RenderShadowMap, render::ShapesIDsBounds>;
protected:
render::ShapePlumberPointer _shapePlumber;
};

View file

@ -154,7 +154,8 @@ public:
}
void run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext) {
if (isEnabled()) {
std::shared_ptr<Job::Config>& config = std::static_pointer_cast<Job::Config>(_config);
if (config->alwaysEnabled || config->enabled) {
jobRunI(_data, sceneContext, renderContext, _input.get<I>());
}
}
@ -179,7 +180,8 @@ public:
}
void run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext) {
if (isEnabled()) {
std::shared_ptr<Job::Config>& config = std::static_pointer_cast<Job::Config>(_config);
if (config->alwaysEnabled || config->enabled) {
jobRunO(_data, sceneContext, renderContext, _output.edit<O>());
}
}
@ -207,7 +209,8 @@ public:
}
void run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext) {
if (isEnabled()) {
std::shared_ptr<Job::Config>& config = std::static_pointer_cast<Job::Config>(_config);
if (config->alwaysEnabled || config->enabled) {
jobRunIO(_data, sceneContext, renderContext, _input.get<I>(), _output.edit<O>());
}
}