Let me first just say I’m still very new to Unity. I am mostly a modeler and texture guy. Shaders aren’t something I have much experience with outside of 3ds Max and even then, I consider myself very noobish.
To the point - I’m using imported geometry for terrains. [I’m in the ‘if I can do it outside of Unity, I will’ camp] Vertex Painting is an option but I’m trying to keep my geometry density down so Vertex painting doesn’t work out so hot and to be honest, I’d much rather do it in the way I need help with - if at all possible.
I’d like to be able to blend, via RGBA, four separate diffuse channels - each channel with it’s own normal and spec [even spec from alpha is fine]. Coupled with a main color blend channel to give the 4 diffuse channels some color variances. With me so far?
This is a 3ds Max gif grab of a similar principle made by someone else
So two main maps for the terrain - the mask and the blend - then up to 4 diffuse textures [and their normals maps [so up to 8 total] which are masked via the masks RGBA. The more Red, blue, green or Alpha the pixel is in the mask [up to 255] the more it shows that masked texture [up to 100%].
The blend map is basically a color blend [with an alpha channel to blend the blend map over the diffuse textures]. It would take the color values from that blend map and apply them over the diffuse of the [up to four] diffuse textures with the alpha of the blend map being the range from 0% blend [100% alpha] to 100% color blend [0% alpha]. To add some overall broad strokes of color for terrains as opposed to those values being strictly clamped to each of the individual diffuse textures. So as an example - a blend map from light brown to rich dark brown and a single diffuse affected it by it should look like that one diffuse is gradating from a light brown to a rich brown - not just be the color of itself. The alpha channel of that blend map would be the value of the color blend. In the previous example, if the alpha was 100% then we wouldn’t see any change color change in the diffuse texture. If the alpha was 0% then the color of the blend map would completely cover the diffuse texture color. What is key here is that the tonal range remains the same. So highlights and shadows in the original diffuse texture remain - it’s just a color blend.
Of course I would love to be ale to use this shader for anything - not just terrains. Any object I’d want to blend two or more textures for, all I should need is the mask with at least 2 channels to use for masking, at least two diffuse textures [with their associated normal maps] and the color blend should be optional. It uses it if it’s there, otherwise it ignores it.
Could some kind soul chime in on this?
Here is a set of working files for anyone willing to give this a shot. It contains:
- terrainObject.fbx
- terrainMask.tga [with alpha]
- terrainBase.tga [used to blend]
- 4 ground diffuse textures and 4 asscociated normal maps [please do not use these maps for anything other than this]
I really hope someone can tackle this. I think it would be a nice shader for everyone, not just me.
To sweeten the deal - I’m happy to trade modeling or texture work for your time building this shader. As long as the workload is fair and I’m honest about my time and experience. Do not hesitate to PM me if you have a deal and are unwilling to publicly show off your needs here.

