[2.1] RenderQueueListener bug?? Topic is solved
-
- Kobold
- Posts: 38
- Joined: Sat Oct 31, 2015 7:12 pm
- x 1
[2.1] RenderQueueListener bug??
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?
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?
-
- OGRE Team Member
- Posts: 5511
- Joined: Sat Jul 21, 2007 4:55 pm
- Location: Buenos Aires, Argentina
- x 1379
Re: [2.1] RenderQueueListener bug??
These are artifacts from 1.x
I should remove them. What is it that you wanted to accomplish?
I should remove them. What is it that you wanted to accomplish?
-
- Kobold
- Posts: 38
- Joined: Sat Oct 31, 2015 7:12 pm
- x 1
Re: [2.1] RenderQueueListener bug??
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?
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?
-
- OGRE Team Member
- Posts: 5511
- Joined: Sat Jul 21, 2007 4:55 pm
- Location: Buenos Aires, Argentina
- x 1379
Re: [2.1] RenderQueueListener bug??
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)
We kept that listener because OverlaySystem needed it (ironically, for the same reason: to inject their elements directly)
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.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?
-
- Kobold
- Posts: 38
- Joined: Sat Oct 31, 2015 7:12 pm
- x 1
Re: [2.1] RenderQueueListener bug??
thanks replay....dark_sylinc wrote: Tue Nov 05, 2019 2:46 pmThat'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.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?
I hope you provide some flexibility like custom sorting.