API Documentation
Loading...
Searching...
No Matches
GLESRenderObject.h
Go to the documentation of this file.
1#pragma once
10class QOpenGLVertexArrayObject;
11namespace NDEVR
12{
13 class Camera;
14 class GLESVertexManager;
15 class GLESMaterialManager;
16
18 {
19 protected:
41
42 public:
44 GLESRenderObject(const GLESRenderObject& instance);
46 void cleanup();
47 bool shouldRender(const GraphicsUpdateArguments& args, const Model& model) const;
51 bool hasOpacity() const;
52 bool hasImage() const;
53 fltp04 fadeDistance() const;
54 uint01 parity() const { return m_parity; }
55 static GLint RenderType(PrimitiveMode mode);
57
58 //void resetPool() { m_descriptor_pool = nullptr; }
59 bool hasCommand() const;
61 bool isFilledShape() const;
62
63 void setPrimitiveMode(const PrimitiveMode& type) { m_index_mode = type; }
64 void setIndexProperty(const PrimitiveProperty& property) { m_index_property = property; }
65 void setVertexManager(const DynamicPointer<GLESVertexManager>& vertex_manager);
66 void setMaterialManager(const DynamicPointer<GLESMaterialManager>& material_manager);
68 const ConstPointer<GLESVertexManager>& vertexManager() const { return m_vertex_manager; }
69 PrimitiveMode indexMode() const { return m_index_mode; };
70 PrimitiveProperty indexProperty() const { return m_index_property; };
71 void addInstance(const Geometry& geo, const Model& parent, const Material& material);
72 void clearInstances();
73 private:
74 void processGeoUniformUpdates(GeoProperties& properties, GraphicsUpdateArguments& args, uint04& matrix_index, const Time& geo_mod_time);
75 void getMatrixUniformObject(Buffer<Matrix<fltp04>>& matrix, Buffer<Vector<3, sint04>>& offset, Buffer<Vector<2, uint04>>& flags) const;
76 void getMatrixUniformObject(const Geometry& mesh, const Model& model, Matrix<fltp04>& matrix, Vector<3, sint04>& offset, Vector<2, uint04>& flag) const;
77 private:
78 PrimitiveProperty m_index_property;
80 GeoProperties m_geometry;
81 //ExtraPropertySettings m_extra_settings;
82
83 //DynamicPointer<VulkanBuffer> m_bitf_uniform_buffer;
84 DynamicPointer<GLESVertexManager> m_vertex_manager;
85 DynamicPointer<GLESMaterialManager> m_material_manager;
86 Buffer<Matrix<fltp04>> m_model_matrix_uniforms;
87 Buffer<Vector<3, sint04>> m_model_offset_uniforms;
88 Buffer<Vector<2, uint04>> m_model_flag_uniforms;
89 DynamicPointer<OpenGLBuffer> m_matrix_instance_buffer;
90 DynamicPointer<OpenGLBuffer> m_offset_instance_buffer;
91 DynamicPointer<OpenGLBuffer> m_flags_instance_buffer;
92
94 //VkDescriptorPool_T* m_descriptor_pool;
95 //VkDescriptorSet_T* m_descriptor_set;
97 Time m_last_updated_time = Time(0);
98 volatile mutable bool m_needs_matrix_commit = false;
99 //volatile mutable bool m_needs_bitf_commit;
100 uint01 m_parity = Constant<uint01>::NaN;
101 bool m_is_integer_shader = false;
102 };
103}
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:59
Provides a constant, unmodifiable pointer that has shared ownership of a dynamically allocated object...
Definition GraphicsPipeline.h:42
Provides a modifiable pointer that has shared ownership of a dynamically allocated object.
Definition Pointer.hpp:319
Definition GLESRenderObject.h:18
void setVertexManager(const DynamicPointer< GLESVertexManager > &vertex_manager)
Definition GLESRenderObject.cpp:629
bool hasOpacity() const
Definition GLESRenderObject.cpp:547
bool hasImage() const
Definition GLESRenderObject.cpp:552
const ConstPointer< GLESVertexManager > & vertexManager() const
Definition GLESRenderObject.h:68
PrimitiveMode indexMode() const
Definition GLESRenderObject.h:69
void clearInstances()
Definition GLESRenderObject.cpp:379
uint01 parity() const
Definition GLESRenderObject.h:54
bool isFilledShape() const
Definition GLESRenderObject.cpp:458
void cleanup()
Definition GLESRenderObject.cpp:343
GLESRenderObject(const DynamicPointer< GLESGraphicsDevice > &pipeline)
Definition GLESRenderObject.cpp:15
fltp04 fadeDistance() const
Definition GLESRenderObject.cpp:557
void commit(GraphicsUpdateArguments &args)
Definition GLESRenderObject.cpp:249
void setDevice(const DynamicPointer< GLESGraphicsDevice > &instance)
Definition GLESRenderObject.cpp:142
void setPrimitiveMode(const PrimitiveMode &type)
Definition GLESRenderObject.h:63
static GLint RenderType(PrimitiveMode mode)
Definition GLESRenderObject.cpp:562
void addInstance(const Geometry &geo, const Model &parent, const Material &material)
Definition GLESRenderObject.cpp:366
~GLESRenderObject()
Definition GLESRenderObject.cpp:44
PrimitiveProperty indexProperty() const
Definition GLESRenderObject.h:70
void setMaterialManager(const DynamicPointer< GLESMaterialManager > &material_manager)
Definition GLESRenderObject.cpp:634
bool runCommand(GraphicsUpdateArguments &args)
Definition GLESRenderObject.cpp:394
void updateUniformBuffer(GraphicsUpdateArguments &args)
Definition GLESRenderObject.cpp:148
bool hasCommand() const
Definition GLESRenderObject.cpp:386
bool shouldRender(const GraphicsUpdateArguments &args, const Model &model) const
Definition GLESRenderObject.cpp:356
bool createPipeline(GraphicsUpdateArguments &args)
Definition GLESRenderObject.cpp:578
void setIndexProperty(const PrimitiveProperty &property)
Definition GLESRenderObject.h:64
void setParity(uint01 parity)
Definition GLESRenderObject.cpp:639
A core class within the model heirarchy containing data (Usually 3D data) within a set container.
Definition Geometry.h:54
Definition GraphicsUpdateArguments.h:40
Definition Material.h:45
Definition Matrix.hpp:176
Definition Model.h:54
Represents a timestamp with utilities for manipulation and conversion.
Definition Time.h:54
A fixed-size array with better performance compared to dynamic containers.
Definition Vector.hpp:60
Definition ACIColor.h:37
PrimitiveProperty
Definition DesignObjectBase.h:44
float fltp04
Defines an alias representing a 4 byte floating-point number.
Definition BaseValues.hpp:152
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:93
PrimitiveMode
Definition DesignObjectBase.h:113
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:115
QAction * mesh(nullptr)
Definition BaseValues.hpp:267
Definition GLESRenderObject.h:31
bool is_visible
Definition GLESRenderObject.h:39
fltp04 pixel_thickness
Definition GLESRenderObject.h:34
uint04 vertex_start
Definition GLESRenderObject.h:35
Geometry geometry
Definition GLESRenderObject.h:33
uint04 vertex_size
Definition GLESRenderObject.h:36
uint04 index_start
Definition GLESRenderObject.h:37
uint04 index_size
Definition GLESRenderObject.h:38
Buffer< ModelProperties > model_parents
Definition GLESRenderObject.h:32
Definition GLESRenderObject.h:21
bool should_render
Definition GLESRenderObject.h:28
Material material
Definition GLESRenderObject.h:27
Model model
Definition GLESRenderObject.h:26
ModelProperties(const Model &model, const Material &material)
Definition GLESRenderObject.h:22