Does Godot supports sprite optimization?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Zylann
:warning: Old Version Published before Godot 3 was released.

Does Godot supports sprite contouring like Unity3D?

The idea is that instead of drawing transparent quads for sprites or tiles, visible pixels are mapped on a simple geometry reducing the amount of alpha to blend.
This is a great win on mobile devices.

:bust_in_silhouette: Reply From: The_Duskitty

Im not sure, you could try using Polygon 2D for sprites, and just mapping it out to be a simple outline? But besides that i dont quite understand what you mean by this

Mobile devices are slow when it comes to paint pixels on the screen. So the less pixels the application draws, the better. It becomes worse on tablets with giant resolutions.

In 2D, you are going to have a lot of images to draw. drawing a sprite actually means drawing a rectangle with a texture on it.
However, transparent textures include completely invisible pixels, but they are STILL pixels to draw. So the idea is to use a better geometry.
It’s possible to outline blank areas manually, but it’s a repetitive task, and I’m not even sure TileMap supports polygon nodes as tiles. And how would you animate that out of the box?

So if the engine can precalculate that outlining and do the work automatically, like Unity3D does, it would be both a performance gain and time saver.

Zylann | 2016-04-13 23:09

:bust_in_silhouette: Reply From: volzhs

There was a plan for this on old roadmap for 2.1 release.
http://op.godotengine.org/projects/godot-engine/roadmap (Editor #15)

AFAIK, this is current roadmap.

I could not find for this feature on current roadmap.
Maybe 3.0 feature…?

:bust_in_silhouette: Reply From: timoschwarzer

I’ve just made an addon for that. (Unfortunately, it doesn’t create 100% optimized polygons, only the convex hull)

See it in action: