-
Notifications
You must be signed in to change notification settings - Fork 51
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
[Metal] update custom_shaders_uniforms example #554
[Metal] update custom_shaders_uniforms example #554
Conversation
@iche033 this PR is an intermediate step to getting the waves example working as it doesn't depend on textures. Main design input I'd like is the best way to select the graphics API being used in |
- Add metal shaders to the custom_shaders_uniforms example - Set reflection pair hint for Metal pixel shaders to ensure params are set Select materials shader language depending on graphics API - Add a GraphicsAPI property to the private data of Ogre2Material - Switch the language used for the GPU program depending on the API - Set the default API to OpenGL. - To do: missing a method to set the graphics API when creating a material Signed-off-by: Rhys Mainwaring <[email protected]>
7f1c4b0
to
cf94549
Compare
- Remove trailing whitespace Signed-off-by: Rhys Mainwaring <[email protected]>
Codecov Report
@@ Coverage Diff @@
## main #554 +/- ##
==========================================
- Coverage 53.18% 53.14% -0.05%
==========================================
Files 213 213
Lines 21200 21216 +16
==========================================
Hits 11276 11276
- Misses 9924 9940 +16
Continue to review full report at Codecov.
|
how about adding an accessor function to get the |
Yes that works for me, the variable is already available in the private data. I'll have to check if Ogre2Material has access to the render engine as well. |
I think you should be able to get the engine by doing:
|
- Add an accessor to the Ogre2RenderEngine to retrieve the graphics API - Use the new interface to select the shader language in Ogre2Material Signed-off-by: Rhys Mainwaring <[email protected]>
There is a compile error in CI due to conflict between enum and function name. This fixes the issue for me: patchdiff --git a/ogre2/include/ignition/rendering/ogre2/Ogre2RenderEngine.hh b/ogre2/include/ignition/rendering/ogre2/Ogre2RenderEngine.hh
index c1ee131b..a1a69867 100644
--- a/ogre2/include/ignition/rendering/ogre2/Ogre2RenderEngine.hh
+++ b/ogre2/include/ignition/rendering/ogre2/Ogre2RenderEngine.hh
@@ -216,7 +216,7 @@ namespace ignition
/// \brief Get the render engine's graphics API
/// \return The graphics API enum class
- public: GraphicsAPI GraphicsAPI() const;
+ public: rendering::GraphicsAPI GraphicsAPI() const;
/// \brief Pointer to the ogre's overlay system
private: Ogre::v1::OverlaySystem *ogreOverlaySystem = nullptr; |
- Resolve enum / function name conflict Signed-off-by: Rhys Mainwaring <[email protected]>
Updated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me!
This PR adds metal shaders to the custom_shaders_uniforms example.
🎉 New feature
Enhances #520
Summary
Ogre2Material
is modified to specify the render system being used when creating the GPU programs.Ogre2RenderEngine
Test it
Run the example using
ogre2
and specifyingmetal
as the graphics API:Checklist
codecheck
passed (See contributing)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.