public static float Sphere(Vector3 pos) { const float radius = (float)Resolution / 2.0f - 2.0f; Vector3 origin = new Vector3((Resolution - 2.0f) * 0.5f); return (pos - origin).LengthSquared() - radius * radius; }