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

Update Metal depth camera and selection buffer shaders to match #446 #498

Merged

Conversation

srmainwaring
Copy link
Contributor

🦟 Bug fix

Apply #446 to Metal shaders

Summary

This PR applies #446 to Metal shaders and updates them to use the Metal equivalent of OpenGL's texelFetch (which is texture.read()). Previously the depth camera and selection buffer Metal shaders were using a standard texture sampler accepting normalised coordinates and ignored the texture resolution uniform parameter.

Testing

Currently there are no automated tests for the Metal shaders. Tested manually using the ogre2demo and mouse_picking examples and also ign gazebo (by cherry-picking this change into main to build the gui and gazebo libraries).

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

…ebosim#446

- Add new param colorTexResolution to the selection buffer shader
- Implement the Metal equivalent of texelFetch in the shaders

Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com>
@github-actions github-actions bot added the 🏯 fortress Ignition Fortress label Dec 1, 2021
@codecov
Copy link

codecov bot commented Dec 1, 2021

Codecov Report

Merging #498 (b96bcc9) into ign-rendering6 (0127d13) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@               Coverage Diff               @@
##           ign-rendering6     #498   +/-   ##
===============================================
  Coverage           55.53%   55.53%           
===============================================
  Files                 195      195           
  Lines               19697    19697           
===============================================
  Hits                10938    10938           
  Misses               8759     8759           

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 0127d13...b96bcc9. 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.

thanks for catching this. Now that we have metal support in ign-rendering, we could consider setting ogre2 back as the default render engine in our homebrew CI builds and use GraphicsApi::METAL in ign-rendering7

@iche033 iche033 merged commit ae292a8 into gazebosim:ign-rendering6 Dec 1, 2021
@srmainwaring
Copy link
Contributor Author

srmainwaring commented Dec 1, 2021

we could consider setting ogre2 back as the default render engine in our homebrew CI builds and use GraphicsApi::METAL in ign-rendering7

It would be great to have the macOS CI tests running using Metal and ogre2. It might help resolve a number of the open issues for that platform as well.

I have a stash which prototypes adding another environment variable (to set the graphics api) to the list of arguments accepted in the gtests parameter list. Not sure if that's what you have in mind for configuring the CI tests but I can dig it out and submit as a draft PR if you think it's useful.

@srmainwaring srmainwaring deleted the fix/selection-buffer-metal branch December 1, 2021 22:42
@iche033
Copy link
Contributor

iche033 commented Dec 1, 2021

I have a stash which prototypes adding another environment variable (to set the graphics api) to the list of arguments accepted in the gtests parameter list. Not sure if that's what you have in mind for configuring the CI tests

yeah that sounds good. For Ignition Garden / ign-rendering7, now that Metal support is almost fully integrated, I was thinking that we can just set the default API to Metal if we find that the platform is __APPLE__. We can provide an environment variable for users to switch back to OpenGL if they really want to do so on mac.

@srmainwaring
Copy link
Contributor Author

srmainwaring commented Dec 2, 2021

That sounds a bit easier to implement. It's quite nice to be able to test some of examples using the ogre engine and OpenGL, but none of the ogre2 examples work now with Ogre2.2. Other than that defaulting to Metal for __APPLE__ might be the way to go. It would also make the unresolved aspects of switching the graphics API in the ign-gui and ign-gazebo Metal PRs easier to deal with.

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.

2 participants