12 #ifndef hifi_render_DrawTask_h
13 #define hifi_render_DrawTask_h
19 void renderItems(
const RenderContextPointer& renderContext,
const ItemBounds& inItems,
int maxDrawnItems = -1);
20 void renderShapes(
const RenderContextPointer& renderContext,
const ShapePlumberPointer& shapeContext,
const ItemBounds& inItems,
int maxDrawnItems = -1,
const ShapeKey& globalKey = ShapeKey());
21 void renderStateSortShapes(
const RenderContextPointer& renderContext,
const ShapePlumberPointer& shapeContext,
const ItemBounds& inItems,
int maxDrawnItems = -1,
const ShapeKey& globalKey = ShapeKey());
23 class DrawLightConfig :
public Job::Config {
25 Q_PROPERTY(
int numDrawn READ getNumDrawn NOTIFY numDrawnChanged)
26 Q_PROPERTY(
int maxDrawn MEMBER maxDrawn NOTIFY dirty)
28 int getNumDrawn() {
return numDrawn; }
29 void setNumDrawn(
int num) { numDrawn = num; emit numDrawnChanged(); }
33 void numDrawnChanged();
42 using Config = DrawLightConfig;
43 using JobModel = Job::ModelI<DrawLight, ItemBounds, Config>;
45 void configure(
const Config& config) { _maxDrawn = config.maxDrawn; }
46 void run(
const RenderContextPointer& renderContext,
const ItemBounds& inLights);
53 class Config :
public render::JobConfig {
55 Config(
bool enabled =
false) : JobConfig(enabled) {}
58 using Inputs = render::ItemBounds;
59 using JobModel = render::Job::ModelI<DrawBounds, Inputs, Config>;
61 void configure(
const Config& configuration) {}
62 void run(
const render::RenderContextPointer& renderContext,
66 const gpu::PipelinePointer getPipeline();
67 gpu::PipelinePointer _boundsPipeline;
68 gpu::BufferPointer _drawBuffer;
69 gpu::BufferPointer _paramsBuffer;
72 class DrawQuadVolumeConfig :
public render::JobConfig {
74 Q_PROPERTY(
bool isFrozen MEMBER isFrozen NOTIFY dirty)
77 DrawQuadVolumeConfig(
bool enabled =
false) : JobConfig(enabled) {}
79 bool isFrozen{
false };
85 class DrawQuadVolume {
88 using Config = DrawQuadVolumeConfig;
90 void configure(
const Config& configuration);
93 DrawQuadVolume(
const glm::vec3& color);
95 void run(
const render::RenderContextPointer& renderContext,
const glm::vec3 vertices[8],
96 const gpu::BufferView& indices,
int indexCount);
98 gpu::BufferView _meshVertices;
99 gpu::BufferPointer _params;
100 bool _isUpdateEnabled{
true };
102 static gpu::Stream::FormatPointer _format;
104 static gpu::PipelinePointer getPipeline();
107 class DrawAABox :
public DrawQuadVolume {
109 using Inputs = AABox;
110 using JobModel = render::Job::ModelI<DrawAABox, Inputs, Config>;
112 DrawAABox(
const glm::vec3& color = glm::vec3(1.0f, 1.0f, 1.0f));
114 void run(
const render::RenderContextPointer& renderContext,
const Inputs& box);
118 static gpu::BufferView _cubeMeshIndices;
120 static void getVertices(
const AABox& box, glm::vec3 vertices[8]);
123 class DrawFrustum :
public DrawQuadVolume {
125 using Input = ViewFrustumPointer;
126 using JobModel = render::Job::ModelI<DrawFrustum, Input, Config>;
128 DrawFrustum(
const glm::vec3& color = glm::vec3(1.0f, 1.0f, 1.0f));
130 void run(
const render::RenderContextPointer& renderContext,
const Input& input);
134 static gpu::BufferView _frustumMeshIndices;
136 static void getVertices(
const ViewFrustum& frustum, glm::vec3 vertices[8]);