[2.1] RenderQueueListener bug?? Topic is solved

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


dummy_98
Kobold
Posts: 38
Joined: Sat Oct 31, 2015 7:12 pm
x 1

[2.1] RenderQueueListener bug??

Post by dummy_98 »

In Ogre 2.1,
I was thinking of using the SceneManager's listener (RenderQueueListener).

But when I checked the code, only one of the listener's functions was called.

SceneManager :: firePreRenderQueues
SceneManager :: firePostRenderQueues
SceneManager :: fireRenderQueueEnded
Is not called ...,

(RenderQueueListener :: renderQueueStarted) Only this function was called from SceneManager :: fireRenderQueueStarted.
Is this a bug? deprecated?
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5509
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1378

Re: [2.1] RenderQueueListener bug??

Post by dark_sylinc »

These are artifacts from 1.x

I should remove them. What is it that you wanted to accomplish?
dummy_98
Kobold
Posts: 38
Joined: Sat Oct 31, 2015 7:12 pm
x 1

Re: [2.1] RenderQueueListener bug??

Post by dummy_98 »

I wanted to create a game that adds 3D objects to the 2D gamestyle.

So since 2D objects are so important,
I thought about how to sort My 2D Renderable Objects in the order of drawing.
(Hlms is not used yet for backward compatibility)

I found a way,
From (MoveableObject :: _ updateRenderQueue)
Without adding a renderable directly to the queue,
Without adding it to MoveableObject :: mRenderable ...

I wanted to add a 2D Object that I sorted myself to the RenderQueue directly.
 
So I tried to use Listener .. Is that right?

Or can't you provide a custom sort?
For example
In RenderQueue :: render,
  std :: sort (queuedRenderables.begin (), queuedRenderables.end (), custom_sort_func);

(custom_sort_func) Wouldn't it be nice if the engine provided these function pointers?
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5509
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1378

Re: [2.1] RenderQueueListener bug??

Post by dark_sylinc »

Seems you're in luck then. RenderQueueListener::renderQueueStarted gets called after all Renderables were added to all RenderQueues, thus you can call add your objects there.

We kept that listener because OverlaySystem needed it (ironically, for the same reason: to inject their elements directly)
Or can't you provide a custom sort?
For example
In RenderQueue :: render,
std :: sort (queuedRenderables.begin (), queuedRenderables.end (), custom_sort_func);

(custom_sort_func) Wouldn't it be nice if the engine provided these function pointers?
That's not a bad idea! I've wanted to offer more flexibility regarding RQ sorting, but I just don't have the time; and I didn't really think much about it either.
dummy_98
Kobold
Posts: 38
Joined: Sat Oct 31, 2015 7:12 pm
x 1

Re: [2.1] RenderQueueListener bug??

Post by dummy_98 »

dark_sylinc wrote: Tue Nov 05, 2019 2:46 pm
Or can't you provide a custom sort?
For example
In RenderQueue :: render,
std :: sort (queuedRenderables.begin (), queuedRenderables.end (), custom_sort_func);

(custom_sort_func) Wouldn't it be nice if the engine provided these function pointers?
That's not a bad idea! I've wanted to offer more flexibility regarding RQ sorting, but I just don't have the time; and I didn't really think much about it either.
thanks replay....

I hope you provide some flexibility like custom sorting.