- Home /
Other
Importing external splat maps?
So, I've searched around a bit and found a few different questions on this - but they are all from a while ago and none of them seem to work for me.
I've just finished a terrain in World Engine - and have the height map up on Unity now. It's perfect. But there's one small issue. I have no idea how to add the splatmap I created to it.
I've only started using Unity recently and am not much for coding, so please go easy on me, but how can I import a splatmap & apply it to my terrain. Also, is it possible to import multiple splat maps over one another? (So I can use more than three or four textures, depending on whether alpha is involved.)
Answer by philwinkel · Nov 21, 2014 at 02:44 AM
On this page of the World Machine site there is a script to import splatmaps... You generally have to check the "flip" checkbox to get it to import the splatmap from world machine onto your unity terrain correctly.
Otherwise, you can use plugins like TerrainComposer or RTP, but they both have ridiculously complex user interfaces that can take like a week to figure out...
Unity needs to get their terrain straightened out.
Answer by supernat · Jun 01, 2014 at 02:57 AM
Well unfortunately, it's not "easy" with the default terrain editor. I believe unity version 4.6 has some terrain improvements (or maybe 5.0), but maybe you can't wait, and plus I don't know if splat maps are one of them. The current version only allows you to paint over the terrain with a brush to alter which detail maps are visible in varying areas over the terrain.
The terrain does have a Material slot you can assign, so you would think in theory that you could leave the Detail Maps set to nothing, and create your own material that you assign the detail textures to and a splat map. This means you need to create a splat shader (which is not so easy but not too bad). Unfortunately, I don't think this is possible (I couldn't find a simple solution anyway). The material seems to be an additive pass or something, don't see any diffuse texture components being applied to the terrain. It could be that I was not using the proper shader, so if you want to be sure, download the built-in shader pack, and review this shader: Nature/Terrain/Diffuse.
To simplify the splat creation, you could use something like Shader Forge in the Asset Store which would probably make it pretty easy. In fact, the video tutorials kind of hint at how to do this very thing, but they use vertex colors instead of a splat map, so that's all you'd have to swap out from the tutorial to make it work I think. But again, if you can't really use your own terrain shader, it's pointless.
There is a way to override the terrain's built-in splat shading, because there are a couple of awesome terrain shaders on the asset store that do just that. To really simplify, you could just get one of these two terrain assets which I know one of them (maybe both?) give you splat maps with drag & drop ease: https://www.assetstore.unity3d.com/en/#!/content/5664 or https://www.assetstore.unity3d.com/en/#!/content/4722
Those are 3 FANTASTIC plugins in my opinion.
EDIT: By the way, I used World Engine and Relief Terrain Pack with ease (well there's a good learning curve, but it all came together). Also, to answer you 2nd question, you can add as many textures as you want to the details maps, but I believe it will increase the number of render passes by 1 for every 4 textures you add (I don't know the internals, think I read that somewhere though and it seems right).