OpenGL Tilemap performance

Hey guys, first let me just say I can’t believe I only recently found OpenFL, Lime and Haxe. What an amazing platform. Thanks for all the hard work.

That being said I have a question related to the new Tilemap class and what to expect regarding performance. For most all platforms it appears that when I am in the 500 Tile range for a Tilemap then performance is decent on all platforms. In my case this many Tiles usually fill the entire screen and are from a Tileset that can contain around 10 different sprites. If however I attempt to create a Tilemap that represents an entire level that can contain thousands of Tile classes then performance on hl and neko tank completely and Safari suffers as well. Native targets seem fine, mac for example is super smooth, Chrome and Firefox also maintain amazing performance.

I am hoping for advice with regard to 2 questions. First should I change my use of the Tilemap class to only contain what is visible on the screen? Second, if not can anyone tell me how OpenGL performs so differently on hl and neko compared to native Mac/hxcpp for example? It is also odd that Safari starts to suffer a little as well.

Thanks

Hello, and welcome :smiley:

I think you’re seeing differences between CPU performance on these targets. Neko is known to be very slow and HashLink is a bit better but not as good as Chrome or native, as you see. I’m not sure if Safari is CPU-bound or it could be related to WebGL.

Try adding -Dwebgl1 and see if that effects the performance on Safari. Lime defaults to WebGL 2 but this might hurt performance in some browsers. OpenFL uses WebGL 1 features only.