13 #ifndef hifi_RenderForwardTask_h
14 #define hifi_RenderForwardTask_h
16 #include <gpu/Pipeline.h>
17 #include <render/RenderFetchCullSortTask.h>
18 #include "AssembleLightingStageTask.h"
19 #include "DeferredFrameTransform.h"
20 #include "LightClusters.h"
21 #include "LightingModel.h"
23 class RenderForwardTaskConfig :
public render::Task::Config {
25 Q_PROPERTY(
float resolutionScale MEMBER resolutionScale NOTIFY dirty)
27 float resolutionScale{ 1.f };
33 class RenderForwardTask {
35 using Input = render::VaryingSet3<RenderFetchCullSortTask::Output, LightingModelPointer, AssembleLightingStageTask::Output>;
36 using Config = RenderForwardTaskConfig;
37 using JobModel = render::Task::ModelI<RenderForwardTask, Input, Config>;
39 RenderForwardTask() {}
41 void configure(
const Config& config);
42 void build(JobModel& task,
const render::Varying& input, render::Varying& output, render::CullFunctor cullFunctor, uint transformOffset,
size_t depth);
46 class PreparePrimaryFramebufferMSAAConfig :
public render::Job::Config {
48 Q_PROPERTY(
float resolutionScale WRITE setResolutionScale READ getResolutionScale NOTIFY dirty)
49 Q_PROPERTY(
int numSamples WRITE setNumSamples READ getNumSamples NOTIFY dirty)
51 float getResolutionScale()
const {
return resolutionScale; }
52 void setResolutionScale(
float scale);
54 int getNumSamples()
const {
return numSamples; }
55 void setNumSamples(
int num);
61 float resolutionScale{ 1.0f };
65 class PreparePrimaryFramebufferMSAA {
67 using Output = gpu::FramebufferPointer;
68 using Config = PreparePrimaryFramebufferMSAAConfig;
69 using JobModel = render::Job::ModelO<PreparePrimaryFramebufferMSAA, Output, Config>;
71 void configure(
const Config& config);
72 void run(
const render::RenderContextPointer& renderContext,
73 gpu::FramebufferPointer& framebuffer);
76 gpu::FramebufferPointer _framebuffer;
77 float _resolutionScale{ 1.0f };
80 static gpu::FramebufferPointer createFramebuffer(
const char* name,
const glm::uvec2& frameSize,
int numSamples);
83 class PrepareForward {
85 using Inputs = render::VaryingSet2 <gpu::FramebufferPointer, LightStage::FramePointer>;
86 using JobModel = render::Job::ModelI<PrepareForward, Inputs>;
88 void run(
const render::RenderContextPointer& renderContext,
89 const Inputs& inputs);
96 using Inputs = render::VaryingSet5<render::ItemBounds, LightingModelPointer, HazeStage::FramePointer, LightClustersPointer, DeferredFrameTransformPointer>;
97 using JobModel = render::Job::ModelI<DrawForward, Inputs>;
99 DrawForward(
const render::ShapePlumberPointer& shapePlumber,
bool opaquePass, uint transformSlot) :
100 _shapePlumber(shapePlumber), _opaquePass(opaquePass), _transformSlot(transformSlot) {}
101 void run(
const render::RenderContextPointer& renderContext,
102 const Inputs& inputs);
105 render::ShapePlumberPointer _shapePlumber;