13 #ifndef hifi_render_DrawTask_h
14 #define hifi_render_DrawTask_h
20 void renderItems(
const RenderContextPointer& renderContext,
const ItemBounds& inItems,
int maxDrawnItems = -1);
21 void renderShapes(
const RenderContextPointer& renderContext,
const ShapePlumberPointer& shapeContext,
const ItemBounds& inItems,
int maxDrawnItems = -1,
const ShapeKey& globalKey = ShapeKey());
22 void renderStateSortShapes(
const RenderContextPointer& renderContext,
const ShapePlumberPointer& shapeContext,
const ItemBounds& inItems,
int maxDrawnItems = -1,
const ShapeKey& globalKey = ShapeKey());
24 class DrawLightConfig :
public Job::Config {
26 Q_PROPERTY(
int numDrawn READ getNumDrawn NOTIFY numDrawnChanged)
27 Q_PROPERTY(
int maxDrawn MEMBER maxDrawn NOTIFY dirty)
29 int getNumDrawn() {
return numDrawn; }
30 void setNumDrawn(
int num) { numDrawn = num; emit numDrawnChanged(); }
34 void numDrawnChanged();
43 using Config = DrawLightConfig;
44 using JobModel = Job::ModelI<DrawLight, ItemBounds, Config>;
46 void configure(
const Config& config) { _maxDrawn = config.maxDrawn; }
47 void run(
const RenderContextPointer& renderContext,
const ItemBounds& inLights);
54 class Config :
public render::JobConfig {
56 Config(
bool enabled =
false) : JobConfig(enabled) {}
59 using Inputs = render::ItemBounds;
60 using JobModel = render::Job::ModelI<DrawBounds, Inputs, Config>;
62 DrawBounds(uint transformSlot) : _transformSlot(transformSlot) {}
64 void configure(
const Config& configuration) {}
65 void run(
const render::RenderContextPointer& renderContext,
69 static const gpu::PipelinePointer getPipeline();
70 static gpu::PipelinePointer _boundsPipeline;
71 gpu::BufferPointer _drawBuffer;
72 gpu::BufferPointer _paramsBuffer;
76 class DrawQuadVolumeConfig :
public render::JobConfig {
78 Q_PROPERTY(
bool isFrozen MEMBER isFrozen NOTIFY dirty)
81 DrawQuadVolumeConfig(
bool enabled =
false) : JobConfig(enabled) {}
83 bool isFrozen{
false };
89 class DrawQuadVolume {
92 using Config = DrawQuadVolumeConfig;
94 void configure(
const Config& configuration);
97 DrawQuadVolume(
const glm::vec3& color);
99 void run(
const render::RenderContextPointer& renderContext,
const glm::vec3 vertices[8],
100 const gpu::BufferView& indices,
int indexCount);
102 gpu::BufferView _meshVertices;
103 gpu::BufferPointer _params;
104 bool _isUpdateEnabled{
true };
106 static gpu::Stream::FormatPointer _format;
108 static gpu::PipelinePointer getPipeline();
111 class DrawAABox :
public DrawQuadVolume {
113 using Inputs = AABox;
114 using JobModel = render::Job::ModelI<DrawAABox, Inputs, Config>;
116 DrawAABox(
const glm::vec3& color = glm::vec3(1.0f, 1.0f, 1.0f));
118 void run(
const render::RenderContextPointer& renderContext,
const Inputs& box);
122 static gpu::BufferView _cubeMeshIndices;
124 static void getVertices(
const AABox& box, glm::vec3 vertices[8]);
127 class DrawFrustum :
public DrawQuadVolume {
129 using Input = ViewFrustumPointer;
130 using JobModel = render::Job::ModelI<DrawFrustum, Input, Config>;
132 DrawFrustum(
const glm::vec3& color = glm::vec3(1.0f, 1.0f, 1.0f));
134 void run(
const render::RenderContextPointer& renderContext,
const Input& input);
138 static gpu::BufferView _frustumMeshIndices;
140 static void getVertices(
const ViewFrustum& frustum, glm::vec3 vertices[8]);