hypothermi Posted November 4, 2018 Share Posted November 4, 2018 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 Quote Link to comment Share on other sites More sharing options...
JohnK Posted November 5, 2018 Share Posted November 5, 2018 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 hypothermi and GameMonetize 2 Quote Link to comment Share on other sites More sharing options...
hypothermi Posted November 9, 2018 Author Share Posted November 9, 2018 On 11/5/2018 at 2:48 PM, JohnK said: You only need to set listeners on the canvas once not every rendering of the scene. Hi, thanks for reply. @JohnK can You say more about this listener to canvas? I don't know exactly what to do. ? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.