Example #1
0
        private void Start()
        {
            SignedDistanceFieldGenerator.CalculateSize(gameObject, (int)resolution, out textureSize, out var bounds, out var step);
            var size  = textureSize.x * textureSize.y * textureSize.z;
            var limit = memoryLimit * 1024 * 1024;

            if (size > limit)
            {
                IsReady = false;
                return;
            }

            var cs = RuntimeSettings.Instance.SignedDistanceFieldShader;

            Data = SignedDistanceFieldGenerator.Generate(gameObject, cs, textureSize, bounds, step);

            IsReady = true;
        }
Example #2
0
 public void RecalculateSize()
 {
     SignedDistanceFieldGenerator.CalculateSize(gameObject, (int)resolution, out textureSize, out _, out _);
 }