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

Add render engine extension to control load order of render plugins #61

Merged
merged 1 commit into from
Aug 15, 2022

Conversation

srmainwaring
Copy link
Owner

@srmainwaring srmainwaring commented Aug 11, 2022

This PR adds the ability to control the order in which the rendering extension code in the WavesVisual plugin is loaded. The Ogre2 dependent code in the WaveVisual plugin is moved into a rendering plugin library which removes the need to directly link the system plugin to the ogre2 render engine.

Details

We use the same approach as gz-rendering, using copies of the RenderEngineManager and associated classes to manage the loading and lifetime of render extension plugins. The WavesVisual plugin links against abstract base classes that are implemented by render engine specific extension plugins.

The render extension provides access to an abstract SceneNodeFactory class which provides methods to create the render extension objects needed by the waves rendering code (namely a custom Visual object and a class to load dynamic textures for custom shaders).

Testing

There are two ocean rendering approaches: dynamic geometry using HlmsPbs and dynamic texture using a custom shader that applies a displacement map to the vertices. Before this change, when running the dynamic geometry example on a M1 mac (arm64), it was necessary to load the client process first then the server to avoid a crash resulting from an invalid scene pointer. The custom shader example did not work at all. Both examples now work correctly (server / client start order is not important).

The examples also run on an Ubuntu VM using llvmpipe software rendering.

Update component name IgnOGRE2 -> GzOOGRE2
- Required by upstream changes to gz-cmake3.

Signed-off-by: Rhys Mainwaring <[email protected]>

Add local copy of deformable_sphere for testing shader params (DO NOT MERGE)

Signed-off-by: Rhys Mainwaring <[email protected]>

Update plugin name in deformable sphere model
- Use post-migration naming conventions

Signed-off-by: Rhys Mainwaring <[email protected]>

Add TestVisual plugin to isolate cause of visual plugin loading issue

Signed-off-by: Rhys Mainwaring <[email protected]>

Add interface and base classes for the OceanVisual and OceanGeometry
- Factor out interfaces to rendering visual and geometry extension classes
- Preparation for creating extension plugins

Signed-off-by: Rhys Mainwaring <[email protected]>

Add classes to load and manage render engine extensions
- Initial versions of render engine extension classes based on equivalents from gz-rendering

Signed-off-by: Rhys Mainwaring <[email protected]>

Add waves render engine extension for ogre2
- Add BaseRenderEngineExtension
- Add Ogre2RenderEngineExtension
- Remove deprecated search paths from RenderEngineExtensionManger
- Set up registration of default extensions (specify library path)
- Update WavesVisual to load extensions in OnUpdate before continuing with the render steps

Signed-off-by: Rhys Mainwaring <[email protected]>

 Add waves render engine extension for ogre2
- Add Ogre2OceanScene and extract interface
- Add OceanScene method to the RenderEngineExtension and implement in Ogre2RenderEngineExtension
-  Update WavesVisual to use new interface classes

Signed-off-by: Rhys Mainwaring <[email protected]>

Add class DisplacementMap to manage displacement textures
- Add class DisplacementMap to store displacement textures and manage the update
- Move Ogre2 specific code out of WavesVisual

Signed-off-by: Rhys Mainwaring <[email protected]>

Add class DisplacementMap to manage displacement textures
- Create interface class for displacement maps
- Add interface to render engine extensions
- Use extension to create the displacement map in WavesVisual
- Remove all direct Ogre2 dependencies from WaveVisual (only linkage is via plugin at runtime)

Signed-off-by: Rhys Mainwaring <[email protected]>

Ensure graphicsApi is checked correctly
- Using the render engine instance directly gives an incorrect result. This suggests an issue with the singleton template?
- Check the underlying render engine is available and loaded when loading an extension.

Signed-off-by: Rhys Mainwaring <[email protected]>

Add fixes for linux
- Fix case on includes
- Update link dependencies

Signed-off-by: Rhys Mainwaring <[email protected]>

Ogre2.2 -> Ogre2.3
- Gazebo Garden is being released against Ogre2.3

Signed-off-by: Rhys Mainwaring <[email protected]>

Rename OceanScene to SceneNodeFactory
- Choose better name for factory object
- Update file headers
- Add translation unit anchors for abstract base classes
- Remove commented code

Signed-off-by: Rhys Mainwaring <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant