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

Fix various issues with Ogre2GpuRays #522

Merged
merged 2 commits into from
Jan 5, 2022

Conversation

darksylinc
Copy link
Contributor

There were multiple bugs that had to be fixed:

  • Objects which had no laser_retro set (or an invalid one) would be
    rendered using regular lighting PBS shaders; causing the retro value to
    contain garbage instead of the intended default value of 0
  • Performance regression in 993bb0b:
    When ported to Ogre 2.2, ignition would render the scene 4 times instead
    of 2 (twice for objects, twice for particles). Depth buffer data was
    created through a 2nd redundant pass. This is inefficient as the depth
    buffer data is already available from the 1st pass
  • Bug regression in 993bb0b: In the
    pass for normal objects, ignition would first use IGN_VISIBILITY_ALL
    flags for colour, but it would use 0x01000000 for depth. This creates
    the wrong mix of data because an occluder that had visibility set to
    0x01000000 would use the correct depth but the retro value of the object
    behind it. This bug is implicitly fixed by the previous item (colour and
    depth data are now obtained from the same pass instead of using multi
    pass)
  • PFG_R8_UNORM is nowhere enough to contain all possible laser retro
    values and would quantize too much. Increased precision to PFG_R16_UNORM
  • Affects Potential bug: Wrong value stuck in Ogre2GpuRays #521. The problem is fixed for Fortress by always overriding
    setCustomParameter, but likely the fix should be backported to previous
    versions.

Signed-off-by: Matias N. Goldberg [email protected]

🦟 Bug fix

Affects #521
Fixes other bugs without ticket

Checklist

  • Signed all commits for DCO
  • Added tests
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • 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.

There were multiple bugs that had to be fixed:

- Objects which had no laser_retro set (or an invalid one) would be
rendered using regular lighting PBS shaders; causing the retro value to
contain garbage instead of the intended default value of 0
- Performance regression in 993bb0b:
When ported to Ogre 2.2, ignition would render the scene 4 times instead
of 2 (twice for objects, twice for particles). Depth buffer data was
created through a 2nd redundant pass. This is inefficient as the depth
buffer data is already available from the 1st pass
- Bug regression in 993bb0b: In the
pass for normal objects, ignition would first use IGN_VISIBILITY_ALL
flags for colour, but it would use 0x01000000 for depth. This creates
the wrong mix of data because an occluder that had visibility set to
0x01000000 would use the correct depth but the retro value of the object
behind it. This bug is implicitly fixed by the previous item (colour and
depth data are now obtained from the same pass instead of using multi
pass)
- PFG_R8_UNORM is nowhere enough to contain all possible laser retro
values and would quantize too much. Increased precision to PFG_R16_UNORM
- Affects gazebosim#521. The problem is fixed for Fortress by always overriding
setCustomParameter, but likely the fix should be backported to previous
versions.

Signed-off-by: Matias N. Goldberg <[email protected]>
@github-actions github-actions bot added the 🏯 fortress Ignition Fortress label Dec 26, 2021
@codecov
Copy link

codecov bot commented Dec 26, 2021

Codecov Report

Merging #522 (fa4b52c) into ign-rendering6 (da85b07) will decrease coverage by 0.04%.
The diff coverage is 95.23%.

Impacted file tree graph

@@                Coverage Diff                 @@
##           ign-rendering6     #522      +/-   ##
==================================================
- Coverage           54.44%   54.39%   -0.05%     
==================================================
  Files                 198      198              
  Lines               20107    20084      -23     
==================================================
- Hits                10947    10925      -22     
+ Misses               9160     9159       -1     
Impacted Files Coverage Δ
ogre2/src/Ogre2GpuRays.cc 95.48% <95.23%> (-0.01%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update da85b07...fa4b52c. Read the comment docs.

Copy link
Contributor

@iche033 iche033 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah now this refreshes my memory of the retro + visibility mask issue.

I think with these changes, we should be able to remove this todo comment about using an even more complicated workaround to fix retro values for objects that do not have one set.
https://github.com/ignitionrobotics/ign-rendering/blob/fa4b52cbe513282b7c2921e28d631d601a6fc318/ogre2/src/Ogre2GpuRays.cc#L910-L919

This is a much better fix.

I'll create a follow-up PR to remove this todo item and add a small check in the integration test for zero retro values.

@iche033 iche033 merged commit 1505138 into gazebosim:ign-rendering6 Jan 5, 2022
@iche033 iche033 mentioned this pull request Jan 5, 2022
7 tasks
@osrf-triage
Copy link

This pull request has been mentioned on Gazebo Community. There might be relevant details there:

https://community.gazebosim.org/t/new-ignition-releases-2022-03-01-citadel-edifice-fortress/1313/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏯 fortress Ignition Fortress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants