Quantcast
Channel: Questions in topic: "webgl"
Viewing all articles
Browse latest Browse all 2390

why is my javascript to webgl communication so slow for a large string

$
0
0
I'm trying to send a 1000 character data string back and forth from javascript to webgl. In my tests so far it takes about 500 ms to send 30 of them back and forth. Why is communicating between js and unity so slow? Is there any way to speed this up? Webpage javascript: var bigstring= 1000 character string; function Start(){ JSMessageFromUnity(bigstring); } var counter=0; function JSMessageFromUnity(s){ counter+=1; if(counter>30)return; SendMessage("main","UnityMessageFromJS",s); } UnityScript: function UnityMessageFromJS(s:String){ Application.ExternalEval("JSMessageFromUnity('"+s+"')"); }

Viewing all articles
Browse latest Browse all 2390

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>