• Content count

  • Joined

  • Last visited

  1. Hey, try skybox.infiniteDistance = true;
  2. highlight layer with renderingGroupId

    @Sebavan Thanks, that solved it! This is probably a bug though? Where I removed the renderingGroupId = 1 mesh from the highlight layer. https://www.babylonjs-playground.com/#11QFK8#8
  3. Hi, I was implementing the highlight layer for some meshes and when I was mouseovering some meshes it bugged out and eventually I found out its because of mesh.renderingGroupId = 1. Even if I do layer.removeMesh( mesh ) it remains bugged where it draws very strong innerGlow despite innerGlow = false; Is there a way to bypass this issue? Maybe onBeforeComposeObservable and onAfterComposeObservable to set renderingGroupId = 0 for all meshes and then back to original value? Here's a PG replicating the issue: https://www.babylonjs-playground.com/#11QFK8
  4. scene.debugLayer.show throws error

    Hi, I was on 3.0.7 and it's resolved in 3.1 alpha. I'll continue using this code snippet before I open the debugLayer until 3.1 is relased so the inspector script doesn't crash. if ( BABYLON.Tools.getClassName ) { BABYLON.Tools.GetClassName = BABYLON.Tools.getClassName; }
  5. scene.debugLayer.show throws error

    @Temechon The one at babylonjs repository works again, thanks! It still crashes on this error but I'll mark this thread as solved as the __extends issue is fixed! babylon.inspector.bundle.js:409 Uncaught TypeError: BABYLON.Tools.GetClassName is not a function at Function.t.GET_TYPE (babylon.inspector.bundle.js:409) at Object.format (babylon.inspector.bundle.js:408) at n._displayValueContent (babylon.inspector.bundle.js:409) at new n (babylon.inspector.bundle.js:408) at new n (babylon.inspector.bundle.js:409) at new n (babylon.inspector.bundle.js:410) at t._buildInspector (babylon.inspector.bundle.js:408) at new t (babylon.inspector.bundle.js:408) at DebugLayer._createInspector (<anonymous>:61488:35) at HTMLScriptElement.script.onload (<anonymous>:5607:21)
  6. scene.debugLayer.show throws error

    @Temechon Hi Temechon, when you merged your repo with babylonjs 1-2 days ago I think you accidentally reverted your changes about the __extend issue by probably not rebuilding the inspector bundle. So I'm using this file for now which is from the commit that solved the issue: https://raw.githubusercontent.com/Temechon/Babylon.js/a29aaa69dfea302610f676c00545829c65b85297/dist/preview release/inspector/babylon.inspector.bundle.js @Myjestic If you havn't solved the GetClassName issue yet I believe in your code you can do this as a temporary solution BABYLON.Tools.GetClassName = BABYLON.Tools.getClassName;
  7. scene.debugLayer.show throws error

    Hi @Temechon because our server on localhost didn't work against raw.githubusercontent.com (text/plain as mimetype) I changed the url to this inside babylon-max.js: DebugLayer.InspectorURL = 'https://rawgit.com/Temechon/Babylon.js/master/dist/preview release/inspector/babylon.inspector.bundle.js'; After calling .show() now I get the following error: babylon.inspector.bundle.js:409 Uncaught TypeError: BABYLON.Tools.GetClassName is not a function at Function.t.GET_TYPE (babylon.inspector.bundle.js:409) at Object.format (babylon.inspector.bundle.js:408) at n._displayValueContent (babylon.inspector.bundle.js:409) at new n (babylon.inspector.bundle.js:408) at new n (babylon.inspector.bundle.js:409) at new n (babylon.inspector.bundle.js:410) at t._buildInspector (babylon.inspector.bundle.js:408) at new t (babylon.inspector.bundle.js:408) at DebugLayer._createInspector (<anonymous>:61487:35) at HTMLScriptElement.script.onload (<anonymous>:5607:21) I added the function GetClassName to make sure it doesn't crash anywhere else. Tools.GetClassName = Tools.getClassName; It works and I have the debuglayer after that!!
  8. scene.debugLayer.show throws error

    Hi, I'm in the process of updating from 2.4 -> 3.0.7 and our button to show/hide debuglayer doesn't work anymore because the debug layer throws an exception when show() is called. I saw the InspectorURL points to a preview url: //preview.babylonjs.com/inspector/babylon.inspector.bundle.js The network tab shows that the script loads Here is the information in the console regarding the exception Uncaught ReferenceError: __extends is not defined at babylon.inspector.bundle.js:408 at INSPECTOR (babylon.inspector.bundle.js:408) at Object.global (babylon.inspector.bundle.js:408) at __webpack_require__ (babylon.inspector.bundle.js:21) at Object.<anonymous> (babylon.inspector.bundle.js:49) at __webpack_require__ (babylon.inspector.bundle.js:21) at babylon.inspector.bundle.js:41 at babylon.inspector.bundle.js:44 (anonymous) @ babylon.inspector.bundle.js:408 INSPECTOR @ babylon.inspector.bundle.js:408 global @ babylon.inspector.bundle.js:408 __webpack_require__ @ babylon.inspector.bundle.js:21 (anonymous) @ babylon.inspector.bundle.js:49 __webpack_require__ @ babylon.inspector.bundle.js:21 (anonymous) @ babylon.inspector.bundle.js:41 (anonymous) @ babylon.inspector.bundle.js:44 VM14956:61487 Uncaught TypeError: Cannot read property 'Inspector' of undefined at DebugLayer._createInspector (<anonymous>:61487:48) at HTMLScriptElement.script.onload (<anonymous>:5607:21)
  9. Speeding up evaluateActiveMeshes

    Have you tried using octrees? I also had 800+ meshes in my scene and octrees helped my CPU performance by a lot.
  10. [solved] Camera Movement Issue v3.0

    In your app is your canvas focused? I added `document.getElementById("renderCanvas").focus();` and it works for me in the playground you have. http://www.babylonjs-playground.com/#3H5RJW#1
  11. Clearing scene.importedMeshesFiles

    Great, thanks! Should the importedMeshesFiles array be cleared on scene.dispose() as it could potentially leak memory?
  12. Hi, I was optimizing memory usage for my babylon app and I stumbled across this property scene.importedMeshesFiles // Imported meshes public importedMeshesFiles = new Array<String>(); https://github.com/BabylonJS/Babylon.js/blob/master/src/babylon.scene.ts#L603 In my application it was using over 25 mb of memory storing all the loaded .babylon mesh files and from what I can see it's not used anywhere except in the playground code. https://github.com/BabylonJS/Babylon.js/blob/8ff548e2fdb9a203ac5b29e6a662a7d48220f2af/Playground/js/index.js#L477 Can I assume it's safe to clear the importedMeshesFiles every time I load a mesh to reduce memory footprint or would it cause any issues?
  13. Edit: NEVERMIND, I checked noscript and that was blocking urls! I havn't had troubles saving before so didnt think of that!. Here's the url if you want to see it in action! http://babylonjs-playground.azurewebsites.net/#NJ8S1D Hi, I'm guessing this probably isn't a bug and is a security feature but I was creating a playground where I was projecting a world position to screenspace and then using css to position a div to make sure it was correct. I couldn't find any information about unable to save a playground mentioning DOM manipulation. Heres the code that is unable to save with the error Unable to save your code. It may be too long. var createScene = function () { // This creates a basic Babylon Scene object (non-mesh) var scene = new BABYLON.Scene(engine); // This creates and positions a free camera (non-mesh) var camera = new BABYLON.FreeCamera("camera1", new BABYLON.Vector3(0, 5, -10), scene); // This targets the camera to scene origin camera.setTarget(BABYLON.Vector3.Zero()); // This attaches the camera to the canvas camera.attachControl(canvas, true); // This creates a light, aiming 0,1,0 - to the sky (non-mesh) var light = new BABYLON.HemisphericLight("light1", new BABYLON.Vector3(0, 1, 0), scene); // Default intensity is 1. Let's dim the light a small amount light.intensity = 0.7; // Our built-in 'sphere' shape. Params: name, subdivs, size, scene var sphere = BABYLON.Mesh.CreateSphere("sphere1", 16, 2, scene); // Move the sphere upward 1/2 its height sphere.position.y = 1; // Our built-in 'ground' shape. Params: name, width, depth, subdivs, scene var ground = BABYLON.Mesh.CreateGround("ground1", 6, 6, 2, scene); var time = 0; var blob = document.getElementById("blobby"); var canvasZone = document.getElementById("canvasZone"); canvasZone.style.position = "relative"; if ( !blob ) { blob = document.createElement("div"); blob.style.position = "absolute"; blob.style.backgroundColor = "red"; blob.style.left = "0"; blob.style.top = "0"; blob.style.width = "5px"; blob.style.height = "5px"; blob.id = "blobby"; blob.style.zIndex = 10000000; canvasZone.appendChild(blob); } scene.afterRender = function() { time += 1 / 120; sphere.position.x = 0 + 20 * Math.sin( time ); var scene = sphere.getScene(); var cameraViewport = camera.viewport; let projectedVector = BABYLON.Vector3.Project( sphere.position, BABYLON.Matrix.Identity(), //sphere.getWorldMatrix(), scene.getTransformMatrix(), cameraViewport ); const width = canvasZone.offsetWidth; const height = canvasZone.offsetHeight; blob.style.left = (width * projectedVector.x) + "px"; blob.style.top = (height * projectedVector.y) + "px"; } return scene; };
  14. octree dynamicContent and mesh.dispose

    Hi, I was debugging using temporary meshes and noticed that if you just dispose the mesh after adding it to the octree.dynamicContent it stays there even after dispose. Here's a playground where I create 500 meshes and then add them to octree.dynamicContent and then dispose of all of them and the dynamicContent keeps all 500. http://babylonjs-playground.azurewebsites.net/#1YPN4G#2
  15. mesh.clone() clones mesh.uniqueId

    Hi I was using uniqueId to uniquely represent a mesh and I noticed if I use a cloned mesh ( mesh.clone() ) their uniqueId would be the same. After debugging the code the cloned mesh has a uniqueId after this line: super(name, scene); But after the line: Tools.DeepCopy(source, this, ["name", "material", "skeleton", "instances", "parent"], ["_poseMatrix"]); They now have the same uniqueId Which can be seen here: http://babylonjs-playground.azurewebsites.net/#27FBML#0