OGRE-Next
4.0.0unstable
Object-Oriented Graphics Rendering Engine
|
Class to manage the scene object rendering queue. More...
#include <OgreRenderQueue.h>
Public Types | |
enum | Modes { V1_LEGACY , V1_FAST , FAST , PARTICLE_SYSTEM } |
enum | RqSortMode { DisableSort , NormalSort , StableSort } |
Public Member Functions | |
RenderQueue (HlmsManager *hlmsManager, SceneManager *sceneManager, VaoManager *vaoManager) | |
~RenderQueue () | |
void | _compileShadersThread (size_t threadIdx) |
void | _releaseManualHardwareResources () |
void | _warmUpShadersThread (size_t threadIdx) |
void | addRenderableV1 (uint8 renderQueueId, bool casterPass, Renderable *pRend, const MovableObject *pMovableObject) |
Add a renderable (Ogre v1.x) object to the queue. More... | |
void | addRenderableV2 (size_t threadIdx, uint8 renderQueueId, bool casterPass, Renderable *pRend, const MovableObject *pMovableObject) |
Add a renderable (Ogre v2.0, i.e. More... | |
void | clear () |
Empty the queue - should only be called by SceneManagers. More... | |
void | clearState () |
The RenderQueue keeps track of API state to avoid redundant state change passes Calling this function forces the RenderQueue to re-set the Macro- & Blendblocks, shaders, and any other API dependendant calls on the next render. More... | |
void | frameEnded () |
Called when the frame has fully ended (ALL passes have been executed to all RTTs) More... | |
RenderQueue::Modes | getRenderQueueMode (uint8 rqId) const |
RqSortMode | getSortRenderQueue (uint8 rqId) const |
void | render (RenderSystem *rs, uint8 firstRq, uint8 lastRq, bool casterPass, bool dualParaboloid) |
void | renderPassPrepare (bool casterPass, bool dualParaboloid) |
If you need to call RenderQueue::render, then you must call this function. More... | |
void | renderSingleObject (Renderable *pRend, const MovableObject *pMovableObject, RenderSystem *rs, bool casterPass, bool dualParaboloid) |
Don't call this too often. Only renders v1 objects at the moment. More... | |
void | setRenderQueueMode (uint8 rqId, RenderQueue::Modes newMode) |
Sets the mode for the RenderQueue ID. More... | |
void | setSortRenderQueue (uint8 rqId, RqSortMode sortMode) |
Sets whether we should sort the render queue ID every frame. More... | |
void | warmUpShadersCollect (uint8 firstRq, uint8 lastRq, bool casterPass) |
Simulates what render() would do. More... | |
void | warmUpShadersTrigger (RenderSystem *rs) |
Class to manage the scene object rendering queue.
Enumerator | |
---|---|
V1_LEGACY | This is the slowest mode. Renders the same or similar way to how Ogre 1.x rendered meshes. Only v1 entities can be put in this type of queue. Ideal for low level materials, InstancedEntity via InstanceManager, and any other weird custom object. |
V1_FAST | Renders v1 entities using HLMS materials with some of the new benefits, but some deprecated features from Ogre 1.x might not be available or work properly (like global instancing buffer). Ideal for most v1 entities, particle effects and billboards using HLMS materials. Cannot be used by RenderSystems that don't support constant buffers (i.e. OpenGL ES 2) |
FAST | Renders v2 items using HLMS materials with minimum driver overhead Recommended method for rendering extremely large amounts of objects of homogeneous and heterogenous meshes, with many different kinds of materials and textures. Only v2 Items can be put in this queue. |
PARTICLE_SYSTEM | Renders ParticleSystemDef (i.e. |
Ogre::RenderQueue::RenderQueue | ( | HlmsManager * | hlmsManager, |
SceneManager * | sceneManager, | ||
VaoManager * | vaoManager | ||
) |
Ogre::RenderQueue::~RenderQueue | ( | ) |
void Ogre::RenderQueue::_compileShadersThread | ( | size_t | threadIdx | ) |
void Ogre::RenderQueue::_releaseManualHardwareResources | ( | ) |
void Ogre::RenderQueue::_warmUpShadersThread | ( | size_t | threadIdx | ) |
void Ogre::RenderQueue::addRenderableV1 | ( | uint8 | renderQueueId, |
bool | casterPass, | ||
Renderable * | pRend, | ||
const MovableObject * | pMovableObject | ||
) |
Add a renderable (Ogre v1.x) object to the queue.
void Ogre::RenderQueue::addRenderableV2 | ( | size_t | threadIdx, |
uint8 | renderQueueId, | ||
bool | casterPass, | ||
Renderable * | pRend, | ||
const MovableObject * | pMovableObject | ||
) |
Add a renderable (Ogre v2.0, i.e.
Items; they use VAOs) object to the queue.
threadIdx | The unique index of the thread from which this function is called from. Valid range is [0; SceneManager::mNumWorkerThreads) |
renderQueueId | The ID of the render queue. Must be the same as the ID in pMovableObject->getRenderQueueGroup() |
casterPass | Whether we're performing the shadow mapping pass. |
pRend | Pointer to the Renderable to be added to the queue. |
pMovableObject | Pointer to the MovableObject linked to the Renderable. |
void Ogre::RenderQueue::clear | ( | ) |
Empty the queue - should only be called by SceneManagers.
void Ogre::RenderQueue::clearState | ( | ) |
The RenderQueue keeps track of API state to avoid redundant state change passes Calling this function forces the RenderQueue to re-set the Macro- & Blendblocks, shaders, and any other API dependendant calls on the next render.
void Ogre::RenderQueue::frameEnded | ( | ) |
Called when the frame has fully ended (ALL passes have been executed to all RTTs)
RenderQueue::Modes Ogre::RenderQueue::getRenderQueueMode | ( | uint8 | rqId | ) | const |
RqSortMode Ogre::RenderQueue::getSortRenderQueue | ( | uint8 | rqId | ) | const |
void Ogre::RenderQueue::render | ( | RenderSystem * | rs, |
uint8 | firstRq, | ||
uint8 | lastRq, | ||
bool | casterPass, | ||
bool | dualParaboloid | ||
) |
void Ogre::RenderQueue::renderPassPrepare | ( | bool | casterPass, |
bool | dualParaboloid | ||
) |
If you need to call RenderQueue::render, then you must call this function.
This function MUST be called (all listed functions are called in this order):
Note that fireRenderQueueStarted just fires arbitrary listeners. You don't have to call that function if you are sure you don't need it.
To clarify functions are called in this order:
Calling these functions in proper order is needed for best compatibility with Metal
casterPass | |
dualParaboloid |
void Ogre::RenderQueue::renderSingleObject | ( | Renderable * | pRend, |
const MovableObject * | pMovableObject, | ||
RenderSystem * | rs, | ||
bool | casterPass, | ||
bool | dualParaboloid | ||
) |
Don't call this too often. Only renders v1 objects at the moment.
void Ogre::RenderQueue::setRenderQueueMode | ( | uint8 | rqId, |
RenderQueue::Modes | newMode | ||
) |
Sets the mode for the RenderQueue ID.
rqId | ID of the render queue |
newMode | The new mode to use. |
void Ogre::RenderQueue::setSortRenderQueue | ( | uint8 | rqId, |
RqSortMode | sortMode | ||
) |
Sets whether we should sort the render queue ID every frame.
rqId | ID of the render queue |
bSort | When false, the render queue group won't be sorted. Useful when the RQ needs to be drawn exactly in the order that Renderables were added, or when you have a deep CPU bottleneck where the time taken to sort hurts more than it is supposed to help. |
Simulates what render() would do.
But doesn't actually render and skips as much as possible We are only interested in generating the PSOs for compiling them early.
firstRq | |
lastRq | |
casterPass |
void Ogre::RenderQueue::warmUpShadersTrigger | ( | RenderSystem * | rs | ) |