eliasku / 13

Fast-action P2P multiplayer game 13 (js13k-2022)
https://iioi.herokuapp.com/
94 stars 27 forks source link

Polygon style render #41

Closed eliasku closed 1 year ago

eliasku commented 1 year ago

Change regular quad sprites to textured polygons. Will enable better Z-buffer utilisation in the game world render pass. To make polygon-like sprites (mesh sprites) we could use html page to edit sprite contours and export emoji source + contours data. Then in runtime we able to triangulate mesh with ear-cut library.

Notes:

eliasku commented 1 year ago

Approach successfully proven that old Galaxy A7 device FPS grows from 27 to 60.

Polygon-styled emoji looks bad on that low-res, so I decide to mirror current style with hard-edge marching. In addition we need to round resulted positions on hard-edge triangulation.

Flood-fill is applied to remove black thread artefacts on mesh edges for low-res / MSAA modes.

Next steps