12 #ifndef hifi_RenderForwardTask_h
13 #define hifi_RenderForwardTask_h
15 #include <gpu/Pipeline.h>
16 #include <render/RenderFetchCullSortTask.h>
17 #include "AssembleLightingStageTask.h"
18 #include "LightingModel.h"
20 class RenderForwardTaskConfig :
public render::Task::Config {
22 Q_PROPERTY(
float resolutionScale MEMBER resolutionScale NOTIFY dirty)
24 float resolutionScale{ 1.f };
30 class RenderForwardTask {
32 using Input = render::VaryingSet3<RenderFetchCullSortTask::Output, LightingModelPointer, AssembleLightingStageTask::Output>;
33 using Config = RenderForwardTaskConfig;
34 using JobModel = render::Task::ModelI<RenderForwardTask, Input, Config>;
36 RenderForwardTask() {}
38 void configure(
const Config& config);
39 void build(JobModel& task,
const render::Varying& input, render::Varying& output);
43 class PreparePrimaryFramebufferMSAAConfig :
public render::Job::Config {
45 Q_PROPERTY(
float resolutionScale WRITE setResolutionScale READ getResolutionScale NOTIFY dirty)
46 Q_PROPERTY(
int numSamples WRITE setNumSamples READ getNumSamples NOTIFY dirty)
48 float getResolutionScale()
const {
return resolutionScale; }
49 void setResolutionScale(
float scale);
51 int getNumSamples()
const {
return numSamples; }
52 void setNumSamples(
int num);
58 float resolutionScale{ 1.0f };
62 class PreparePrimaryFramebufferMSAA {
64 using Output = gpu::FramebufferPointer;
65 using Config = PreparePrimaryFramebufferMSAAConfig;
66 using JobModel = render::Job::ModelO<PreparePrimaryFramebufferMSAA, Output, Config>;
68 void configure(
const Config& config);
69 void run(
const render::RenderContextPointer& renderContext,
70 gpu::FramebufferPointer& framebuffer);
73 gpu::FramebufferPointer _framebuffer;
74 float _resolutionScale{ 1.0f };
77 static gpu::FramebufferPointer createFramebuffer(
const char* name,
const glm::uvec2& frameSize,
int numSamples);
80 class PrepareForward {
82 using Inputs = render::VaryingSet2 <gpu::FramebufferPointer, LightStage::FramePointer>;
83 using JobModel = render::Job::ModelI<PrepareForward, Inputs>;
85 void run(
const render::RenderContextPointer& renderContext,
86 const Inputs& inputs);
93 using Inputs = render::VaryingSet3<render::ItemBounds, LightingModelPointer, HazeStage::FramePointer>;
94 using JobModel = render::Job::ModelI<DrawForward, Inputs>;
96 DrawForward(
const render::ShapePlumberPointer& shapePlumber,
bool opaquePass) : _shapePlumber(shapePlumber), _opaquePass(opaquePass) {}
97 void run(
const render::RenderContextPointer& renderContext,
98 const Inputs& inputs);
101 render::ShapePlumberPointer _shapePlumber;