Kromster80 / kam_remake

"KaM Remake" is an RTS game remake written in Delphi from scratch.
http://www.kamremake.com
GNU Affero General Public License v3.0
361 stars 90 forks source link

DoTiles render performance optimisation #413

Closed reyandme closed 7 years ago

reyandme commented 7 years ago

Do not bind same texture again, it will drastically change render performance

F.e. on an average Map (Cube 256x256) when full map is shown in viewport there are only ~1250 new texture binds, when all other ~64k binds can be skipped.

Measured performance on my PC: for ~40k tiles DoTiles was executed in ~41ms. After optimisation - downto ~11ms. from 12fps upto 20fps

for ~65k tiles in viewport from 69ms downto 22ms from ~7.5fps upto 12

lewinjh commented 7 years ago

Nice work!