• Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by JackFalcon

  1. Here it is (in a nice little pattern): scene.registerBeforeRender(function someCallback() { if(done){ scene.unregisterBeforeRender(someCallback); } }); solved.
  2. Ok, maybe got it... scene.unregisterAfterRender(unregister);
  3. Hi. Too easy. Anyone have a link to an example of how to deregister a beforeRender or afterRender callback? looking for a good pattern... Or unregister...? Thx.
  4. rudimentary stats... TEST DESCRIPTION: rotating parent with gradual increasing number of children(30,60,90) for each rotation, step-interpolation = 0.02, on a closed-circuit track. BASELINE NO-PERF-OPS 3 CONTROL-TESTS: TIMESTART: START-ANIMATION TIMESTOP: END-ORBIT = 1867 TIMESTART: START-ANIMATION TIMESTOP: END-ORBIT = 4294 TIMESTART: START-ANIMATION TIMESTOP: END-ORBIT = 6724 OP-TEST-1 visibility = 0 3 COMPARISON-TESTS: TIMESTART: START-ANIMATION TIMESTOP: END-ORBIT = 1937 TIMESTOP: END-ORBIT = 4237 TIMESTOP: END-ORBIT = 4679 OP-TEST-1 RESULTS: Within variance, visibility = 0 for hidden mesh, reduces orbit time ~2 seconds on third rotation (HOO-RAY). QUESTION: which is better visibility or setEnabled(false)? Bird should read source code, or... TEST: replace vis =0 to setEnable(false) in the same loops... TIMESTART: START-ANIMATION TIMESTOP: END-ORBIT = 1917 TIMESTOP: END-ORBIT = 4227 TIMESTOP: END-ORBIT = 4778 RESULTS: Interesting - visibility is slightly faster (within variance). Didn't expect that. Bird should read source code. NOTE: couldn't use setElement(false) at parent level because in context need parent to remain visible, and only children hidden. NEXT-STEPS: Not going to do LOD test, sticking with simple visibility op for the moment. Instances not applicable. This is solved. Maybe more PERFOPS later. Hope this helps someone.
  5. Also in optimization phase and ran across this simultaneously... https://blog.raananweber.com/2015/09/03/scene-optimization-in-babylon-js/ friend @RaananW says crystal clear: So hooray, bird on topic (marks on calendar) : ) Hit jRad with the similar question about a year back, on run-time vertex editing utility.... @BMWPilote Maybe that helps you. Are Instances applicable? https://doc.babylonjs.com/how_to/how_to_use_instances Or LOD?: https://doc.babylonjs.com/how_to/how_to_use_lod https://doc.babylonjs.com/how_to/in-browser_mesh_simplification cheers!
  6. Ok, Put in TIMESTAMPS ... gotta go. Thanks to who'ever made dude. Here is adapted timestamp utility, to easily measure performance anywhere: //TIMER var timeStamp = 0; var currentTimeStamp = 0; var timeReport = function(testname){ console.log('TIMESTART: '+testname); if(!timeStamp){ timeStamp = new Date().getTime(); } return function (testname) { currentTimeStamp = new Date().getTime(); var timeDelta = currentTimeStamp - timeStamp; console.log('TIMESTOP: '+testname+' = '+timeDelta); timeStamp = null; } } //EXAMPLE-USAGE-. // var debugTimeStop = timeReport('START Time Test'); // debugTimeStop('END Time Test'); Statistics pending...
  7. Statistics -->great idea<-- Thank you setEnabled(true) insight! TINY-UPDATES: - the code below worked well as first pass rough-in. RESULTS: performance improvement achieved! (ding). - Will try setEnabled... on parents - -> But had interesting PROBLEM: need parent setEnabled(true) AND children setEnabled(false)???<-- anyway... : ) - Hello LOD! too. - Probably date.now all three [hope] (BZ thx). reloadLevel = function(){ for(var i=0; i<edges.length; i++){ edges[i].visibility = 1; } for(var i=0; i<orbs.length; i++){ orbs[i].visibility = 1; } for(var i=0; i<boxes.length; i++){ boxes[i].visibility = 1; } for (var i=0; i<tiles.length; i++){ tiles[i].visibility = 1; } } unloadLevel = function(){ for(var i=0; i<edges.length; i++){ edges[i].visibility = 0; } for(var i=0; i<orbs.length; i++){ orbs[i].visibility = 0; } for(var i=0; i<boxes.length; i++){ boxes[i].visibility = 0; } for (var i=0; i<tiles.length; i++){ tiles[i].visibility = 0; } }
  8. Question about setEnabled(false). Is it better performance than visibility = 0 ? And wondering what is the difference? If 1 mesh is rotating 10 children, and 5 can be hidden - which is more performant: visibility or setEnabled(false); I'll test it.... Lots of reading. Thanks!
  9. let you_guys = 'heros'; Because of this, was able to figure out alpha opacity on a sine wave for a shader-fader. Not perfect, but pretty cool for a rookie. : ) Hope it helps someone. http://www.babylonjs-playground.com/#16UICJ#9
  10. "binary encoded packet"... excellent! And multi-player tip very helpful. Thank you.
  11. Super cool, and.booking vacation. : ) Curious, about that websocket, babylon node server, (examples or link)... How does that render out?
  12. HighlightLayer.removeAll() would be really helpful. Because -> glows all the things.
  13. 🏆 The bird likes to learn. Asks boss, says "later".
  14. Rewritten... animation-configuration-objects can be put in a single array, var anmScript = [anm1, anm2, anm3,...]; ...triggered at run-time. : ) BABYLON.animation(anm1); token animations - give single line animation loops,: BABYLON.animation({attr:'opacity',to:0, from:0, done:fn(){]); And single-line animation loops is what makes ....animation-factories. UPDATED.
  15. BABYLON.animate( {src:{}, attr:'', from:0, to:10, done:fn(){} } ); //compact single-line interpolation factory syntax. : )
  16. @Pryme8 links are - radical. Yes read/edit/review, after steam release next monthish. : )
  17. Wingy, check this out... how to make translucent thick dashed lines in a circle? Related to GUIMeter, but along lines of COMBINATION-LOCK.... https://codepen.io/yuanchuan/pen/KyJvmo UPDATE: had trouble getting line:width, thick translucent line would have been cool. Hello ribbon or tube, or...? ~GUILOCK1(http://www.babylonjs-playground.com/#XX54TW#3)
  18. @Pryme8, for use in the future... "take your indices clone it to a new array, reverse the array, and concat it to the original indices array, then update vertex data." 🏆
  19. Nice option, tried it, and failed. But reading your steps carefully... I didn't clone the indices, and then update vertex data. Makes sense. Will try someday. Thx. Out of likes for the day.... The variation I tried was to create a new plane DOUBLESIDED, maybe that would work to do that then update vertex data? Worth a try. Not sure if it needed reverse or not.
  20. ! @Gijs and @jerome, didn't see you respond. Tips are excellent! Thank you for confirming variation on geometry, had no clue. : ) Makes sense. SOLUTION: Because the context involved blender-import, as usual, solution involves a BLENDERFIX. Tried 3 things: 1) checkbox for BackFaceCulling (unchecked) === seemed to have no effect. 2) Add Modifier -> SOLIDIFY -> Apply (for each plane) in edit mode === it works, but changed rendering, because geometries changed.... 3) Found Vertex Data Object -> checkbox -> DOUBLESIDED trying that... === seemed to have no effect. SOLUTION: going with solidify. : )
  21. ~ Awesome insights @ozRocker and @JCPalmer... All tests in this thread were: Google PIXEL, Android, and MS Surface. Did not see those errors.
  22. ...diving-in. great stuff @Pryme8 How do you do it? Workflow tips? Or, how do you reduce problem into functions? Etc. Please, need more info! : ) The single complete and grammatical sentence (above) dedicated to @Wingnut... Trying!