- Home /
How expand the terrain palette of textures
How to programmatically expand the terrain palette of textures ? I do not need a shader. I just want to add texture to the palette. Best regards
Why programmatically? Just add one with the Add Texture button.
I would also like to programmatically get at the terrain texture palette. I want a dropdown that allows me to easily bring in a predefined set of textures. This doesn't at all seem to be an odd request, yet I can't find details on how to do this anywhere.
I need a programmatic way, as I have to collect 176 terrain through json. 176 squares - it is too much to raise their hands. I was about to alphamaps c # (I'm glad that it's easy, and there are many examples) and I want to fill in the same palette of json.
Answer by ArtOfWarfare · Dec 19, 2015 at 04:01 PM
I realize it's nearly 10 months later, but hopefully this can help future people if not you.
You want to add a new SplatPrototype
to Terrain.terrainData.splatPrototypes
. Every SplatPrototype
instance has a variable texture
which takes a Texture2D
.
I haven't actually tried this myself yet (so I don't have any sample code to share doing this) but while looking into a similar thing (just printing out the list of textures used on a terrain) I found this info.