• Content count

  • Joined

  • Last visited

  1. Hi @JCPalmer Thanks for your great instruction! These are good points! Sorry for the late reply, I spent some time following your implementation. Gladly, the memory heap decreases! Recently I still find that during rendering the high-poly mesh, the cpu heats up and fan runs fast and loudly. If the memory is controlled in a good way, will it reduce the CPU heat problem ? Thank you again, have a nice day !!
  2. Hi, @JCPalmer Thanks for your Expert - Explanation! After studying your instruction and related resource, I’m still curious about the following concept. 1. My scene is designed to display only 5- 10 meshes simultaneously! So maybe draw calls are not a big burden in this condition ? 2. Even when I try to instance only one mesh, I face the following condition. The instance function drives a lot of looping-reference relationship? (sorry I dont know the exact term. Just find a lot of similar reference with a long distance). It’s is hard for me to find it and de-reference it! Do you know where can I make it? Or do you experience the similar situation before ? (High poly mesh model link is here : ) 3. If it still raises a high level of heap after I dispose the mesh. What/Where is a good flow to de-reference objects (If MeshFactory is used to instance mesh) ? Thank you so much!
  3. Hi Thanks for the great BJS and TOB exporter, the meshes could be generated from Blender and rendered in BJS environment efficiently. However I find out something interesting that JS heap increases when the mesh is instanced in the scene. But the heap size could not be decreased when the mesh is disposed. I’m curious whether this will cause some memory issues(such as memory leak). Here is the demo of the system: The Source code is as the following or the link : If the playground is better for debugging, please try this link. The implementation and the outcome are nearly the same. (Click Sphere to generate mesh //// Click ground to dispose it) The attachment are the heap snapshots ! 。The heap1 snapshot is took before the mesh is made an instance by TOB-generated-js file 。The heap2 heap snapshot is took after the mesh is made an instance by TOB-generated-js file. We can find that the heap size is increased. 。The heap3 snapshot is somehow hard to understand that when the mesh dispose function is called, the heap size still raise a high level compared to the first snapshot. NO~~ My questions are 1. If the meshes are generated and the Js heap size is increasing at the same time. Will it cause the memory issue and make the system run slowly? 2. How to make the best to decrease the heap size after mesh dispose process. 3. I’m not sure, but during watching the snapshot constructor information, I find there may be some looping references within BJS/TOB/MeshFactory structure. Will it cause the GC(Garbage Collection) unable to release memory? Thank you ! BJS and everything here are awesome!
  4. Hi, my friends, Recently I try TOB ( tower of babel) exporter to get the mesh for babylonjs. I try to export the shape keys under the group of ENTIRE_MESH config. However, after I deform another shape key after the first shape key is deformed completely. I find it initially referenced the BASIS shape key group and then execute the next shape key . It seems to be fixed in the QI lib.js . I'm wondering if there is any approach that I can make the following happens? ------------------------------------------ Blender ShapekeyA ( from 0~1, default as 0) Blender ShapekeyB ( from 0~1, default as 0) key = Qi.deformation("ENTIRE_MESH" ,"ShapekeyA", 1 , duration) mesh.queueSingleEvent(key); key = Qi.deformation("ENTIRE_MESH" ,"ShapekeyB", 1 , duration) mesh.queueSingleEvent(key); =======> in the recommened way, finally, I can get the mesh with (ShapekeyA=1 )&& (ShapekeyB=1) instead of ( ShapekeyA returing to BASIS ) && ( ShapekeyB=1) Any advice will be appreciated Thank you so much!
  5. Hi Thanks for your advice! However the material I still need some help. Would you please tell me who is familiar with this topic? Thanks a lot
  6. Hi, JCPalmer ! Thank you for the advice and great work! It is really meaningful to me. I updated the playground and showd the fail case. It can be displayed by clicking 'run' button Thank you so much
  7. Hi, Deltakosh ! sorry for the late reply. I find it hard to implement on the playground since I don't know how to import Qi / TOB.js file . the source code is just like this, // You have to create a function called createScene. This function must return a BABYLON.Scene object // You can reference the following variables: scene, canvas // You must at least define a camera // More info here: var createScene = function() { var imported = document.createElement('script'); imported.src = ""; document.head.appendChild(imported); var imported = document.createElement('script'); imported.src = ""; document.head.appendChild(imported); var scene = new BABYLON.Scene(engine); var camera = new BABYLON.ArcRotateCamera("Camera", 0, Math.PI / 2, 12, BABYLON.Vector3.Zero(), scene); camera.attachControl(canvas, true); var human; // var left = document.getElementById("left"); var canvas = document.getElementById("renderCanvas"); var engine = new BABYLON.Engine(canvas, true); //scene = new BABYLON.Scene(engine); TOB_body_pg.initScene(scene); /* var camera = scene.getCameraByID("Camera"); camera.wheelPrecision = 10; var light = new BABYLON.PointLight("spot", BABYLON.Vector3.Zero(), scene); light.intensity = 1.0; */ scene.autoClear = false; // keep bg white // Creates, angles, distances and targets the camera var camera = new BABYLON.ArcRotateCamera("Camera", 0, 0, 10, new BABYLON.Vector3(0.2 , -0.7, -2.0), scene); // This positions the camera scene.activeCamera = camera; camera.setPosition(new BABYLON.Vector3(0.2 , -0.7, -5.0)); // 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("light", new BABYLON.Vector3(0, 1, 0), scene); //Create a light var light1 = new BABYLON.HemisphericLight("Omni1", new BABYLON.Vector3(-1.8, -1.5, -2.0), scene); var light2 = new BABYLON.HemisphericLight("Omni2", new BABYLON.Vector3( 1.8, -1.5, -2.0), scene); console.log(camera.position); scene.beforeCameraRender = function () { //light1.position = camera.position; //light2.position = camera.position; light1.intensity = 0.7; light2.intensity = 0.7; }; /************************* Load Human *************************************/ var pbr = new BABYLON.PBRMaterial("pbr", scene); human = scene.meshes[0]; human.material = pbr; pbr.albedoTexture = new BABYLON.Texture("", scene); pbr.reflectivityColor = new BABYLON.Color3(1.0, 0.766, 0.336); pbr.useMicroSurfaceFromReflectivityMapAlpha = true; human.position = new BABYLON.Vector3(0.2 , -1.5, -2.0); human.alwaysSelectAsActiveMesh = true; human.material.specularColor = BABYLON.Color3.Black(); console.log(scene.meshes); scene.executeWhenReady(function() { engine.runRenderLoop(function () { scene.render(); var fpsLabel = document.getElementById("fpsLabel"); fpsLabel.innerHTML = engine.getFps().toFixed() + " fps"; }); }); //Resize window.addEventListener("resize", function () { engine.resize(); }); return scene; }; could you give me some advice to make PBR material on TOB output come true ? Thank you so much
  8. Sorry that I don't explain well! Actually I set all mesh.material = pbr. It shows all-black color I'm wondering the reason . Thanks so much
  9. Hi, Deltakosh You mean affecting in blender or BabylonJS ? Could you explain it more ? Thank you very much
  10. Hi my friends, Recently I read the tutorial of PBRMaterial here I wanna display the object exporting from Blender by Tower of Babel (TOB) However, it comes out with all-black on my object(mesh) The code is jus like the following : var texture_from_file = new BABYLON.Texture("dress.jpg", scene); var pbr = new BABYLON.PBRSpecularGlossinessMaterial("pbr", scene); for (var i = 0; i < scene.meshes.length; i++){ scene.meshes[i].material.diffuseTexture = texture_from_file; } Any advice to let me display the mesh with PBRMaterial (or similar texture) ? Thank you so much