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

Do not overwrite reserved visibility flags in ogre2 (Fortress) #783

Merged

Conversation

darksylinc
Copy link
Contributor

🦟 Bug fix

No particular ticket issued for this bug.

Summary

Calling Sensor::SetVisibilityMask in ogre2 with bits 31 or 30 set (which are reserved by OgreNext) would cause wrong rendering.

PR #760 already tries to fix this issue on a localized problem: heightmap in lidar.

This is the general solution.

This PR simply uses PassSceneDef::setVisibilityMask instead of directly setting PassSceneDef::mVisibilityMask to mask out the reserved flags.

Ogre2Camera::setVisibilityMask has been modified to warn when the reserved flags are set.

Other cameras (e.g. Lidar's Ogre2GpuRays) won't warn though, since they don't derive from Ogre2Camera. I cannot add such warning without breaking the ABI.

Checklist

  • Signed all commits for DCO
  • Added tests
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

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.

OgreNext has CompositorPassSceneDef::setVisibilityMask to prevent
overwriting reserved flags.

If user calls gz::Camera::SetVisibilityMask with the reserved flags set,
wrong rendering could happen.

Signed-off-by: Matias N. Goldberg <[email protected]>
@darksylinc darksylinc changed the title Do not overwrite reserved visibility flags in ogre2 Do not overwrite reserved visibility flags in ogre2 (Fortress) Dec 10, 2022
@github-actions github-actions bot added the 🏯 fortress Ignition Fortress label Dec 10, 2022
@codecov
Copy link

codecov bot commented Dec 10, 2022

Codecov Report

Merging #783 (710e666) into ign-rendering6 (b3df123) will decrease coverage by 0.01%.
The diff coverage is 82.35%.

❗ Current head 710e666 differs from pull request most recent head c9256c1. Consider uploading reports for the commit c9256c1 to get more accurate results

@@                Coverage Diff                 @@
##           ign-rendering6     #783      +/-   ##
==================================================
- Coverage           77.85%   77.84%   -0.02%     
==================================================
  Files                 146      146              
  Lines               13404    13409       +5     
==================================================
+ Hits                10436    10438       +2     
- Misses               2968     2971       +3     
Impacted Files Coverage Δ
ogre2/src/Ogre2Camera.cc 87.86% <25.00%> (-1.49%) ⬇️
ogre2/src/Ogre2DepthCamera.cc 88.37% <100.00%> (ø)
ogre2/src/Ogre2GpuRays.cc 95.52% <100.00%> (+<0.01%) ⬆️
ogre2/src/Ogre2RenderTarget.cc 86.33% <100.00%> (ø)
ogre2/src/Ogre2SelectionBuffer.cc 93.06% <100.00%> (ø)
ogre2/src/Ogre2ThermalCamera.cc 88.60% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@iche033 iche033 merged commit 090d079 into gazebosim:ign-rendering6 Dec 12, 2022
iche033 added a commit that referenced this pull request Dec 12, 2022
This is the same as PR #783 but targeting Garden, which needs additional changes (Ogre2GpuRays) that could be easily missed when merging Fortress into Garden.

Signed-off-by: Matias N. Goldberg <[email protected]>
Co-authored-by: Ian Chen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏯 fortress Ignition Fortress
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants