Skip to content

Commit

Permalink
Remove uncessary call to render scene (#490) (#515)
Browse files Browse the repository at this point in the history
* Remove uncessary call to render scene

Fixes #486.

At least the call seems unncessary. I haven't noticed any changes in selection render behavior
with or without the change. But, making the call causes an assertion to fail within Ogre when
a selection tool is moused-over an image display (see #486 for details).

The hack was originally added in

ros-visualization/rviz@7feb02d

but it's not clear if the original buggy behavior still exists without it. There's been a lot
of refactoring since then. I've played around with selecting things and haven't noticed any
flickering or discoloration after removing the hack.

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Fix warning about unused parameter

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
  • Loading branch information
jacobperron committed Mar 11, 2020
1 parent d7cd04c commit ce16e88
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions rviz_common/src/rviz_common/interaction/selection_renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,23 +247,10 @@ Dimensions SelectionRenderer::getRenderDimensions(
void SelectionRenderer::renderToTexture(
Ogre::RenderTexture * render_texture, Ogre::Viewport * window_viewport)
{
(void)window_viewport;
// update & force ogre to render the scene
Ogre::MaterialManager::getSingleton().addListener(this);

render_texture->update();

// For some reason we need to pretend to render the main window in
// order to get the picking render to show up in the pixelbox below.
// If we don't do this, it will show up there the *next* time we
// pick something, but not this time. This object as a
// render queue listener tells the scene manager to skip every
// render step, so nothing actually gets drawn.
//
// TODO(unknown): find out what part of _renderScene() actually makes this work.
scene_manager_->addRenderQueueListener(this);
scene_manager_->_renderScene(window_viewport->getCamera(), window_viewport, false);
scene_manager_->removeRenderQueueListener(this);

Ogre::MaterialManager::getSingleton().removeListener(this);
}

Expand Down

0 comments on commit ce16e88

Please sign in to comment.