Jump to content

Need an idea for progress display


photo

Recommended Posts

Posted (edited)

Hi.

I'm working with ObjectTerrainGlobal.

Modifying height maps, normal maps and detail masks at runtime. My problem is that saveAll() function of TileSet class is running slow thus it freezes main thread no letting any gui updates.

What i want to do is to add some progress bar to let user know that this operation takes long time to complete, just simple hanging is not acceptable. In general it would be very useful to have some sort of function to force engine to render gui from child thread (or atleast from main thread) to display the progress of any operations that take a long time. Any advices?

Edited by smirnov.oleg
Posted

So is that ok to call saveAll() function of TileSet class from another thread? Or can i do world intersections from another thread?

Posted

Hello Oleg,

Internal structures of tileset are protected by mutex so calling saveAll from a worker thread should be ok. Synchronization may lead to performance overhead though.

It's not so easy with world intersections since objects can be deleted from the main thread or objects movement can lead to the spatial structures update. May be fine if nothing changes in the world.

Posted

Alright thanks for info Andrey.I was trying to make tile saving in separate thread and had some weird problems with it. It turned out that the problem was different.

×
×
  • Create New...