• Content count

  • Joined

  • Last visited

About phaselock

  • Rank

Contact Methods

  • Website URL

Profile Information

  1. Announcing Babylon.GUI

    Thanks @Arte, I got it ! So I have a new problem. I have a use case for spherical orbits with dynamic mesh properties that on mouse-over, a gui textblock should display...sort of like an interactive tooltip except used in 3d. To simplify the problem, I used the standard sphere/ground PG, added a timer to the sphere, and a pointermove observable to the scene with a text trigger for the sphere. As expected, upon sphere mouse-over, the pickedpoint will update and the timer value will just show the value at the instance the pointermove evt was fired. Now, I'd like to have the timer value continue counting while the mouse is still over the sphere, like a realtime clock. In usual html cases, realtime counting is done with recursive callbacks. But I've not been able to get it to work and I need help. Has anyone tried to do this yet ? Or are there better methods to use ? Lemme know, thanks!
  2. Announcing Babylon.GUI

    Probably another stupid question, but how do you change the value text of a button when clicked ? I can change other properties just fine, but button.value/button.text isn't letting me alter the words. edit: As usual, found the solution after posting...this streak remains unbroken, go me! -.-"
  3. Announcing Babylon.GUI

    Not sure what happened, but I got this error while working this morning: TypeError: t.getEngine(...).onCanvasPointerOutObservable is undefined I see some work by @Deltakosh on the gui source, something broke ? edit: nvm, I figured it out, slapped myself for inconsistent versions of lib files.
  4. webgl error

    Well, I managed to make it reproducible via window.location.reload(true) with the simplest of scenes (as below). A warning tho, this creates an infinite loading of the same page just to speed things up, so have F12 console viewable as the page reloads. I also tested multiple browser refresh in the basic scene of the PG and got the same result. Hope it helps. <script> window.addEventListener('DOMContentLoaded', function() { function createScene(engine,canvas) { var scene = new BABYLON.Scene(engine); //Adding an Arc Rotate Camera var camera = new BABYLON.ArcRotateCamera("Camera", 0, 0.8, 100, BABYLON.Vector3.Zero(), scene); camera.attachControl(canvas, false); return scene; } var canvas = document.getElementById('renderCanvas'); var engine = new BABYLON.Engine(canvas, true); var scene = createScene(engine,canvas); engine.runRenderLoop(function() { scene.render(); }); scene.dispose(); engine.dispose(); //canvas = null; canvas.remove; console.log("scene disposed? " + scene.isDisposed); window.location.reload(true); }); </script>
  5. webgl error

    I took the PG codes from and modified to add in a 30s timer (zip file) that disposes the scene and engine. You should be able to obtain the snapshot before timer runs out. Also, attached my ss fyr. Does this help ?
  6. webgl error

    I'm using 3.0. Memory is showing ~12MB when page loaded dropping to ~5MB after local server d/c (and I believe after GC). Primary calls in script are this.viewport.remove(); //canvas removal engine.dispose(); I don't think its sufficient. Heap snapshot shows that meshes in the scene are still retained, as well as the scene itself. I have to pore over this in detail. Is there a best practice doc/guide as to removing babylon created object references anywhere ? edit: I forgot, the GUI elements are also retained in memory, I'm seeing several getNodeText calls. Hope it helps.
  7. webgl error

    Apologies for the thread necro, but I'm getting this error during dev as well in FFox: Error: WebGL: Exceeded 16 live WebGL contexts for this principal, losing the least recently used one. I understand dispose() works, are there any procedures for GC on canvases/engines I should take note of ? A doc link would be nice here, I think.
  8. Announcing Babylon.GUI

    hmm, that's weird. I could have sworn it was slanted before I did the offset which was what prompted me to add the offset in. Anyways, thanks !! ah erm, nvm, @adam fixed it. The issue here as I observed and tested is that when pos.x < 0 and line.x2 = pos.x-10 would result in x2 being even more negative and vice versa for pos.x > 0. This resulted in the visual slant at extreme left/right. Hope it helps, cheers !
  9. Announcing Babylon.GUI

    Ah I see, understood, tyvm DK! So I managed to mouse-over faces on the skull mesh like this: I observed a few issues: 1) If you mouseover to the leftmost part of the skull and then to the rightmost, the line seems to slant ? Can't figure out why it happens and can't seem to get rid of it through the offset. 2) The scene.onPointerObservable.add function block can get very long in the importMesh callback block. Is it possible to have the event listener outside of the callback and still have access to the imported mesh? edit: nvm this, I figured it out after posting, hehe. 3) This is more of a request. Is it possible to add in a couple of more properties for the TextBlock in the next version ? I'm looking for label.font = "Times New Roman" and label.fontsize = "11pt" functionalities. edit: I saw the control properties after the previous edit, lol. Thanks for reading!
  10. Announcing Babylon.GUI

    Hi, just want to chime in and say that its great to have this html functionality in babylon. Well done, I must say that TextBlock now takes over from console.log for me and seeing debug stuff on fullscreen w/o F12 is sweet ! That said, I was browsing the doc and I saw the moveToVector3 functionality and did a quick test in PG: But it doesn't seem to be working ? Do I need to call it in a register before render func ? or or ... ?? I'd love to be able to mouse-over face meshes in my scene and have it show stuff in a single dynamic label.
  11. Hey @Temechon, thanks for the advice. At the moment, I do not think terrain type mesh creation with SPS is part of my workflow atm, maybe you can understand better in the below ss. I'll keep in mind tho. @gryff, hey this is a nice effort, thanks ! Yes, my workflow is still Blender to babylon. I didn't clone or make new instances but took a different direction, as my below ss shows. I made a slightly more randomized untextured terrain in blender which could easily use 4/5 different textures. Then I parented a few empties to some of the hex tiles (just for testing purposes) and wrote some code in babylon with scene.pick to find the empties position corresponding to a mouse click. The yellow highlight is a temp disc mesh that will match to empty position when said tile is clicked (will replace with dynamic texture in future). By my estimates, this is memory and computation wise more efficient. No mesh cloning or instances needed and still scalable. The largest memory overhead would be from the getVerticesData call of the imported mesh (would be nice if I could just grab part of the data instead of the whole array). I will need to prolly load a denser mesh and do some profiling to know for sure. Right now, having problems getting it to trigger for mouse moves instead of working with clicks...hrm... Still thanks to everyone for the many advice and help. The current approach is somewhat different from the OP, I'm not sure if this Q&A is still relevant tho. Hope it helps, cheers.
  12. @Temechon Hey thanks for the suggestion. I checked SPS out but the single texture is a limitation I can't accept. I will try a different approach to the problem. Many thanks to all for the help and suggestions. erm, how can I close this thread ? Can an admin help?
  13. @gryff Hey, thanks for the quick reply and welcome. I've checked both pgs and I think there might be some confusion as you have multiple distinct scene meshes. I'm not certain how to repro my case in pg (can I upload my file to babylon server ?) so I've attached the babylon file here instead. My problem here is that there is only 1 mesh and therefore only 1 name (terrain), and a whole list of vertices and indices corresponding to the 50 hex tiles. The hex tiles are not connected as a single contiguous mesh. I created them quickly via the array modifier in blender. Ideally, I'd like to, say, mouseover the terrain and the corresponding hex tile below the cursor could highlight/change material etc. Which would mean that the code would need to parse the terrain mesh and obtain say hex[49] submeshes? In the actual application, the number of hex tiles could be anywhere between 200-500? and each individual hex tile might have different heights etc. terrain.babylon
  14. Hi, I thought I would ask before coding functions for which I'm not certain babylon.js already supports. Is there a ready method that can take a single obj/mesh that consists of several contiguous meshes and parse the contiguous meshes into, say, an array ? I have attached an example of a hex tile terrain (see attached) exported from blender which consists of 50 hex tiles. If possible, I'd like to simply pass the hex terrain data and obtain all the 50 hex tiles in an array. Which I can then use mouse triggers on and so forth. I have read the doc and done some testing but cannot seem to get the behaviour I wanted with subMeshes. Does another method/function exists that can do the job? Or do I have to code my own by parsing the babylon file ?
  15. Metallic Workflow

    ok, thks...I will verify again. 3DO is showing me identical look so not entirely sure if its shader or texture generation discrepancy. I think @Pryme8 was referring to the helmet in the OP. Thanks for the warm welcome tho @Wingnut Cheers.