tranlong021988 Posted January 2, 2017 Share Posted January 2, 2017 Hi everyone and happy new year 2017! Hope that this will be great year for all of us ! I'm building my personal porfolio web site using Boostrap and BabylonJS, thank for this wonderful engine, my progress come faster than my imagine. It's still not finished, but you can visit here: http://dragonmakeit.com/ I 'm finding best solution for optimiztion case. Til now, I applied some of recommended solution from community, such as texture size limitation, freeze Normal, freeze Material, disable anti-alias and then result look good but I notice that rendering process burn my Nexus 6 a little bit. I'm using ArcRotateCamera, so I wonder how to force engine just update rendering when getting interaction from user, (start updating render when user mouse down and then stop updating after mouse up). DO you have any idea ? sorry my poor English. Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted January 2, 2017 Share Posted January 2, 2017 Maybe putting some checking in your render loop function to bail when "nothing" has changed, and use the last render generated. How you determine "something" I cannot help you with. Quote Link to comment Share on other sites More sharing options...
tranlong021988 Posted January 3, 2017 Author Share Posted January 3, 2017 Actually, I already apply a flag variable to manage when run render loop, but it's only for wall view situation. I want to mange when user drag-drop camera around room. Ofcourse I can catch mouse event to determine user interaction, but ArcRotateCamera have a little glide after drop(smooth animation), do you know any way to disable it ? Quote Link to comment Share on other sites More sharing options...
iiceman Posted January 3, 2017 Share Posted January 3, 2017 That property is called "inertia" and you can set it to 0 but that's probably not what you want because it somehow feels weird ... example: http://www.babylonjs-playground.com/#1LKJPI#0 Maybe you can simply check if your camera is still moving by comparing its position to a saved previous position: http://www.babylonjs-playground.com/#1OQIXC#0 .. and then combine that with the user input check. Pryme8 1 Quote Link to comment Share on other sites More sharing options...
tranlong021988 Posted January 3, 2017 Author Share Posted January 3, 2017 6 hours ago, iiceman said: That property is called "inertia" and you can set it to 0 but that's probably not what you want because it somehow feels weird ... example: http://www.babylonjs-playground.com/#1LKJPI#0 Maybe you can simply check if your camera is still moving by comparing its position to a saved previous position: http://www.babylonjs-playground.com/#1OQIXC#0 .. and then combine that with the user input check. changing "inertia" to zero cause slow animation dragging on camera. Solution #2 seem promise, I will do some test. Thank you. Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted January 3, 2017 Share Posted January 3, 2017 Um, ok top of the head never start the engine (or start it then disable everything) and then do not attach camera controls, but do attach a mouse down event to the document that fires the engine render to turn on (or enable everything) and enables the camera controls, then on mouse up grab the context of the canvas and then shut down the engine maybe and turn off the camera controls, then place a canvas over the area and put the context you stored into the new canvas? some of that might be overkill like the secondary canvas... which you would want to ignore all pointer event on so it does not cover the scene canvas for noise events. And Turing off and on the engine I have no idea what the results of it would be. It would prolly be smarter just to enable or disable all elements as opposed to toggling the engine. any questions let me know this is possible though. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.