cinetec_tech Posted January 2, 2015 Posted January 2, 2015 hi: We currently have a situation and hope there is an answer. 1:the engine fps is fixed at 60 fps 2:we need read a network streaming at let's say 100fps. Is there any way in the script to make a thread running at higher frequency than engine? Async seams only for slower ones. thanks
ulf.schroeter Posted January 2, 2015 Posted January 2, 2015 Can you explain the reason for a higher data update frequency than rendering frequency ? As a single or multiple data updates between render frames will only be visible with the next render frame your approach does not really make sense for me at the moment. Also async data handling will for sure complicate data synchronization/aggregation. Nevertheless if such a behavior is unavoidable, the only idea comming to my mind is usage of physics flush callback. Normally physics calculations run at a lower frequency than rendering, but it might be possible to increase the physics calculation frequency to higher values if the required physics calculations are no bottleneck. Not sure if this will work....
cinetec_tech Posted January 3, 2015 Author Posted January 3, 2015 thanks Ulf for the suggestion. our situation is that the sender is sending message to unigine at 100fps. and if unigine update at 60fps, it will be a huge latency to respond to the message. I found if both running at 100fps , the latency is not appear. but if unigine runing at 60fps , the latency could be almost half second. i guess one solution is to make the sender runing at 60fps too. but ideally , if unigine could have a thread update at it's own higher frequence. that will solve the problem
unclebob Posted January 7, 2015 Posted January 7, 2015 Hi there! I have a few suggestions for you: 1) If you're bound to UnigineScript then it's possible to set physics fps to 100 and receive/send/sync data in flush. It's weird way but it may work for you if your app isn't physics heavy. 2) You can write custom C++ plugin, create thread in C++ and Unigine::Socket instance (consider this as platform independent wrapper) so you'll be able to sync your data properly. 3) Try to turn off vsync and limit render fps to 100. 4) Set you network sender to 60 fps.
Recommended Posts