Author Topic: Exporting colormaps to Unity  (Read 92 times)

adsox

  • New Member
  • *
  • Posts: 4
Hi,

I'm currently playing with the trial version of Instant Terra, and I'm loving it so far!

I do have a couple of questions however-

1. Is there a technique for exporting splatmaps that I've missed? I can sort of make one using an advanced colorize node, but I wanted to check there's nothing else I've missed?
2. You got an Epic grant recently (congrats)! - if I buy the full version as a Unity user can I expect the software to remain at the very least platform agnostic, or (ideally) to add more support for Unity?

Thanks!

Alexis Vaisse

  • Administrator
  • *****
  • Posts: 134
1. When a terrain has a splatmap, use an "Extract color map" node to get this splatmap, then an "Export color map" node to export it.

2. Absolutely. Our users use different game engines, such as Unreal, Unity and also inhouse game engines.
Instant Terra will continue to be game engine agnostic.
The Epic grant is of course a big boost for the development of the Instant Terra Unreal plugin. We hope we'll have the possibility to offer the same to our Unity users.

adsox

  • New Member
  • *
  • Posts: 4
You say "When a terrain has a splatmap" - that's my question I think? How does a terrain *get* a splatmap? So for example I have a terrain that's been colorized and then advanced snow added after that. I can extract that colormap and export it - but is there a way to get that in a Unity splatmap friendly (i.e. RGBA) format?

Thanks!

Alexis Vaisse

  • Administrator
  • *****
  • Posts: 134
There are a number of different ways to assign a color map (aka splatmap) to a terrain:

- Use one of the colorize nodes: Colorize, Advanced colorize, Ramp colorize, User ramp colorize, Colorize satellite map, Snow, Advanced snow, Water level, Advanced water level.

- Import a color map and apply it onto the terrain ("Apply color map" node).

- Create a mask (import a mask, use a mask generator node, create a mask from a terrain or from an erosion node or a colorize node, or create a painted mask) and apply it onto the terrain ("Apply mask" node).

- Create constant color maps, blend them by using masks to get the result you want, use the Warp / Swirl / Tile color map if necessary, then apply the resulting color map onto a terrain.

- Create a color map from 3 masks ("Color map from masks" node) then apply it onto the terrain.

- Create a color ramp, apply it onto a terrain ("Apply color ramp" node), then convert this color ramp to a color map ("Color ramp to color map" node) then apply it onto the terrain.

About the export part: the "Export color map" node generates a RGB image file. You should be able to directly import it in Unity. Or maybe I'm missing something?

adsox

  • New Member
  • *
  • Posts: 4
Haha, I'm sure it's just me being slow and / or not explaining myself very well.

Unity terrain uses a shader that takes an RGBA image (or multiple, but let's just worry about one), and uses the values of the RGBA channels to blend 4 textures together. So, for example:

Red could be rock
Green could be grass
Blue could be sediment
Alpha could be dirt

So one image is used to define which textures are used where on the terrain.

In Instant Terra I think I can sort of do this by using the Colorize node and setting the colours to pure red/green/blue, but I don't think I can assign anything to alpha...

Does that sound about right to you, or have I totally misread / misunderstood you?


Quick update: I've just watched the 'Instant Terra to UE4' video which recommends exporting separate masks for each terrain detail. So I guess I could then pack those into one image?

Alexis Vaisse

  • Administrator
  • *****
  • Posts: 134
Ah I see!

I'd say the best way is to create the masks separately (from slopes, from erosions, etc.) and then use a Color map from masks node to create a color map from them.

In the current version of Instant Terra (v1.15), this node only takes 3 input masks and creates a RGB color map.

In the next version of Instant Terra, to be released next month, it will have 4 input masks and will output a RGBA color map, the alpha mask being optional.

The Export color map will also be updated to create a RGBA image file.

adsox

  • New Member
  • *
  • Posts: 4
OK awesome, thank you!