-
Notifications
You must be signed in to change notification settings - Fork 195
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
Multi-scene support #160
Comments
Hi, Is that mean, that we could have ways for example, to manage the preload/unload from a transition from one scene to the other? (as for background loading of scenes, for seamless levels). |
I mean preview windows like in the Inspector in an editor, where you can see a 3D model, or a material in separate window, purely for preview purposes. Loading scenes in the background should already be supported using the async loading feature, although I haven't properly tested that yet so it might need some tweaks. I will be enabling async scene loading in the editor fairly soon, for purposes of testing this feature as well as making editor handle scene loading without freezing the GUI. |
This would be useful for multi-monitor games where each monitor can be a different, totally unrelated, scene. E.g. a map view on one screen, part editor (e.g. mech lab from various Mechwarrior titles, vehicle assembly building from kerbal space program) on a second, and direct character control on a third. |
I also very much need this feature. So far I'm only using the rendering part so I don't need the physics or audio part of this issue to be fixed. I'm trying to workaround the limitations of a single scene by using layers, but for example, lights, seem to not have a method for setting the layer they are on. |
Hey - Just thought I would chime in on the physics side of things. May be worth looking into shifting the scene origin. Since Banshee already uses PhysX we could use the built in function for shifting the scene origin. :) https://docs.nvidia.com/gameworks/content/gameworkslibrary/physx/guide/Manual/OriginShift.html |
Origin shifting in PhysX can be expensive and "recommend to use it only in the case where distance related precision issues may arise in areas far from the origin.", not to mention the other issues it would cause in specifying offsets everywhere, and doesn't solve the issue of multiple scenes, as origin shifting adjusts the whole scene. I think it would be ideal to have all APIs associated with the scene, instead of more global like functions where you specify a scene id, this would help create a more clear ownership relationship for scene related systems, it potentially requires more rearchitecting of things but worth the additional cost. |
Physics system was already refactored to support multi-scene, with most of the global API moved to What is left is the renderer, which also mostly supports multi-scene, and then it's just a matter of exposing all this to the user through scene objects and the scene manager. |
Add the ability to have multiple separate scene hierarchies loaded at once. This is useful for tools/editors that need to have preview boxes and similar. Currently similar functionality can be achieved by using layers for rendering/physics filtering but a multi-scene approach would be more intuitive to use and would provide better and less error-prone design.
The implementation would likely involve:
SceneManager
to support multiple scene roots. EachSceneObject
should be aware in which scene they are in using somesceneID
. We will likely want to prevent scene objects being moved across scenes (as this will likely cause implementation complications with the backend systems and user can just clone the objects nearly as easily if required).Renderer
,Physics
and perhapsAudio
.Renderer
- Renderer internally already works using the concept of scenes throughRendererScene
. currently there is only one ever allocated but it should be simple enough to create multiple (SeeRenderBeast
).Renderer::notify*
methods should then be modified so they work on objects in the appropriate scene using thesceneID
.sceneID
should probably be part of theSceneActor
class since all renderer related objects implement it, and it can be taken from the relevantSceneObject
. Then when rendering just iterate over all scenes and things should hopefully just work.Physics
- PhysX internally support scenes, but similarly to the renderer we only currently ever create one. This needs more investigating but a likely approach is similar to the renderer - propagatesceneID
with relevant physics objects (likely once again throughSceneActor
) and then just add objects to different scenes based on the ID. Collision filtering and reporting might need tweaks so they also work on per-scene basis. Scene queries will likely need an additionalsceneID
parameter as well.Audio
- Potentially no modifications required, or limit the audio to just one scene.The text was updated successfully, but these errors were encountered: