[FEAT] Allow for multiple Panda3D renderers at the same time or sequentially #1524
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 allows the user to have multiple separate Panda3D renderers at the same time. A basic use case for this is to have a renderer for tracking, and another for augmented reality display.
This is done by through the following changes:
PandaFramework
which manages the global Panda context. The framework is destroyed and closed at the end of the program. It is initialized when the firstvpPanda3DBaseRenderer
callsinitFramework
.WindowFramework
. A window framework can be used to create offscreen buffers and each framework has its own context through aGraphicsStateGuardian
(GSG). All the offscreen buffers created from a single WindowFramework share the same GSG and callingrenderFrame
for a single GSG will render all offscreen buffers.renderFrame
for a single vpPanda3DBaseRenderer, all the gsg that are not tied to this renderer are disabled. This means that the GPU does not have to rerender everything everytime, butrenderFrame
should be called for all separate renderers.