Пример #1
0
    public IEnumerator FilterSquarePadding(int padding_size)
    {
        //Array contains height of triangles and will be read to draw them
        float[] triangle_values = new float[triangles.Length];
        for (int i = 0; i < triangles.Length; i++)
        {
            triangle_values[i] = triangles[i].value;
        }

        triangle_values = HeightMap.ApplySquarePadding(triangle_values, mesh_size, padding_size);

        //Apply array to the triangles themselves
        for (int i = 0; i < triangles.Length; i++)
        {
            triangles[i].value *= triangle_values[i];
        }

        Debug.Log("Applied Padding filter");
        yield break;
    }