Page 1 of 1

Question on default RenderQueue

Posted: Mon Sep 09, 2019 4:31 am
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).

Re: Question on default RenderQueue

Posted: Mon Sep 09, 2019 5:18 am
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-)

Re: Question on default RenderQueue

Posted: Mon Sep 09, 2019 5:21 am
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?

Re: Question on default RenderQueue

Posted: Mon Sep 09, 2019 8:23 am
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?

Re: Question on default RenderQueue

Posted: Mon Sep 09, 2019 9:46 pm
by xrgo
No problem for me, and makes sense

Re: Question on default RenderQueue

Posted: Thu Nov 14, 2019 7:25 pm
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