Question on default RenderQueue

Discussion area about developing with Ogre2 branches (2.1, 2.2 and beyond)
Post Reply
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 4066
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 228
Contact:

Question on default RenderQueue

Post by dark_sylinc » Mon Sep 09, 2019 4:31 am

Hi!

TL;DR:
What should be the default render queue for Items and Entity, i.e. right now it is:

Code: Select all

item->setRenderQueueGroup( 0u );
entity->setRenderQueueGroup( 1u );
I'm thinking to changing it to:

Code: Select all

item->setRenderQueueGroup( 10u );
entity->setRenderQueueGroup( 110u );
Longer version:
Back when I started Ogre 2.0, I didn't want to risk breaking things more than they already were; and thus I hesitated to place Entities somewhere else other than RenderQueue group 0.

Then Items in Ogre 2.1 appeared, and Items went into RenderQueue group 0, and v1::Entity was displaced to group 1 (because v2 and v1 objects can't live in the same render queue group).

However lately from two entirely different fronts, I've met with the problem that often we want a specific object to be drawn first.

But we can't do that. Because all objects are already on RQ 0, which means the only solution is to manually switch all other Items to higher RQ, so that this particular object can be rendered first.

Another issue, is that by default all RenderQueues except RQ 0 default to V1_FAST. This often causes cryptic crashes because items are in a RenderQueue with the wrong mode. Back then it made sense because users porting their codebase from Ogre 1.x would use v1 objects more often than v2 ones.
But now users are adopting v2 objects more frequently, and now that we're all more acquinted with Ogre 2.1+, I think this change wouldn't actually cause any damage.

Now that v2 objects have been long enough, I propose the following:
  1. RenderQueue ID range [0; 100) default to FAST (i.e. for v2 objects, like Items)
  2. RenderQueue ID range [100; 255] default to V1_FAST (i.e. for v1 objects, like v1::Entity)
  3. By default new Items and other v2 objects are placed in RenderQueue ID 10
  4. By default new v1::Entity and other v1 objects are placed in RenderQueue ID 110
I think this is a minor change with few side effects, but I want to hear your opinions if you think this change somehow would break your entire codebase (I highly doubt so, but I am asking to be sure!).

Any objections?

Cheers
Matias

Edit: In case you're interested, the 2 fronts I mention are the Hidden Area Mesh for optimizing VR rendering, and Sky rendering (when rendering it late is not possible).
2 x

rujialiu
Goblin
Posts: 224
Joined: Mon May 09, 2016 8:21 am
x 20

Re: Question on default RenderQueue

Post by rujialiu » Mon Sep 09, 2019 5:18 am

dark_sylinc wrote:
Mon Sep 09, 2019 4:31 am
Any objections?
I'm ok with this one. Actually I think this is great 8-)
0 x

rujialiu
Goblin
Posts: 224
Joined: Mon May 09, 2016 8:21 am
x 20

Re: Question on default RenderQueue

Post by rujialiu » Mon Sep 09, 2019 5:21 am

And we can at least make this tunable via CMake switch if any senior user MUST use the old behavior.

And I think highlighting this breaking change in changelog, documentation and progress report and FAQs should be enough for most users?
0 x

User avatar
TaaTT4
OGRE Contributor
OGRE Contributor
Posts: 162
Joined: Wed Apr 23, 2014 3:49 pm
x 16

Re: Question on default RenderQueue

Post by TaaTT4 » Mon Sep 09, 2019 8:23 am

dark_sylinc wrote:
Mon Sep 09, 2019 4:31 am
Any objections?
It's OK for me too. We've seen changes more scary in the past :D
In case of a go signal, will this modification be confined just in 2.2 branch or it will spread even in the other 2.x branches?
0 x
Senior game programmer at Vae Victis
Working on Racecraft

xrgo
OGRE Expert User
OGRE Expert User
Posts: 1044
Joined: Sat Jul 06, 2013 10:59 pm
Location: Chile
x 73

Re: Question on default RenderQueue

Post by xrgo » Mon Sep 09, 2019 9:46 pm

No problem for me, and makes sense
0 x

Post Reply