Subdivide mesh as grid

I made a go at writing a script to subdivide an arbitrary landscape mesh into a grid in the playground below. Some problems I encountered:

  • stitching artifacts that show the borders of each grid piece
  • malformed geometry [Update: fixed]

Please note that the original model uses a normal map file that’s 300+ MB; it will take a few minutes to load.

1st attempt:
2nd (fixed geometry):
3rd better UV mapping:
(also less visible seams)

I was wondering if this has already been solved by one or some combination of the methods babylon js already provides. If not, any tips?

I think most people will be able to directly make use of this script -

Would Grid Material | Babylon.js Documentation ( work?


This looks extremely promising; gonna play around with that and see if I can cook up the result I’m going for. Thank you!

1 Like

So how would one go about generating height maps for each logical grid partition? I have a script that kind of works towards that end, but is very time intensive for detailed large maps.

Hmmm Grid Material is mostly for display, so you’d have to roll your own thing :thinking: @Evgeni_Popov any tips for that?

1 Like

I don’t know if it’s relevant but we have the dynamic terrain extension: Dynamic Terrain | Babylon.js Documentation ?


This also looks super promising. And pretty interesting too. I’ll be trying this one out too, thanks!