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

Use selection buffer in ray question (ogre2) - part 2 #383

Merged
merged 13 commits into from
Sep 14, 2021

Conversation

iche033
Copy link
Contributor

@iche033 iche033 commented Aug 19, 2021

🎉 New feature

Summary

This further improves performance of ray queries. As described in #378, there are 2 stages in our ray query implementation. This PR focuses on stage 2. The selection buffer implementation in ogre2 is extended to return depth data which is then used compute the intersection point of user mouse clicks. This replaces the slow CPU based ray-triangle intersection tests in stage 2 of the current ray query implementation.

Note the ray-triangle intersection code is not removed, and can still be used if a selection buffer is not available.

Test it

see gazebosim/gz-sim#969

Checklist

  • Signed all commits for DCO
  • Added tests
  • Added example and/or tutorial
  • 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

Signed-off-by: Ian Chen <[email protected]>
Signed-off-by: Ian Chen <[email protected]>
Signed-off-by: Ian Chen <[email protected]>
ogre2/src/Ogre2RayQuery.cc Outdated Show resolved Hide resolved

/// \brief Ogre pixel box that contains description of the data buffer
public: Ogre::PixelBox *pixelBox = nullptr;

/// \brief The selection buffer material
public: Ogre::MaterialPtr selectionMaterial;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
public: Ogre::MaterialPtr selectionMaterial;
public: Ogre::MaterialPtr selectionMaterial{nullptr};

Copy link
Contributor Author

Choose a reason for hiding this comment

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

looks like Ogre::SharedPtr can't be set or init to nullptr.

ogre2/src/Ogre2SelectionBuffer.cc Outdated Show resolved Hide resolved
ogre2/src/Ogre2SelectionBuffer.cc Outdated Show resolved Hide resolved
Signed-off-by: Ian Chen <[email protected]>
Signed-off-by: Ian Chen <[email protected]>
Signed-off-by: Ian Chen <[email protected]>
Signed-off-by: Ian Chen <[email protected]>
@codecov
Copy link

codecov bot commented Aug 19, 2021

Codecov Report

❗ No coverage uploaded for pull request base (rayquery_selection_buffer@50aefa7). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@                     Coverage Diff                      @@
##             rayquery_selection_buffer     #383   +/-   ##
============================================================
  Coverage                             ?   56.34%           
============================================================
  Files                                ?      147           
  Lines                                ?    14100           
  Branches                             ?        0           
============================================================
  Hits                                 ?     7944           
  Misses                               ?     6156           
  Partials                             ?        0           

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 50aefa7...e77bbd1. Read the comment docs.

Signed-off-by: Ian Chen <[email protected]>
Signed-off-by: Ian Chen <[email protected]>
Signed-off-by: Ian Chen <[email protected]>
@iche033 iche033 changed the title Use seleciton buffer in ray question (ogre2) - part 2 Use selection buffer in ray question (ogre2) - part 2 Aug 30, 2021
@iche033 iche033 added the 🔮 dome Ignition Dome label Sep 8, 2021
@iche033 iche033 merged commit c701da8 into rayquery_selection_buffer Sep 14, 2021
@iche033 iche033 deleted the rayquery_selection_buffer_depth branch September 14, 2021 23:35
iche033 added a commit that referenced this pull request Sep 15, 2021
* testing using selection buffer for rayquery

Signed-off-by: Ian Chen <[email protected]>

* remove commented out code

Signed-off-by: Ian Chen <[email protected]>

* codecheck

Signed-off-by: Ian Chen <[email protected]>

* style

Signed-off-by: Ian Chen <[email protected]>

* Use selection buffer in ray question (ogre2) - part 2 (#383)

* extend selection buffer to return depth

Signed-off-by: Ian Chen <[email protected]>

* selection buffer depth working

Signed-off-by: Ian Chen <[email protected]>

* cleanup

Signed-off-by: Ian Chen <[email protected]>

* style

Signed-off-by: Ian Chen <[email protected]>

* add check for mac

Signed-off-by: Ian Chen <[email protected]>

* Add shaders

Signed-off-by: Ian Chen <[email protected]>

* enable mac test

Signed-off-by: Ian Chen <[email protected]>

* style

Signed-off-by: Ian Chen <[email protected]>

* fix bad merge

Signed-off-by: Ian Chen <[email protected]>

* fix drag and drop

Signed-off-by: Ian Chen <[email protected]>

* fix utils test

Signed-off-by: Ian Chen <[email protected]>

* fix doxy

Signed-off-by: Ian Chen <[email protected]>

* remove comment

Signed-off-by: Ian Chen <[email protected]>
@iche033 iche033 mentioned this pull request Sep 28, 2021
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔮 dome Ignition Dome
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants