Jump to content

Creating a high performance tiled ground mesh with SPS & spritesheet


aWeirdo
 Share

Recommended Posts

Hi all,

Some weeks ago i needed to make a large tiled ground, 
i tried the build-in createTiledGround, but at "just" 50 x 50 tiles (2500), it starts to struggle a bit, even on a rather high-end PC.
http://www.babylonjs-playground.com/#1XBLWB#168
 

So using the SPS and a spritesheet, i created my own;
It takes a second to load,
but at 500 x 500 tiles, (250.000) it runs smoothly and with 59 / 60 fps on the same PC.

 

tile indexing example, 5x5 (25) tiles;

    Cols_> 0   1   2   3   4 
Rows_V
          4    20 21 22 23 24
          3   15 16 17 18 19
          2    10 11 12 13 14
          1    05 06 07 08 09
          0    00 01 02 03 04

other important stuff should be commented in the PG.

(50 x 50) http://www.babylonjs-playground.com/#1ALQPZ#4

(500 x 500) http://www.babylonjs-playground.com/#1ALQPZ#5


Cheers.

 

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...