Libgdx pseudo 3d road

Creating a road following the example of http://www.extentofthejam.com/pseudo.

But there is a performance issue.

enter a description of the image here

Each dividing strip, the border of the road... each line is a separate element. I draw everything in SpriteBatch. When rendering, the fps jumps (it all depends on the road, if we go up, the fps rises to 60, because you need to draw less... ran on Redmi Note 3 pro).

Called renderCalls and saw that the game sends a lot of textures for rendering, up to 800+.

Can you advise me how to optimize or make a road?

Of course, you can reduce the distance of the horizon, remove the dividing lines and edges, and reduce the number of sprites of the environment (trees, houses..). Which will significantly reduce the number of textures and improve performance, but will look sparse...

Author: Mikhail Grebenev, 2017-02-06

1 answers

I called renderCalls and saw that the game sends a lot of textures for rendering, up to 800+.

Don't do that. 800+ renderCalls per image in question - a lot. You have a maximum of 20 * 6 = 120 elements there. Plus, in your example, textures are not required at all (if we are only talking about the road).

 0
Author: Kromster, 2017-02-16 04:48:50