# Provide \`MeshBuilder.CreateGroundFromHeightMap\` taking an image instead of an URL

**URL:** <https://forum.babylonjs.com/t/provide-meshbuilder-creategroundfromheightmap-taking-an-image-instead-of-an-url/10626>\
**Category:** Feature requests\
**Created:** [May 7, 2020, 8:25am UTC](https://forum.babylonjs.com/t/provide-meshbuilder-creategroundfromheightmap-taking-an-image-instead-of-an-url/10626 "2020-05-07T08:25:38Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joerg\_Plewe](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/joerg_plewe/32/7426_2.png) [@Joerg\_Plewe](https://forum.babylonjs.com/u/Joerg_Plewe)\
**Post date:** [May 7, 2020, 8:25am UTC](https://forum.babylonjs.com/t/provide-meshbuilder-creategroundfromheightmap-taking-an-image-instead-of-an-url/10626/1 "2020-05-07T08:25:38Z")

</div>

Hi all!

I’m using `AssetsManager` to load my assets and would like to use it for a terrain heightmap as well.  
`MeshBuilder.CreateGroundFromHeightMap` taking an already loaded image instead an URL-string as a parameter would be helpful for that.

Regards,

. J

---

<div class="post-metadata">

**Author:** ![Joerg\_Plewe](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/joerg_plewe/32/7426_2.png) [@Joerg\_Plewe](https://forum.babylonjs.com/u/Joerg_Plewe)\
**Post date:** [May 7, 2020, 8:52am UTC](https://forum.babylonjs.com/t/provide-meshbuilder-creategroundfromheightmap-taking-an-image-instead-of-an-url/10626/2 "2020-05-07T08:52:48Z")

</div>

… or even a `Uint8Array` as `VertexData.CreateGroundFromHeightMap` does, so that `AssetsManager` can prepare as much as possible upfront.

---

<div class="post-metadata">

**Author:** ![holger](https://avatars.discourse-cdn.com/v4/letter/h/ed8c4c/32.png) [@holger](https://forum.babylonjs.com/u/holger)\
**Post date:** [May 7, 2020, 12:30pm UTC](https://forum.babylonjs.com/t/provide-meshbuilder-creategroundfromheightmap-taking-an-image-instead-of-an-url/10626/3 "2020-05-07T12:30:31Z")

</div>

+1 from my side, would be great having this possibility!

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [May 7, 2020, 2:40pm UTC](https://forum.babylonjs.com/t/provide-meshbuilder-creategroundfromheightmap-taking-an-image-instead-of-an-url/10626/4 "2020-05-07T14:40:16Z")

</div>

The url can be constructed from a blob if you want to:

```auto
            var blob = new Blob([data], { type: "octet/stream" });
            var url = URL.createObjectURL(blob

```

Then you can use that url with the MeshBuilder

---

<div class="post-metadata">

**Author:** ![Joerg\_Plewe](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/joerg_plewe/32/7426_2.png) [@Joerg\_Plewe](https://forum.babylonjs.com/u/Joerg_Plewe)\
**Post date:** [May 7, 2020, 4:34pm UTC](https://forum.babylonjs.com/t/provide-meshbuilder-creategroundfromheightmap-taking-an-image-instead-of-an-url/10626/5 "2020-05-07T16:34:08Z")

</div>

Yes. I agree, this request is more for convenience than essential.

But this is more of a workaround? My goal was making terrain creation quick by using a preloaded image.  
Loading image, creating a potentially multimegabyte URI that has to get parsed again does not sound to be ‘quick’.

What already helps today is preloading the image in `AssetsManager`. `MeshBuilder.CreateGroundFromHeightMap` then will not load it again from the web. Babylon or the browser seems to cache…

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [May 7, 2020, 6:26pm UTC](https://forum.babylonjs.com/t/provide-meshbuilder-creategroundfromheightmap-taking-an-image-instead-of-an-url/10626/6 "2020-05-07T18:26:02Z")

</div>

Yes and this is why I see not a real need as you can simply reload it and trust the browser cache (which will be really fast )
