Hello my friends!
We are a team working on a huge landscape pipeline-project in UE4, Right now we have 600 heightmaps (1km each), So we are working with World composition to load the 600xheightmaps to make the tiles making up the landscape. My college who generated the tiles also generated a ortophoto/texture for each tile + a material ID mask for stuff like grass/trees/mountain etc.
We want 1 Landscape material instance per tile = 600 Materials(instances of master mat).
My first approach was to create a blueprint to loop the tiles creating a Dynamic Material Instance for each tile and use the name of the tile to lookup the texture and set the diffuse texture parameter of the Dynamic Material Instance to the right texture. Super easy stuff right?
It turns out that Landscapes does not support Dynamic Material Instances…
I tried this both with Call in Editor and at runtime.
My next try was to do some editor scripting(blueprint and Call in Editor) and create Material Instance Constants in the content browser. So I manage to loop the tiles, create a new material instance in the content browser and assign them to each tiles. Im now stuck on a way to script change the texture parameter of each Material Instance Constant in the content browser since doing things one-by-one is not an option in our pipeline since we are working with so many tiles. So this got me very close, 1 mat instance per tile and they are all assigned to the right tile, just cant change the Texture parameter of each mat, so I have unique mats on all the tiles but they are all the same since I cant change the texture input of them^^ (see picture)
Any Ideas or other solutions?
we also had a idea of MEL-script the creation of the materials in Maya/Max with the right textures and then drag and drop import them into UE4, that would get us all the 600 mats with the right textures and the just loop assign them to the right tiles but this would not work since we need them to be Instances of the Landscape Master materials so we can spawn trees and do some advanced Material actions
I need the big brains of the community on this one!
we have a tile based world composition landscape made up of 600 tiles (1km each) and we have 600 textures, one for each, how do we make a blueprint/script to create material instances of our Landscape Master Material, hook up the right texture and assign them to each tile. Doing things by hand is not an option, needs to be automated. Dynamic Material Instances does not work with landscapes(?)