Yo,
I need to draw circle shape on texture.
I use now: texture.SetPixel…But it is super slow.
as:
public static void Circle(this Texture2D tex, int x, int y, int r, Color color)
{
float rSquared = r * r;
for (int u = 0; u < tex.width; u++)
{
for (int v = 0; v < tex.height; v++)
{
if ((x - u) * (x - u) + (y - v) * (y - v) < rSquared)
{
tex.SetPixel(u, v, color);
}
}
}
}
I saw: texture.SetPixels32 also…
But I have no idea how to draw a circle with it?
So:
Is there a more efficient way to draw pixels on texture (if I want circle) that first one?
PS:
In my situation, I can NOT use shaders or line drawings