Question on default RenderQueue

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


Post Reply
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5296
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1278
Contact:

Question on default RenderQueue

Post by dark_sylinc »

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) & [200; 225) default to FAST (i.e. for v2 objects, like Items)
  2. RenderQueue ID range [100; 200) & [225; 256) 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).
rujialiu
Goblin
Posts: 296
Joined: Mon May 09, 2016 8:21 am
x 35

Re: Question on default RenderQueue

Post by rujialiu »

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-)
rujialiu
Goblin
Posts: 296
Joined: Mon May 09, 2016 8:21 am
x 35

Re: Question on default RenderQueue

Post by rujialiu »

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?
User avatar
TaaTT4
OGRE Contributor
OGRE Contributor
Posts: 267
Joined: Wed Apr 23, 2014 3:49 pm
Location: Bologna, Italy
x 75
Contact:

Re: Question on default RenderQueue

Post by TaaTT4 »

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?

Senior programmer at 505 Games; former senior engine programmer at Sandbox Games
Worked on: Racecraft EsportRacecraft Coin-Op, Victory: The Age of Racing

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

Re: Question on default RenderQueue

Post by xrgo »

No problem for me, and makes sense
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5296
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1278
Contact:

Re: Question on default RenderQueue

Post by dark_sylinc »

This change has been made into effect:
https://github.com/OGRECave/ogre-next/c ... 4abf2c2a51
https://github.com/OGRECave/ogre-next/c ... 1bccd3622f
https://github.com/OGRECave/ogre-next/c ... cd7f91483d
https://github.com/OGRECave/ogre-next/c ... 49fd3b3a17

If you were relying not relying on the defaults or your compositor scripts were not considering all RQ ranges then you may have to tweak your compositors.

The distortion sample for example required additional adjustments.

The OpenVR sample can now rely on defaults and made sure to state in comments that HiddenAreaMesh should happen after RadialDensityMask
Post Reply