Jump to content

Optimization of the isometric engine


hypothermi
 Share

Recommended Posts

Hello,
I would like write simple isometric engine, where the map contains lot of isometric fields/tiles in 3 dimension - like in Minecraft. However, I can not write it in the optimal way.

The camera it's attached to central box (this simulate the player) and based on his position generates nearby "Chunks". I divide map for chunks (like in Minecraft - https://minecraft.gamepedia.com/Chunk) and generates them depending on needs.

Unfortunately, when the program renders these chunks, there is quite a strong lag. When the player stands still, the number of FPS is better, but it is still quite low.

Below I copied the code from my program. Could someone look at it and tell me how I could optimize it all? The amount of FPS and lag are unfortunately too big. I do not have any ideas how to do it better. ?

https://www.babylonjs-playground.com/#QDTBMH#6

Link to comment
Share on other sites

Hi @hypothermi and welcome to the forum. Sorry for slow reply. There is a lot to go through in your code. I was hoping someone with more skill might reply. However a couple of points

You only need to set listeners on the canvas once not every rendering of the scene.

If you are repeating the same mesh many times use instances or SPS

Check out optimization.  

Other may want to comment

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