An Efficient way to Draw Procedural Circles in Unity

An Efficient way to Draw Procedural Circles in Unity

I found an excellent method to draw circle procedurally. I like the approach it have, so I decided to convert it to unity.

I used my old and inefficient algorithm to calculate time rendering with 64000 segments.

Before optimize

unefficientCircle1

Then, once optimized, it is possible to appreciate a time reduction of approximately 10 miliseconds. It does not seem too much, with great power CPUs as in this 64-bit processor and 3.8 GHz frequency, but it is really very cheap cost of processing.

After Optimize

efficientCircle

Update 20/12/2016

  • It now also generates UV coordinates for texturing.
  • It provides the option to reuse a material instead of creating copies.
  • The mesh-building code is in the editor script to reduce the impact on a build.

DOWNLOAD

Thanks to Jon  McGuireV10

 

 

 

 DOWNLOAD SOURCE

References: http://slabode.exofire.net/circle_draw.shtml