This method adds a material layer to the terrain.
Returns the index of the new layer, or the index to any existing layer that uses the specified material.