Export Terrain as OBJ with textures / Splatmap?

Hi All!

I’m a big n00b at texturing objects. I’d like to export my unity terrain to 3ds max, so I can tweak it…

I’m using the TerrainObjExporter script for exporting the mesh.
I’m using the following script to export a splatmap:

// For saving splat map as PNG file. 
import System.IO; 

@MenuItem("Assets/Export Texture") 
static function Apply () { 
var texture : Texture2D = Selection.activeObject as Texture2D; 
if (texture == null) 
{ 
EditorUtility.DisplayDialog("Select Texture", "You Must Select a Texture first!", "Ok"); 
return; 
} 
var bytes = texture.EncodeToPNG(); 
File.WriteAllBytes(Application.dataPath + "/exported_texture.png", bytes); 
} 

So the splatmap is a representation of how the different textures are applied to the model right? So the last step for me is to import the splatmap into 3ds, add the correspongding textures, and apply it to the mesh? Would that do the trick?

Or is it perhaps easier using some other software, like Cinema 4D perhaps? Anybody got any experience on doing this? Thanks!

1 Answer

1

This is a question about 3DS and other tools. Not Unity.

Seems to me you’d be better off using an external terrain editor like World Machine 2 or Bryce or Terragen, than somehow expecting to be able to edit a Terrain via an OBJ, which will not import back as a terrain.

For a couple of reasons, I have to do it this way. Mainly because we are making two versions of our project, one for webplayer and one for mobile. Using terrains for android etc isn't realy an option, but the terrains are already built. Secondly, for testing purposes, it's Way handier to use Unity terrains, instead of making them with an external editor. If the terrain has a lot to do with your gameplay, and isn't just used as backdrop that is.. I just wanted to check if I'm on the correct path with the whole splatmap thing.

Actual geometry is going to be more expensive than Unity's terrain engine. Why not use it? But yes, that's what splatmaps are: each channel (RGBA) is a blend weight for the corresponding texture.