rdzar

Members
  • Content count

    6
  • Joined

  • Last visited

  1. Wow thanks honestly didn't think of that at all! Awesome!
  2. I noticed when changing the <canvas> element size, the engine updates with it. Is that what you're searching for?
  3. I'm not sure if this is intended or it just isn't able to, but the GridMaterial currently doesn't seem to support shadows. I've tried different methods, but with no luck. Using an example of the BabylonJS shadow tutorial moving the ground into a grid shows this problem clearly; https://www.babylonjs-playground.com/#Y5IZCF#2 It would be awesome if the GridMaterial could support this as it provides a efficient way to render a high scale grid performance wise.
  4. Mmm, this would work of I'm on the 2D side If I'm understanding correct? But with 3D and Camera Panning this is going to be pretty interesting. As the meshes is too much, I'm dropping FPS like crazy with them using pick & subMeshId so still figuring out a way to find the tile location without adding a thousand SubMeshes ----- Ok; solved kinda based of this ^. For future reference / search engine. To retrieve mouse position within the grid without using SubMeshes and keep them 60FPS rolling; // Subtract ground from pickedPoint (after mesh check) const subtractedPoint = pickResult.pickedPoint.subtract(ground.position); // Calculate X & Y (where tiles.w and tiles.h are the TiledGround W&H, e.g. 20-20) const x = tiles.w - Math.floor(subtractedPoint.x / tileHeightWidth); const y = tiles.h - Math.floor(subtractedPoint.z / tileHeightWidth); // z == depth === y // To use the x & y position to be on the 0,0 point correct it from the TiledGroundCenter e.g. x = -x + 250; // 250 = half of example 500w TiledGround z = -y;
  5. Ah, I didn't notice there was a CreateTiledGround with SubMesh support too! Using scene.picked it does the work If someone knows a way to make it work with GridMaterial (performance..) would still love to know!
  6. I've been playing with creating a grid for a while now, and I found out the latest alpha provides a nice one. Love it, a performance I'm not able to create with mass-meshes or lines. But.. for this use-case I'm searching for a way to know the exact position within that grid, so I'm able to hover a active-tile mesh on it. As I'm trying to use the grid, as a real grid. The GridMaterial provides no actions as far as I could find for this and I was wondering, is there any other way to make this work that I just didn't think of? Thanks in advance! (BTW using OnIntersectionEnterTrigger errors on the grid) https://www.babylonjs-playground.com/#83YJIL#1