Hi all. I’m trying to export a terrain + skybox using the Babylon exporter (v4.0.0). Came across this thread: Unity 3d exporter missing terrain - but didn’t want to get in the middle of all that so as not to ping everyone. Just wondering what the upshot is - couldn’t decode from the thread. Sounds like it may work??
I’ve got a very simple skybox with terrain, which shows up blank from the exporter. No skybox and no terrain.
Took a few hours, but was able to rebuild in Babylon with skybox, fog, and terrain. Think it looks pretty identical (Unity on left / Bablyon on right). Cool! (but bummer that the export didn’t work, of course… unless i’m doing it wrong??)
This one can be tough if you don’t know all the stuff involved with terrains and custom shaders
First … you gotta create the terrain mesh from a heightmap image… you will always loose a bit of precision encoding heights into an RGB/PNG
Now the tough part, the shader to handle all the layers… you gotta decide between using separate textures per layer… you can check out the TerrainMaterial for how to mix colors
If you wanna use texture atlas for your layers, that’s a whole new can of worms
I listed some of my Babylon Toolkit Pro Shader SDK code snippet I use to handle texture atlas… the magic is the bilinear sample texture atlas function I created… is much simpler and only use about a dozen arithmetic computations per sample read… is really fast… I believe I posted a few images you can do with the upcoming Babylon Toolkit Pro Shader SDK… If you using the totally free version… your gonna have to write all that yourself