Witek

Members
  • Content Count

    3
  • Joined

  • Last visited

  1. Ok, I solved the problem by reduce the number of ground's subdivision - it was in numbner of 500 as you may notice. Used grid mesh instead (much better experience btw)
  2. Ok, this is my scene: and this is my processor: 97% is a GPU. Can you explain this? there is just one box with standard material mesh, and 2 meshes with ground. Whole code actually: // ground const subdivisions = Math.min(width, height); const ground = Mesh.CreateGround("ground", width, height, subdivisions, null, false); const groundMaterial = new StandardMaterial("ground-material", null); groundMaterial.specularColor = Color3.Black(); ground.material = groundMaterial; const grid = ground.clone("ground-grid"); const gridMaterial = groundMaterial.clone("grid-material"); gridMaterial.diffuseColor = Color3.Gray(); gridMaterial.wireframe = true; grid.material = gridMaterial; ground.addChild(grid); this.scene.addMesh(ground); // box const color = Color3.FromHexString("#2196F3"); const transparent = color.toColor4(0); const mesh = MeshBuilder.CreateBox(`box`, {width, height, depth, faceColors: [color.toColor4(), transparent, transparent, transparent, transparent, transparent]}); mesh.position.y = box.dimensions.height / 2; mesh.edgesColor = Color3.White().toColor4(); mesh.edgesWidth = 1; mesh.enableEdgesRendering(); const containerMaterial = new StandardMaterial(`material`, null); containerMaterial.diffuseColor = color; containerMaterial.zOffset = -10; containerMaterial.specularColor = Color3.Black(); mesh.material = containerMaterial; mesh.addBehavior(new PointerDragBehavior({dragPlaneNormal: new Vector3(0, 1, 0)})); this.scene.addMesh(mesh, true); Please notice that I am using angular, but runs outside ng zone: this code is invoked once, subscribtion added with this.addDescribtion is called also once on component destroy. BTW: notice that I made all, except one, walls transparent, but they aren't. Why?