35#include "GLESShader.h"
36#include "GLESGraphicsDevice.h"
38#include <NDEVR/Model.h>
39#include <NDEVR/Material.h>
248 Time m_last_updated_time;
250 Time m_last_push_update_time;
261 QOpenGLTexture* m_texture =
nullptr;
263 mutable bool m_needs_to_commit_frag_buffer =
true;
264 mutable bool m_needs_to_commit_vert_buffer =
true;
265 bool m_needs_pipeline_update =
true;
266 bool m_has_opacity =
false;
267 bool m_has_image =
false;
268 bool m_uses_color_channel =
false;
269 bool m_has_image_opacity =
false;
270 bool m_is_two_sided =
false;
271 bool m_override_camera =
false;
272 bool m_smooth_normals =
false;
273 bool m_is_wireframe =
false;
274 bool m_has_grid =
false;
275 bool m_use_normal_for_texture =
false;
276 bool m_use_model_color =
false;
277 bool m_use_layer_color =
false;
278 bool m_ignore_depth =
false;
279 bool m_write_to_depth =
true;
The equivelent of std::vector but with a bit more control.
Provides a constant, unmodifiable pointer that has shared ownership of a dynamically allocated object...
Provides a modifiable pointer that has shared ownership of a dynamically allocated object.
bool useLighting() const
Checks whether lighting is enabled for the material.
void setUniformVariables(GLESShader *shader)
Pushes uniform values to the given shader.
void updateShader(const Material &mat, const GraphicsUpdateArguments &args, DynamicPointer< GLESShaderManager > &shader_manager)
Updates the shader for the given material if needed.
GLESMaterialManager(const DynamicPointer< GLESGraphicsDevice > &device)
Constructs a GLESMaterialManager for the given device.
bool overrideCamera() const
Checks whether the material overrides the camera projection.
void cleanup()
Releases all GPU resources held by this manager.
GLESVertexUniformObject getVertexUniformObject(const Material &material) const
Builds a vertex uniform object from the given material.
bool isTwoSided() const
Checks whether the material is two-sided.
void clearMaterials()
Removes all materials from this manager.
FragUniformObject getFragUniformObject(const Material &material) const
Builds a fragment uniform object from the given material.
bool isWireframe() const
Checks whether the material renders as wireframe.
bool hasGrid() const
Checks whether any material uses grid rendering.
~GLESMaterialManager()
Destroys the material manager and releases GPU resources.
bool ignoreDepth() const
Checks whether depth testing should be ignored.
uint08 id() const
Returns a unique identifier for this material manager instance.
GLESShader * getShader(GLESShader::Definition &definition) const
Returns the shader matching the given definition, creating if needed.
StringView getColorByChannel(GraphicsUpdateArguments &args) const
Returns the name of the color-by channel for the current material.
void commit()
Commits pending uniform buffer changes to the GPU.
void updateImages(const Material &material, GraphicsUpdateArguments &args, DynamicPointer< GLESImageManager > &manager)
Updates GPU textures for the given material.
bool smoothNormals() const
Checks whether smooth normal interpolation is enabled.
static uint08 MaterialID(const Material &material)
Computes a unique identifier for the given material.
Time lastDependencyUpdate() const
Returns the last time material dependencies were pushed to GPU.
bool needsToUpdateShader(const Material &material)
Checks whether the material's shader needs recompilation.
void createPipeline(GraphicsUpdateArguments &args, DynamicPointer< GLESShaderManager > &shader_manager, DynamicPointer< GLESImageManager > &manager)
Creates or recreates the rendering pipeline for the current materials.
void checkImages()
Checks whether any image textures need re-uploading.
uint04 getLayerNumber(const Material &material) const
Returns the layer number for the given material.
bool needsToUpdateImage(const Material &material)
Checks whether the material's image textures need updating.
void addMaterial(const Material &material)
Adds a material to this manager's material list.
uint04 getNumberOfImages(const GraphicsUpdateArguments &args) const
Returns the number of active texture images.
bool usesModelColor() const
Checks whether model color overrides material color.
fltp04 fadeDistance() const
Returns the distance at which objects begin to fade.
UUID material() const
Returns the UUID of the primary material managed by this instance.
fltp04 depthBias() const
Returns the depth bias offset.
bool useNormalForTexture() const
Checks whether normals are used for texture coordinate generation.
StringView getExtraPropertyChannel() const
Returns the extra property channel name.
void updateUniformBuffer(GraphicsUpdateArguments &args)
Updates uniform buffers from the current material state.
const GLESVertexUniformObject & vertexUniform() const
Returns the current vertex uniform object.
bool hasOpacity() const
Checks whether any material has opacity.
bool writeToDepth() const
Checks whether depth writing is enabled.
bool hasImage() const
Checks whether any material has a texture image.
bool usesLayerColor() const
Checks whether layer color overrides material color.
A Shader for rendering default OpenGL logic to the graphics card.
Options that are used for performing an update on a Graphics Engine call.
Container responsible for storing and setting the appearance of a Model or Geometry within the NDEVR ...
ShadingModel
Enumerates the available shading models for material rendering.
UVMode
Defines UV mapping modes that control how texture colors are determined for surfaces.
TextureCoordMode
Defines how texture coordinates are generated or interpreted for a material.
Templated logic for doing matrix multiplication.
The core String View class for the NDEVR API.
The core String class for the NDEVR API.
Represents a timestamp with utilities for manipulation and conversion.
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
A fixed-size array with N dimensions used as the basis for geometric and mathematical types.
The primary namespace for the NDEVR SDK.
float fltp04
Defines an alias representing a 4 byte floating-point number Bit layout is as follows: -Sign: 1 bit a...
uint64_t uint08
-Defines an alias representing an 8 byte, unsigned integer
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...
@ e_uv_size
The number of UV types. Used for sizing arrays.
constexpr t_to cast(const Angle< t_from > &value)
Casts an Angle from one backing type to another.
Defines for a given type (such as sint04, fltp08, UUID, etc) a maximum, minimum, and reserved 'invali...
Defines the set of features a shader must support, used to select or compile the correct variant.