Model processor which converts a MeshModelInterface into an OpenGL instance of a model (WSGLRenderItem).
#include <Rendering/OpenGL/wsglmodelprocessor.h>
|
enum class | ProcessResult {
ProcessSuccess = 0x1
, ModelSourceUpdateRequested
, ModelProcessingQueued
, ModelSourceIdMismatch
,
ModelEmpty
, ModelInstanceInvisible
, ErrorCacheCapacityExceeded
, ErrorModelIdInvalid
,
ErrorModelInvalid
, ErrorModelLibraryInvalid
, ErrorOpenGLOperationInvalid
} |
|
◆ ProcessResult
Enumerator |
---|
ProcessSuccess | |
ModelSourceUpdateRequested | |
ModelProcessingQueued | |
ModelSourceIdMismatch | |
ModelEmpty | |
ModelInstanceInvisible | |
ErrorCacheCapacityExceeded | |
ErrorModelIdInvalid | |
ErrorModelInvalid | |
ErrorModelLibraryInvalid | |
ErrorOpenGLOperationInvalid | |
◆ WSGLModelProcessor()
◆ ~WSGLModelProcessor()
◆ getBufferObjectCache()
◆ getForceDefaultShader()
bool getForceDefaultShader |
( |
| ) |
const |
- Returns
- true if the render queue builder always assigns the default shader, false otherwise.
◆ getGlyphSetCache()
◆ getMeshModelLibrary() [1/2]
◆ getMeshModelLibrary() [2/2]
◆ getProcessResultString()
◆ getShaderLibrary() [1/2]
◆ getShaderLibrary() [2/2]
◆ getViewFrustumCullingEnabled()
bool getViewFrustumCullingEnabled |
( |
| ) |
const |
◆ glDataUpdateFinished
void glDataUpdateFinished |
( |
| ) |
|
|
signal |
◆ glDataUpdateStarted
void glDataUpdateStarted |
( |
| ) |
|
|
signal |
◆ logText()
void logText |
( |
const QString & |
text | ) |
|
|
protected |
- Parameters
-
text | The text to send to the log. |
◆ process()
- Parameters
-
modelInstance | The MeshModelInstance to be prepared for rendering. In essense, the renderer-agnostic information that it contains is going to be processed into OpenGL-specific information stored in renderItem. |
- Note
- some aspects of modelInstance may be modified during the processing, such as the computation of the localBoundingBox. This is necessary because of the way that mesh data is delay-loaded by Workspace.
- Parameters
-
renderItem | The WSGLRenderItem in which to store all of the relevant information for rendering, such as the OpenGL geometry and shader data. |
worldMatrix | The current world transformation matrix that transforms local coordinates into world-space coordinates. This is needed to compute the world-space axis-aligned bounding box of modelInstance, also needed for LOD level computation. |
- Returns
- true if the processing was successful, false if an error occurred, such as a MeshModelSource not being up-to-date. In this specific case, the caller should check the sourceUpdateRequested() flag.
Processes modelInstance for rendering, creating the relevant OpenGL buffers and other necessary information for rendering and storing it in renderItem.
◆ setDefaultShader()
void setDefaultShader |
( |
const Shader & |
defaultShader | ) |
|
- Parameters
-
defaultShader | The shader to use as the default if an item does not have a shader applied. Alternatively, if setForceDefaultShader() is enabled, the shader will be used for all items in the scene. |
◆ setEnableViewFrustumCulling()
void setEnableViewFrustumCulling |
( |
bool |
b | ) |
|
- Parameters
-
b | Whether or not to enable view frustum culling, which is where objects are not processed if they are outside the region encompassed by the view frustum. |
◆ setForceDefaultShader()
void setForceDefaultShader |
( |
bool |
b | ) |
|
- Parameters
-
b | Force the render queue builder to always assign the default shader. |
◆ setFrustumInfo()
- Parameters
-
viewCamera | |
projMatrix | |
viewMatrix | |
◆ setMeshModelLibrary()
- Parameters
-
meshModelLibrary | The mesh model library that will supply all mesh model data. |
This function should be called before making a pass through the scene from which the models belong to. The scene's library can change, hence why it needs to be set for each pass.
◆ setShaderLibrary()
- Parameters
-
shaderLibrary | The ShaderLibrary that will be used by the model processor for retrieving shaders for MeshModelInstances. |
MeshModelInstances may have a ShaderId attached to them. This ID is used by the WSGLMeshModelProcessor to retrieve a shader and attach it to the WSGLRenderItem currently being processed.