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 multiple ray queries #666

Merged

Conversation

iche033
Copy link
Contributor

@iche033 iche033 commented Jul 11, 2022

🦟 Bug fix

Alternative to #665

Summary

This attempts to reuse the same texture for doing ray queries via selection buffer.

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.

@codecov
Copy link

codecov bot commented Jul 11, 2022

Codecov Report

Merging #666 (20af96b) into hidmic/one-selection-buffer-per-camera (5196afa) will increase coverage by 0.00%.
The diff coverage is 100.00%.

❗ Current head 20af96b differs from pull request most recent head 4416657. Consider uploading reports for the commit 4416657 to get more accurate results

@@                           Coverage Diff                           @@
##           hidmic/one-selection-buffer-per-camera     #666   +/-   ##
=======================================================================
  Coverage                                   53.58%   53.59%           
=======================================================================
  Files                                         214      214           
  Lines                                       21421    21423    +2     
=======================================================================
+ Hits                                        11479    11482    +3     
+ Misses                                       9942     9941    -1     
Impacted Files Coverage Δ
ogre2/src/Ogre2SelectionBuffer.cc 93.06% <100.00%> (+0.05%) ⬆️
include/gz/rendering/base/BaseGaussianNoisePass.hh 100.00% <0.00%> (+3.33%) ⬆️

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 5196afa...4416657. Read the comment docs.

@@ -222,18 +222,24 @@ void Ogre2SelectionBuffer::CreateRTTBuffer()

Ogre::TextureGpuManager *textureMgr =
ogreRoot->getRenderSystem()->getTextureGpuManager();
std::string selectionTextureName = "SelectionPassTex";
Copy link
Contributor

Choose a reason for hiding this comment

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

name is different. is this wrong ? "SelectionPassTex" + this->dataPtr->camera->getName(), ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh that's on purpose. The idea is to use the same texture for all ray queries.

EXPECT_EQ(math::Vector3d::Zero, result2.point);
EXPECT_LT(result2.distance, 0.0);
EXPECT_EQ(0u, result2.objectId);
EXPECT_FALSE((result2));
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
EXPECT_FALSE((result2));
EXPECT_FALSE(result2);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done. e9d8ea4

src/RayQuery_TEST.cc Outdated Show resolved Hide resolved
Signed-off-by: Ian Chen <[email protected]>
Copy link
Contributor

@ahcorde ahcorde left a comment

Choose a reason for hiding this comment

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

warnings are unrelated to this PR

Copy link
Contributor

@hidmic hidmic left a comment

Choose a reason for hiding this comment

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

@iche033 I tested this locally and it works just fine.

Thanks!

ogre2/src/Ogre2SelectionBuffer.cc Outdated Show resolved Hide resolved
@iche033 iche033 merged commit 11ca3bf into hidmic/one-selection-buffer-per-camera Jul 13, 2022
@iche033 iche033 deleted the iche033/multiple_ray_queries branch July 13, 2022 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants