Jump to content

how to save the world in Non-editor mode


photo

Recommended Posts

IF not in editor mode(run bin/myProj.exe directly),  a call to Console::get()->run("world_save") will not save ObjectMeshStatic Objects that was inserted by program.

How can i save current world into .wolrd file with newly created objects in non-editor mode?

Link to comment

Hi Znang,

 

If you want to save nodes into the world file they should be added via Editor::addNode() method first. Please, take a look at the sample in SDK Browser in C++ API -> Systems -> Editor.

 

You also can check documentation about memory managment about node's owning: https://developer.unigine.com/en/docs/2.3/code/fundamentals/memory_management#editor

 

Thanks!

  • Like 1

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment

Hi silent,

 Add nodes to editor solved that problem.

But Only ObjectMeshDynamic will save its geometric(vertices and indices) information, ObjectMeshStatic won't.

In our program, we create Mesh and Use it to create ObjectMeshStatic to achieve maximum render speed.

Is there some way i can save geometric information into .world file that stored in ObjectMeshStatic?

Or, does ObjectMeshStatic renders as fast as ObjectMeshDynamic do?  if so, we can use ObjectMeshDynamic anywhere.

Thanks!

Link to comment

I currently construct mesh with our data, then save it to mesh file,  then i create ObjectMeshStatic to load the file.

But this is not efficiency, and may cause other troubles.

Any better solutions?

Link to comment

Hi Zhang,

 

Is there some way i can save geometric information into .world file that stored in ObjectMeshStatic?

No, there is no such possibility.

 

In our program, we create Mesh and Use it to create ObjectMeshStatic to achieve maximum render speed.

To render all your mesh data it should be copied first from HDD to RAM then to GPU memory. Keeping vertex data in *.world file will not give you any performance boost, since this file will be also copied from HDD to RAM first.

 

 

Or, does ObjectMeshStatic renders as fast as ObjectMeshDynamic do?  if so, we can use ObjectMeshDynamic anywhere.

ObjectMeshDynamic with IMMUTABLE_ALL flag passed to constructor should be as fast as ObjectMeshStatic. But it's hard to say what overall performance you will get. You can try to use both varians (with static and dynamic meshes) and then select one that will give you desired results.

 

More information about dynamic meshes usage you can find in the following article: https://developer.unigine.com/en/docs/2.3/code/uniginescript/usage/dynamic_meshes/

 

Thanks!

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment
×
×
  • Create New...