Exporting Unity Terrain to PlayCanvas


I was wondering if there is any way to export unity’s terrain with grass and trees already.

I tried to turning the terrain to obj but it only comes with the terrain itself and the grass and trees disappeared.


Hi @chris_xigega and welcome,

There isn’t an automatic way of doing that, but if you are feeling comfortable in coding in Unity you can write a small exporter that:

  1. Exports the terrain as a mesh object that can be imported in Playcanvas, or export the heightmap and use the following example to import it in Playcanvas:


  1. Export a JSON structure that contains all translation info for detail objects, import it in Playcanvas and use it to position Playcanvas entities for each object in place.

Make sure to use batching if you spawn a lot of objects to avoid major performance drops.


I have a different question, how to put multiple materials in the generated terrain? because I can only put one material it’s just dirt or grass, do I have to use the procedural gradient tutorial?

Yes you need a custom shader that supports multiple diffuse maps on a single material. Two common ways for sorting those are either using a splatmap or based on height.

For the splatmap case, I’ve built a script that does that here:

And here is an example shader for height based terrain texturing, it’s for Three.js but you can adapt it for Playcanvas:

1 Like

Thank you very much