Regarding RenderQueue::clear()

Discussion area about developing or extending OGRE, adding plugins for it or building applications on it. No newbie questions please, use the Help forum for that.
Post Reply
User avatar
lf3thn4d
Orc
Posts: 478
Joined: Mon Apr 10, 2006 9:12 pm
x 12

Regarding RenderQueue::clear()

Post by lf3thn4d »

Hey guys, it's been a while since I'm around. I've been very busy with work since our company started accepting contract projects. It really does kill all our time for our own stuff. :-(

Anyways, I've found some time to try and update our engine over to the new ogre build since God knows when I did my last update. I hit into a problem after finally getting everything compiling to find that my own light pre-pass deferred rendering system was broken. Debugging through codes the whole day with my rusty memory of ogre and my own engine, I found out that this change actually was the cause: https://bitbucket.org/sinbad/ogre/chang ... c36c129c53

The reason for my problem was that I'm using a custom render queue that is not part of the scene manager for my rendering technique. With the mentioned change, my custom render queue was never cleared due to that code goes clearing all render queues of scenemanagers instead of the given target render queue. What exactly is the reason for this change? IMHO, this feels like a hack that doesn't fit the API. One should rightly assume that calling RenderQueue::clear() should clear the target render queue and not all scene manager owned render queue. How did this get into trunk anyways?

I think there needs to be some restructuring to fix this since that change talks about "avoid possible inconsistencies". Personally I feel we should introduce a different method for that case and keep the clear() method for actually clearing the target render queue.

P.S. Sorry for being a little rude but this issue frustrates me quite a bit. I've been spending a whole day working on this.
User avatar
Wolfmanfx
OGRE Team Member
OGRE Team Member
Posts: 1525
Joined: Fri Feb 03, 2006 10:37 pm
Location: Austria - Leoben
x 99
Contact:

Re: Regarding RenderQueue::clear()

Post by Wolfmanfx »

Maybe you could submit a patch where you add a clearAll and revert clear to the old behavior.
User avatar
lf3thn4d
Orc
Posts: 478
Joined: Mon Apr 10, 2006 9:12 pm
x 12

Re: Regarding RenderQueue::clear()

Post by lf3thn4d »

Yes, I'm planning to do that. However since I'm not too sure what that code change is intending to fix, reverting that behavior could cause unwanted issue. It would be best if whoever change that code review this change again and find a proper fix or I would be beating around the bush trying to hunt down the purpose of that change.
CABAListic
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 2903
Joined: Thu Jan 18, 2007 2:48 pm
x 58
Contact:

Re: Regarding RenderQueue::clear()

Post by CABAListic »

This is the issue in question: https://sourceforge.net/tracker/?func=d ... tid=302997
If you know of a better workaround, be my guest. I just applied it after sinbad said he didn't see a better way. Sorry for the trouble.
User avatar
lf3thn4d
Orc
Posts: 478
Joined: Mon Apr 10, 2006 9:12 pm
x 12

Re: Regarding RenderQueue::clear()

Post by lf3thn4d »

Hmm.. that looks like a big issue since it's a pass hash sorting problem. This will be a tough nut to crack unless we do quite some number of refactoring. It looks like a design problem here. Unless we flag the QueuedRenderableCollection::mGroup map dirty when pass hashes have been recalculated. That way, before the next insertion into the mGroup map, we re-sort the passes by manually picking out all the items in the group and reinserting it again to make sure insertion works again.
Post Reply