+4 votes

Does Godot supports sprite contouring like Unity3D?
Example image
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.

in Engine by (27,831 points)

3 Answers

0 votes

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

by (484 points)

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.

+1 vote

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.
https://trello.com/b/Vl7OgSuq/godot-engine-2-1

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

by (9,694 points)
0 votes

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

https://github.com/timoschwarzer/polygonizer-gd-addon

See it in action:
https://youtu.be/vuWSVm_vx9c

by (698 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.