/// <summary>
        /// Construye el mapa de alturas a partir de la textura especificada
        /// </summary>
        /// <param name="terrain">Textura con el mapa de alturas del terreno</param>
        /// <param name="cellScale">Escala de alturas</param>
        /// <param name="context">Contexto</param>
        /// <returns>Devuelve el mapa de alturas generado</returns>
        private HeightMap BuildHeightMap(Texture2DContent terrain, float cellScale, ContentProcessorContext context)
        {
            if (terrain.Mipmaps.Count > 0)
            {
                BitmapContent heightMapContent = terrain.Mipmaps[0];

                // Sólo se soportan texturas cuadradas
                if (heightMapContent.Width == heightMapContent.Height)
                {
                    byte[] pixelData = heightMapContent.GetPixelData();

                    // Construir el mapa de alturas
                    return(HeightMap.FromData(
                               pixelData,
                               heightMapContent.Height,
                               heightMapContent.Width,
                               cellScale));
                }
                else
                {
                    //Sólo se soportan texturas cuadradas
                    throw new NotImplementedException();
                }
            }
            else
            {
                throw new PipelineException("El archivo de mapa de alturas no tiene el formato correcto. No se encuentra la imagen");
            }
        }