[Fixed] 1.7.4 -> 1.8.1 - Geometry disappears "The blackout"

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
Xavyiy
OGRE Expert User
OGRE Expert User
Posts: 847
Joined: Tue Apr 12, 2005 2:35 pm
Location: Albacete - Spain
x 87

[Fixed] 1.7.4 -> 1.8.1 - Geometry disappears "The blackout"

Post by Xavyiy »

Hi people!

Last week I've upgraded to Ogre 1.8.1 the Paradise Engine. All went well, but after some time using the editor I remarked that the geometry disappeared from all viewports after some minutes of use. After the "blackout" the only signal of life is that the viewport background color is updated without any problem. Also, closing all viewports and creating new ones doesn't solve the problem: the new viewports are "empty" too.

Well, here the hell starts:
Since the render pipeline that I use in the editor is quite complex (involves compositors & RTTs for composting the final image), I'll baypass all that and I'll explain the facts:
  • At a first time, I thought it could be caused to a problem with Qt/Ogre, but not since the background color is working. Or a OGL specific bug but: it happens in DX9 and OGL.
  • Also, I thought that maybe the geometry was just not rendered. No -> The FPS is normal, like if it was rendered. (Except on some complex scenes, that the fps is ~40 when usually it's around 20)
  • Or maybe it was something related with the new ogre 1.8 Depth buffer sharing system -> I don't think, see next section
  • Or it could be something going wrong with compositors but... even regular overlays weren't rendered!
Important: The "blackout" happens if previously the user has selected an object ---> more precisely if I update an auxiliar RTT where I render the selected objects highlights. Looks like this:

Code: Select all

sceneMgr->setSpecialCaseRenderQueueMode(Ogre::SceneManager::SCRQM_INCLUDE);
sceneMgr->addSpecialCaseRenderQueue(104);

// Change some movable objects render queue group
// !!! ---> If I don't do that, then there is no blackout

v->getSelectionTexture()->getBuffer()->getRenderTarget()->_beginUpdate();
v->getSelectionTexture()->getBuffer()->getRenderTarget()->_updateViewport(0, true); // If commented, then there is no "blackout"
v->getSelectionTexture()->getBuffer()->getRenderTarget()->_endUpdate();

// Restore some movable objects render queue group

sceneMgr->setSpecialCaseRenderQueueMode(Ogre::SceneManager::SCRQM_EXCLUDE);
sceneMgr->clearSpecialCaseRenderQueues();
(Also, if I don't change the objects render queue group then there is no bug)

BUT, the blackout is not at this very moment, it's one time the SkyX Moon or the SkyX Volumetric clouds are in the camera view. So... what the hell? why only these two renderables? ---> Because of it's render queue groups:

SkyX skydome -> render queue group = 5 (RENDER_QUEUE_SKIES_EARLY)
SkyX Moon-> render queue group = 6 (RENDER_QUEUE_SKIES_EARLY+1)
SkyX Vol clouds -> render queue group = 30 (RENDER_QUEUE_3)

But, if the SkyX Moon render queue group is set to 5, then there is not any blackout. The same with the vol clouds.

Conclusion: (by the moment...)
There should be a bug in 1.8.X regarding render queue groups, since if I don't change them(just before updating the RTT used to render the selected objects highlights) or if I don't update the RTT then there is no blackout

Questions:
What kind of "bug" could make all the goemetry dissapear from all viewports? (even internal RTTs used in the picking system: they just don't have any content, after the blackout). Maybe some kind of corruption of the depth buffer(but I've tried to create all them in different pools, so each RTT has an unique depth buffer, so I don't think that's the cause)? Or some kind of problem with the camera matrices? (but creating new viewports->camera should make it working again no?)

...But how is possible that just changing the render group of movable objects can lead to this?

Any kind of help/idea is highly appreciated. This bug is driving me crazy, I don't know what more debug or where to search.

Thanks in advance!

Xavier
Last edited by Xavyiy on Fri Dec 07, 2012 3:39 am, edited 1 time in total.
bstone
OGRE Expert User
OGRE Expert User
Posts: 1920
Joined: Sun Feb 19, 2012 9:24 pm
Location: Russia
x 201

Re: 1.7.4 -> 1.8.1 - Geometry disappears "The blackout"

Post by bstone »

There was a change between 1.7.x and 1.8.x in the way AABBs are handled. 1.7.x seems to have been ignoring the EXTENTS_NULL flag in some cases. 1.8.x doesn't do that and objects might disappear as you would guess. See this thread: Howto move from 1.7 to 1.8?. But your problem sounds completely unrelated. I have no clue atm.
User avatar
Xavyiy
OGRE Expert User
OGRE Expert User
Posts: 847
Joined: Tue Apr 12, 2005 2:35 pm
Location: Albacete - Spain
x 87

Re: 1.7.4 -> 1.8.1 - Geometry disappears "The blackout"

Post by Xavyiy »

Thanks for the reply bstone!

I think I've detected the root of the "blackout": while I was trying to reproduce the problem in the client app (which does not have the editor's complex render pipeline), I've figured out one strange thing: render queue group 104 was buggy somehow (if I set an entity render queue group to 104, then Root::renderOneFrame, then reseting it to its original value... some of the other geometry just disappeared, ~like the blackout!) while 103 was ok (and... eureca, this is exactly the group I was using for the selection RTT).

Well, I've swiched from 104 to 103 and now I can't reproduce the blackout: dunno if that will fix the problem forever or it's just I haven't found another way for making the bug appear! :P

Atm I'm reverting this commit: https://bitbucket.org/sinbad/ogre/commi ... d1cf9f4ffd , and let's see if I can use the 104 again, if yes then the problem is this commit.

I'll keep you updated!

Xavier
User avatar
Xavyiy
OGRE Expert User
OGRE Expert User
Posts: 847
Joined: Tue Apr 12, 2005 2:35 pm
Location: Albacete - Spain
x 87

Re: 1.7.4 -> 1.8.1 - Geometry disappears "The blackout"

Post by Xavyiy »

Well, reverting this commit (https://bitbucket.org/sinbad/ogre/commi ... d1cf9f4ffd) makes all to work again: in the editor and in the test I was preparing.
:)
bstone
OGRE Expert User
OGRE Expert User
Posts: 1920
Joined: Sun Feb 19, 2012 9:24 pm
Location: Russia
x 201

Re: [Fixed] 1.7.4 -> 1.8.1 - Geometry disappears "The blacko

Post by bstone »

Good find! 104 is RENDER_QUEUE_MAX-1 so most likely there's some subtle bug in the new implementation of RenderQueue::RenderQueueGroupMap.
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: [Fixed] 1.7.4 -> 1.8.1 - Geometry disappears "The blacko

Post by Wolfmanfx »

I am going to revert the patch.
Post Reply