Tiled Ground Submeshes

Hello,

I need to create a ground with tiles (100x100-400x400) with each tile having it’s own texture. So I followed How to make tiled grounds in BabylonJS — Makina Corpus as it was referenced in the babylon js documentation.

However it seems that creating this many submeshes is not a good idea, since it takes forever and afterwards the scene is unusable slow.

So I will try Tiled Ground using SPS and TextureAtlas. Updated now, however I wonder if I did something wrong or if submeshes are just to slow.

Also what would be the best solution? I guess writing a shader, which I probably will do later, however I not really have written one with more than 3 lines ^^. So what would be the next best solution?

Thanks

Hey @lal12 - Welcome to the Babylon family!!!

You’re right that creating lots of submeshes can be heavy, depending on the circumstances and how many you have.

I totally hear ya that writing shaders can be daunting, but I’d encourage you to check out Babylon’s new Node Material Editor. It’s a fantastic tool that essentially lets you create shaders in a graphical node tree, without writing code! We’ve also got a ton of videos around this new tool over on our youtube page.

If I were to approach this today, I’d create a shader with a tileable look to it, create a plane for the ground, and then clone that ground however many times you need.

Also added bonus, depending on how you create your shader, you may NOT need it to tile at all. You could use the world position as an input into your shader!

Hope this helps! Best of luck!

1 Like

What worked for me was using the approach described here Tiled Ground using SPS and TextureAtlas. Updated. However this was just a temporary solution anyway, I will sooner or later write an own shader.