Manage Items in different renderqueues will not work

Discussion area about developing with Ogre-Next (2.1, 2.2 and beyond)


Lax
Gnoll
Posts: 640
Joined: Mon Aug 06, 2007 12:53 pm
Location: Saarland, Germany
x 57

Manage Items in different renderqueues will not work

Post by Lax »

Hi,

I need to manage Ogre::Item's in different render queues, in order to render on item in the front of another.

I'm working with:

Code: Select all

this->movableObject->setRenderQueueGroup(static_cast<Ogre::uint8>(renderQueueIndex));

...
// V2 Items
this->sceneManager->getRenderQueue()->setRenderQueueMode(10, Ogre::RenderQueue::Modes::FAST);
this->sceneManager->getRenderQueue()->setSortRenderQueue(10, sortMode);

// V1 Entities
this->sceneManager->getRenderQueue()->setRenderQueueMode(110, Ogre::RenderQueue::Modes::V1_FAST);
this->sceneManager->getRenderQueue()->setSortRenderQueue(110, sortMode);

this->sceneManager->getRenderQueue()->setRenderQueueMode(16, Ogre::RenderQueue::Modes::FAST);

...
this->sceneManager->getRenderQueue()->setRenderQueueMode(155, Ogre::RenderQueue::Modes::V1_FAST);
this->sceneManager->getRenderQueue()->setSortRenderQueue(155, sortMode);

this->sceneManager->getRenderQueue()->setRenderQueueMode(156,  Ogre::RenderQueue::Modes::V1_LEGACY);
this->sceneManager->getRenderQueue()->setSortRenderQueue(156, sortMode);

this->sceneManager->getRenderQueue()->setRenderQueueMode(NOWA::RENDER_QUEUE_V2_OBJECTS_ALWAYS_IN_FOREGROUND, Ogre::RenderQueue::Modes::FAST);
this->sceneManager->getRenderQueue()->setSortRenderQueue(NOWA::RENDER_QUEUE_V2_OBJECTS_ALWAYS_IN_FOREGROUND, sortMode);

this->sceneManager->getRenderQueue()->setRenderQueueMode(NOWA::RENDER_QUEUE_V1_OBJECTS_ALWAYS_IN_FOREGROUND, Ogre::RenderQueue::Modes::V1_FAST);
this->sceneManager->getRenderQueue()->setSortRenderQueue(NOWA::RENDER_QUEUE_V1_OBJECTS_ALWAYS_IN_FOREGROUND, sortMode);

this->sceneManager->getRenderQueue()->setRenderQueueMode(NOWA::RENDER_QUEUE_GIZMO, Ogre::RenderQueue::Modes::V1_FAST);
this->sceneManager->getRenderQueue()->setSortRenderQueue(NOWA::RENDER_QUEUE_GIZMO, sortMode);

this->sceneManager->getRenderQueue()->setRenderQueueMode(NOWA::RENDER_QUEUE_MAX, Ogre::RenderQueue::V1_FAST);
this->sceneManager->getRenderQueue()->setSortRenderQueue(NOWA::RENDER_QUEUE_MAX, sortMode);

If I change for an item the render queue group via 'setRenderQueueGroup' e.g. from 10 to 9. It does not work.
What can that be?

Best Regards
Lax

http://www.lukas-kalinowski.com/Homepage/?page_id=1631
Please support Second Earth Technic Base built of Lego bricks for Lego ideas: https://ideas.lego.com/projects/81b9bd1 ... b97b79be62

User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5429
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1337

Re: Manage Items in different renderqueues will not work

Post by dark_sylinc »

If I change for an item the render queue group via 'setRenderQueueGroup' e.g. from 10 to 9. It does not work.

You mean that the order doesn't change?

They definitely should. Have you confirmed in RenderDoc the order is altered?

Note that Depth Buffers will ensure one object stays on top of the other correctly. If what you want is to override their triangle's Z order to fully respect the order in which they're submitted to GPU (i.e. Render Queue Group ID), you must disable depth writes on both objects, or set the depth_funcion to always_pass for the 2nd object.