Hello,
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.
Thanks
Hello,
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.
Thanks
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:
https://developer.playcanvas.com/en/tutorials/terrain-generation/
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:
Thank you very much