Jump to content

Color/texture each quad separately on ground mesh


jamessimo
 Share

Recommended Posts

I am making a large game world like a tile map. The issue I have is my tile map is at least 250x250 tiles (could be 500x500) so if I use 

var grid = {
        'h' : 250,
        'w' : 250
    };
	
    var tiledGround = new BABYLON.MeshBuilder.CreateTiledGround("Tiled Ground", {xmin: -1, zmin: -1, xmax: 1, zmax: 1, subdivisions: grid}, scene);

It crashes Babylonjs or runs at 1FPS if I am lucky

However if I use 

var ground = BABYLON.MeshBuilder.CreateGround("gd", {width: 8000, height: 8000, subdivsions: 250}, scene);

it runs just fine, so my plan was to make a ground mesh and loop through each quad or grid[x][y] and apply a material on it depending on what texture I need.

Just to give you an idea of what I am doing, I am trying to make a 2d map viewer I made 3D https://jamessimo.itch.io/rimmap  

My question is how do I do this? I do not have a large single texture I can apply to the whole plane, the textures are applied depending on what a large json file tells it.

Link to comment
Share on other sites

Hiya JS.  I don't have solutions to your issues, yet... but I wanted to show you...

https://doc.babylonjs.com/resources/offsite_tutorials_list#célian-garcia-kostar111-home-website-unknown

Kostar111 isn't around much anymore, but he kept his tiled terrain map tutorials on-line, so there might be something to be learned, there, in his 3 links.

I goofed around with some tiling and displaceMaps, once.  https://www.babylonjs-playground.com/#1VGWP9#4

Not very exciting.  :) 

Also, although I know almost NOTHING about multiMaterials, it might be worth a forum search and playground search.

Here's a quick demo I found, laying along-side Babylon Blvd. 

https://www.babylonjs-playground.com/#1VGWP9#4

Stay tuned for more/better comments/answers.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...