-
Notifications
You must be signed in to change notification settings - Fork 52
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
Fix Ogre2RenderTarget::TargetFSAA method that caused black screen when used with llvmpipe (i.e. software rendering on Linux) #661
Conversation
Fix Ogre2RenderTarget::TargetFSAA method that caused black screen when used with llvmpipe (i.e. software rendering on Linux) The Ogre2RenderTarget::TargetFSAA method has a logic to check if the selected antialiasing level is supported. If the requested antialiasing level is not supported, the 0 level is selected instead. Furthermore, a warning is printed only once for process. Before this PR, the 0 level was only set only when the warning was printed, resulting in an unsupported antialiasing being set if Ogre2RenderTarget::TargetFSAA was called two or more times. Signed-off-by: Silvio <[email protected]>
As the bug was introduced (I think) in https://github.com/gazebosim/gz-rendering/pull/272/files#diff-d0c4d95c8bb6f3ff2d80c1c9b72dc8c4d5635d31d3a71d4d75bb3b4dca632407L488, thecode in Ogre1 and Ignition Citadel is not affected by this problem, so no other PRs are required:
Other parts of the code can be improved (the warning should be printed again if a SetAliasing with a different value is called or a SetAliasing on a different instance, why the aa value is hardcoded to 1 if 0 is actually selected). However, this problems can be discussed in a separated issue, as the point of this PR is to fix gazebosim/gz-sim#1116 with minimal modifications. |
Codecov Report
@@ Coverage Diff @@
## ign-rendering6 #661 +/- ##
==================================================
- Coverage 54.95% 54.93% -0.02%
==================================================
Files 202 202
Lines 21102 21102
==================================================
- Hits 11596 11592 -4
- Misses 9506 9510 +4
Continue to review full report at Codecov.
|
FYI @srmainwaring as you recently modified this code in #470 . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me, thanks for the fix.
@traversaro thanks! Checked this on an Ubuntu 22.04 VM (VMware Fusion) and running fine under llvmpipe (LLVM 13.0.1). |
The Ogre2RenderTarget::TargetFSAA method has a logic to check if the selected antialiasing level is supported.
If the requested antialiasing level is not supported, the 0 level is selected instead. Furthermore, a warning is printed only once for process. Before this PR, the 0 level was only set only when the warning was printed, resulting in an unsupported antialiasing being set if Ogre2RenderTarget::TargetFSAA was called two or more times.
🦟 Bug fix
Fixes gazebosim/gz-sim#1116 .
Summary
Before this fix, running
LIBGL_ALWAYS_SOFTWARE=1 ign gazebo shapes.sdf --verbose
with a recent enough mesa (for example the one provided by default in Ubuntu 22.04) resulted in a black screen in the render area. With this fix, everything works is rendered correctly.Checklist
codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining
Signed-off-by
messages.