- // Render the item.
- item.mRenderer->Render( context, bufferIndex, *item.mNode, item.mModelMatrix, item.mModelViewMatrix,
- viewMatrix, projectionMatrix, item.mSize, !item.mIsOpaque, boundTextures );
+ // Depending on whether the renderer has draw commands attached or not the rendering process will
+ // iterate through all the render queues. If there are no draw commands attached, only one
+ // iteration must be done and the default behaviour of the renderer will be executed.
+ // The queues allow to iterate over the same renderer multiple times changing the state of the renderer.
+ // It is similar to the multi-pass rendering.
+ if( !skip )
+ {
+ auto const MAX_QUEUE = item.mRenderer->GetDrawCommands().empty() ? 1 : DevelRenderer::RENDER_QUEUE_MAX;
+ for (auto queue = 0u; queue < MAX_QUEUE; ++queue)
+ {
+ // Render the item.
+ item.mRenderer->Render(context, bufferIndex, *item.mNode, item.mModelMatrix, item.mModelViewMatrix,
+ viewMatrix, projectionMatrix, item.mSize, !item.mIsOpaque, boundTextures, instruction, queue);
+ }
+ }