How to dynamically load big scene with models loaded from custom format files? #1150
-
Hello, I have model files with format .dmd which is not supported neither by vsgconv nor assimp, so I made function that parses them and for each of them creates it's own GraphicsPipilineConfigurator, Commands, StateGroup and finally returns MatrixTransform with stateGroup as a child. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
I'm not familiar with the DMD format. Do you have any links or examples of the data to give us an idea where you are coming from? In general new loaders are best implemented by subclassing from vsg::ReaderWriter as is illustrates by the vsgXchange implementations such as assimp. Do you use a third party library to load the files then convert to the VSG or do you parse the file format yourself? Is DMD something others might find useful as well? If so do you plan to open source your implementation? When you load "500 of these models" what is the nature of them? Are they big models? Do they share textures etc? The vsg::SharedObjects class provides a mechanism for sharing objects between multiple loads - you assign an instance of a vsg::SharedObjects to vsg::Options then the ReaderWriter can utilize this instance when creating graphics pipelines and textures through to whole files. The vsgXchange::assimp utilizes it so have a search for sharedObjects and recommend using it where possible. Sharing as much possible helps lower the CPU and GPU memory requirements and reduces state changes so can have a big impact on performance. |
Beta Was this translation helpful? Give feedback.
-
Oh, the thing is that we have released open-source project: "Russian railway simulator" (https://github.com/maisvendoo/RRS), which now uses OSG for 3d. All the graphics code was written by other person and I was given a task to switch to VSG. Models represent railroads, trains, building and nature along the route. Most part of models have format .dmd that looks like this: It is quite unconvenient because it is practically unknown, unsupported by 3d libraries and it doesn't have any reference on texture (like .obj with .mtl). I thought about making convertator from .dmd to .obj but I was said that it will take very long time to convert all our models that are currently used. Already finished parser of .dmd for OSG you can find here: https://github.com/maisvendoo/osgdb_dmd Rail route definitely have many repeating instances so thanks for mention of vsg::SharedObjects. Will try it. But in any case, rail route by it's nature is large stretched series of models and current OSG implementation uses PagedLOD for their loading. But with VSG I can't understand how it works yet |
Beta Was this translation helpful? Give feedback.
I'm not familiar with the DMD format. Do you have any links or examples of the data to give us an idea where you are coming from?
In general new loaders are best implemented by subclassing from vsg::ReaderWriter as is illustrates by the vsgXchange implementations such as assimp.
Do you use a third party library to load the files then convert to the VSG or do you parse the file format yourself? Is DMD something others might find useful as well? If so do you plan to open source your implementation?
When you load "500 of these models" what is the nature of them? Are they big models? Do they share textures etc?
The vsg::SharedObjects class provides a mechanism for sharing objects between mult…