Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable antialiasing #931

Merged

Conversation

bchretien
Copy link
Contributor

This PR is an attempt to truly enable antialiasing. The only piece of code that seemed related to it was here, but changing the value did not seem to have any effect. I added the entry to the proper dictionary, and used a value of 4 which is quite common (cf. Gazebo). Talking about Gazebo, they also added antialiasing to their Camera class, which for instance shares code similar to SelectionManager::setDepthTextureSize for creating Ogre::RenderTexture objects. This may not be relevant at all to add FSAA here, but it may be the perfect time to check similar parts of the code where antialiasing could improve the rendering.

As for the previous "FSAA" key in the other dictionary, if it is in fact useless, it may be worth removing, but since Gazebo also has it, I only updated its value.

Comparison before/after:

  • Without FSAA, full image:
    without_aa_full
  • With FSAA = 4, full image:
    with_aa_full
  • Without FSAA, zoomed:

without_aa_zoom

  • With FSAA = 4, zoomed:

with_aa_zoom

@wjwwood
Copy link
Member

wjwwood commented Oct 16, 2015

Cool thanks.

It looks like the Gazebo guys only enable FSAA (full screen AA) when ogre >= 1.8:

https://bitbucket.org/osrf/gazebo/src/38fbac52640382b2f7ff749aca3580cca7fd7994/gazebo/rendering/Camera.cc?at=default&fileviewer=file-view-default#Camera.cc-1237:1239

It would be best if this code still worked against Ogre 1.74 even though we don't use it anymore since Hydro.

I think it might also be wise to expose this as a configuration of rviz some how. Some people might prefer less AA in exchange for better performance, especially since rviz is purely aesthetic unlike the camera in Gazebo which is used for simulated images.

@bchretien
Copy link
Contributor Author

In Gazebo, the Ogre >= 1.8 check is only done for createManual(), not for the part of the code I modified (see here). As for making that a configurable parameter, I'm not familiar enough with RViz's code base, so if you can give me a few tips on how to do that properly, that would probably help :)

@wjwwood
Copy link
Member

wjwwood commented Dec 9, 2015

I tested this on my local machine it works great. Thanks! I'll follow up with a pr that adds a command line option to disable it.

wjwwood added a commit that referenced this pull request Dec 9, 2015
@wjwwood wjwwood merged commit 2a3aa26 into ros-visualization:indigo-devel Dec 9, 2015
@bchretien
Copy link
Contributor Author

@wjwwood thanks!

@wjwwood
Copy link
Member

wjwwood commented Dec 9, 2015

I made the follow up pr here: #950

130s pushed a commit to 130s/rviz that referenced this pull request Aug 21, 2024
…out a warning (ros-visualization#917) (ros-visualization#931)

Signed-off-by: Kenji Brameld <[email protected]>
(cherry picked from commit 8edb67482dbd96dbdb2919858bdd0dcce4d22bfb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants