Add render engine extension to control load order of render plugins #61
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 theRenderEngineManager
and associated classes to manage the loading and lifetime of render extension plugins. TheWavesVisual
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 customVisual
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.