![]() |
NDEVR
API Documentation
|
Structure responsible for handling the OpenGL data surrounding a particular Material object. More...
Public Member Functions | |
| GLESMaterialManager (const DynamicPointer< GLESGraphicsDevice > &device) | |
| Constructs a GLESMaterialManager for the given device. | |
| ~GLESMaterialManager () | |
| Destroys the material manager and releases GPU resources. | |
| void | addMaterial (const Material &material) |
| Adds a material to this manager's material list. | |
| void | checkImages () |
| Checks whether any image textures need re-uploading. | |
| void | cleanup () |
| Releases all GPU resources held by this manager. | |
| void | clearMaterials () |
| Removes all materials from this manager. | |
| void | commit () |
| Commits pending uniform buffer changes to the GPU. | |
| void | createPipeline (GraphicsUpdateArguments &args, DynamicPointer< GLESShaderManager > &shader_manager, DynamicPointer< GLESImageManager > &manager) |
| Creates or recreates the rendering pipeline for the current materials. | |
| fltp04 | depthBias () const |
| Returns the depth bias offset. | |
| fltp04 | fadeDistance () const |
| Returns the distance at which objects begin to fade. | |
| StringView | getColorByChannel (GraphicsUpdateArguments &args) const |
| Returns the name of the color-by channel for the current material. | |
| StringView | getExtraPropertyChannel () const |
| Returns the extra property channel name. | |
| FragUniformObject | getFragUniformObject (const Material &material) const |
| Builds a fragment uniform object from the given material. | |
| uint04 | getNumberOfImages (const GraphicsUpdateArguments &args) const |
| Returns the number of active texture images. | |
| GLESShader * | getShader (GLESShader::Definition &definition) const |
| Returns the shader matching the given definition, creating if needed. | |
| GLESVertexUniformObject | getVertexUniformObject (const Material &material) const |
| Builds a vertex uniform object from the given material. | |
| bool | hasGrid () const |
| Checks whether any material uses grid rendering. | |
| bool | hasImage () const |
| Checks whether any material has a texture image. | |
| bool | hasOpacity () const |
| Checks whether any material has opacity. | |
| uint08 | id () const |
| Returns a unique identifier for this material manager instance. | |
| bool | ignoreDepth () const |
| Checks whether depth testing should be ignored. | |
| bool | isTwoSided () const |
| Checks whether the material is two-sided. | |
| bool | isWireframe () const |
| Checks whether the material renders as wireframe. | |
| Time | lastDependencyUpdate () const |
| Returns the last time material dependencies were pushed to GPU. | |
| UUID | material () const |
| Returns the UUID of the primary material managed by this instance. | |
| bool | overrideCamera () const |
| Checks whether the material overrides the camera projection. | |
| void | setUniformVariables (GLESShader *shader) |
| Pushes uniform values to the given shader. | |
| bool | smoothNormals () const |
| Checks whether smooth normal interpolation is enabled. | |
| void | updateImages (const Material &material, GraphicsUpdateArguments &args, DynamicPointer< GLESImageManager > &manager) |
| Updates GPU textures for the given material. | |
| void | updateUniformBuffer (GraphicsUpdateArguments &args) |
| Updates uniform buffers from the current material state. | |
| bool | useLighting () const |
| Checks whether lighting is enabled for the material. | |
| bool | useNormalForTexture () const |
| Checks whether normals are used for texture coordinate generation. | |
| bool | usesLayerColor () const |
| Checks whether layer color overrides material color. | |
| bool | usesModelColor () const |
| Checks whether model color overrides material color. | |
| const GLESVertexUniformObject & | vertexUniform () const |
| Returns the current vertex uniform object. | |
| bool | writeToDepth () const |
| Checks whether depth writing is enabled. | |
Static Public Member Functions | |
| static uint08 | MaterialID (const Material &material) |
| Computes a unique identifier for the given material. | |
Protected Member Functions | |
| 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. | |
| bool | needsToUpdateShader (const Material &material) |
| Checks whether the material's shader needs recompilation. | |
| void | updateShader (const Material &mat, const GraphicsUpdateArguments &args, DynamicPointer< GLESShaderManager > &shader_manager) |
| Updates the shader for the given material if needed. | |
Structure responsible for handling the OpenGL data surrounding a particular Material object.
Definition at line 101 of file GLESMaterialManager.h.
| GLESMaterialManager::GLESMaterialManager | ( | const DynamicPointer< GLESGraphicsDevice > & | device | ) |
Constructs a GLESMaterialManager for the given device.
| [in] | device | The OpenGL graphics device. |
References GLESMaterialManager().
Referenced by GLESMaterialManager().
| void GLESMaterialManager::addMaterial | ( | const Material & | material | ) |
Adds a material to this manager's material list.
| [in] | material | The material to add. |
References material().
| void GLESMaterialManager::createPipeline | ( | GraphicsUpdateArguments & | args, |
| DynamicPointer< GLESShaderManager > & | shader_manager, | ||
| DynamicPointer< GLESImageManager > & | manager ) |
Creates or recreates the rendering pipeline for the current materials.
| [in] | args | The graphics update context. |
| [in] | shader_manager | The shader manager for shader creation. |
| [in] | manager | The image manager for texture loading. |
|
inline |
Returns the depth bias offset.
Definition at line 158 of file GLESMaterialManager.h.
| fltp04 GLESMaterialManager::fadeDistance | ( | ) | const |
Returns the distance at which objects begin to fade.
| StringView GLESMaterialManager::getColorByChannel | ( | GraphicsUpdateArguments & | args | ) | const |
Returns the name of the color-by channel for the current material.
| [in] | args | The graphics update context. |
|
inline |
Returns the extra property channel name.
Definition at line 177 of file GLESMaterialManager.h.
| FragUniformObject GLESMaterialManager::getFragUniformObject | ( | const Material & | material | ) | const |
Builds a fragment uniform object from the given material.
| [in] | material | The material to extract fragment uniforms from. |
References material().
Returns the layer number for the given material.
| [in] | material | The material to query. |
References e_uv_size, and material().
| uint04 GLESMaterialManager::getNumberOfImages | ( | const GraphicsUpdateArguments & | args | ) | const |
Returns the number of active texture images.
| [in] | args | The graphics update context. |
| GLESShader * GLESMaterialManager::getShader | ( | GLESShader::Definition & | definition | ) | const |
Returns the shader matching the given definition, creating if needed.
| [in] | definition | The shader definition to look up. |
| GLESVertexUniformObject GLESMaterialManager::getVertexUniformObject | ( | const Material & | material | ) | const |
Builds a vertex uniform object from the given material.
| [in] | material | The material to extract vertex uniforms from. |
References material().
|
inline |
Checks whether any material uses grid rendering.
Definition at line 115 of file GLESMaterialManager.h.
| bool GLESMaterialManager::hasImage | ( | ) | const |
Checks whether any material has a texture image.
|
inline |
Checks whether any material has opacity.
Definition at line 140 of file GLESMaterialManager.h.
| uint08 GLESMaterialManager::id | ( | ) | const |
Returns a unique identifier for this material manager instance.
|
inline |
Checks whether depth testing should be ignored.
Definition at line 143 of file GLESMaterialManager.h.
|
inline |
Checks whether the material is two-sided.
Definition at line 200 of file GLESMaterialManager.h.
|
inline |
Checks whether the material renders as wireframe.
Definition at line 203 of file GLESMaterialManager.h.
|
inline |
Returns the last time material dependencies were pushed to GPU.
Definition at line 194 of file GLESMaterialManager.h.
| UUID GLESMaterialManager::material | ( | ) | const |
Returns the UUID of the primary material managed by this instance.
Referenced by addMaterial(), getFragUniformObject(), getLayerNumber(), getVertexUniformObject(), MaterialID(), needsToUpdateImage(), needsToUpdateShader(), and updateImages().
Computes a unique identifier for the given material.
| [in] | material | The material to compute an ID for. |
References material().
|
protected |
Checks whether the material's image textures need updating.
| [in] | material | The material to check. |
References material().
|
protected |
Checks whether the material's shader needs recompilation.
| [in] | material | The material to check. |
References material().
|
inline |
Checks whether the material overrides the camera projection.
Definition at line 206 of file GLESMaterialManager.h.
| void GLESMaterialManager::setUniformVariables | ( | GLESShader * | shader | ) |
Pushes uniform values to the given shader.
| [in] | shader | The shader to update. |
| bool GLESMaterialManager::smoothNormals | ( | ) | const |
Checks whether smooth normal interpolation is enabled.
| void GLESMaterialManager::updateImages | ( | const Material & | material, |
| GraphicsUpdateArguments & | args, | ||
| DynamicPointer< GLESImageManager > & | manager ) |
Updates GPU textures for the given material.
| [in] | material | The material whose textures need updating. |
| [in] | args | The graphics update context. |
| [in] | manager | The image manager for texture loading. |
References material().
|
protected |
Updates the shader for the given material if needed.
| [in] | mat | The material to update shaders for. |
| [in] | args | The graphics update context. |
| [in] | shader_manager | The shader manager for shader creation. |
| void GLESMaterialManager::updateUniformBuffer | ( | GraphicsUpdateArguments & | args | ) |
Updates uniform buffers from the current material state.
| [in] | args | The graphics update context. |
| bool GLESMaterialManager::useLighting | ( | ) | const |
Checks whether lighting is enabled for the material.
|
inline |
Checks whether normals are used for texture coordinate generation.
Definition at line 209 of file GLESMaterialManager.h.
|
inline |
Checks whether layer color overrides material color.
Definition at line 152 of file GLESMaterialManager.h.
|
inline |
Checks whether model color overrides material color.
Definition at line 149 of file GLESMaterialManager.h.
|
inline |
Returns the current vertex uniform object.
Definition at line 124 of file GLESMaterialManager.h.
|
inline |
Checks whether depth writing is enabled.
Definition at line 146 of file GLESMaterialManager.h.