I’ve previously used L3DT to generate terrain heightmaps and textures, and really love using it. I’ve imported a RAW heightmap from L3DT into Unity without any trouble, but I’m a little confused about applying the generated textures to the terrain.
I have the base map from L3DT that I want to apply to my terrain in Unity. I can see the Base Map Dist. parameter when editing the terrain settings, but I can’t see anywhere to choose the actual base map. Generating a light map and replacing it with my base map texture worked, but surely that’s not the ‘proper’ way?
Also, L3DT generates layer masks, which show exactly where each detail texture (grass, dirt, rock etc) should be applied on top of the base map, and I was wondering if there was a way to utilise these masks in unity, rather than repaint all the textures in unity?
Sorry, but I don’t really understand what you mean. Are the splat maps the textures applied to the terrain? (ie the thing that is seen in the end result)
Or is the splat map Unity’s internal representation of where to show the different textures on the terrain?
Fractscape includes a script which applies a splatmap to the terrain. Most of this area (applying pre-made textures and splatmaps to terrains) relies on undocumented scripting APIs.
Thanks Eric.
When you use the term ‘splatmap’, are you referring to the pretty colourful thing that gets painted onto the heightmap and rendered? Or do you mean the black and white texture that shows where a certain pretty colourful thing should and should not be applied to the heightmap?
Yeah, I was beginning to think that it might be undocumented stuff, seeing as I wasn’t turning up much in the manuals or references. Is there anywhere I can look to read about undocumented things? Do you have any idea about what I could be fiddling with?
cheers,
Cam
PS- I’m aware that undocumented things are subject to removal or change in future versions etc etc
The splat map is the “color full thing” that defines where which of your textures will be painted to which degree at a specific pixel position. You can see it if you open the terrain asset in the resource tree where it will list the splat maps
There isn’t a black and white texture actually…a splatmap uses the rgba channels of a control texture, with each channel controlling a different terrain texture. If you have grayscale textures, you’d have to combine them into a proper splatmap before you can use them for anything in Unity. You need one splatmap for every 4 textures. The script I mentioned only works for 1 splatmap though.
There’s a topic somewhere on the forum that deals with more of the undocumented stuff, which should turn up in a search.
Oh I think I understand now.
So the splat map is an RGBA, where each colour channel is a number that corresponds to the degree to which each of 4 textures is applied to that point.
What about determining which texture is being used by which channel of the splatmap? Do I just have to ensure I add my textures to the terrain in the correct order?
OK, that makes sense now.
Now I just have to turn my 4 greyscale png’s into 1 png…
Hopefully there’ll be a simple way to do this with paint.net. Unless anyone else has a better suggestion?