Landscape material output is black

Material thumbnails is black, material preview in material editor too, landscape as well. So certainly something is wrong. There are screenshots+notes how my landscape material is constructed. (I’ve opted to use material functions to avoid repetition, keep nodes clean and get a nice flexibility). For simplicity, it has only 2 materials until I learn why it’s not working.

Master material: textures on left as Texture Object → function that samples texture objects, UV’s+tiles them and blends depending on distance → layer blend → result material node

Inside the function (let’s call it ‘terrain function’): Texture2D inputs on left (they grab input from Texture Objects from previous screenshot) → then they split to two groups of duplicate functions that input Texture Objects into Texture Samples and assign them UVs (Landscape Coords) and tiling. Each group has a separate tiling scalar (so material appear to be slightly different in far distances). Let’s call sampling function ‘sampler function’, screenshot later. After sampler functions, they’re distance blended thanks to two functions. One function blends textures (‘blending function’), second creates distances from camera to input into blending functions (‘distances function’).

‘terrain function’

‘sampler function’

‘blending function’

‘distances function’

I dont know much about material functions, but i do know that with landscape materials, They dont always tell you if youve gone over the limit for texture samples or instructions, which would normally give an error. What i mean by that is, you can add 30 texture samples and blend them together no problem, and it will tell you your using 2/16 texture samplers. Then when you go to paint it in the terrain, once you start using 3 or 4 of them in the same square, the whole thing turns black and building the lighting wont fix it. Im assuming your problem may be something along those lines.

Hmm, but I get blacks with and without filling with one layer (material thumbnail is black as well, somehow textures can’t pass through all those functions/processings. I’ve made earlier different landscape materials from tutorial and it worked ok. I guess I could try dissecting or build my terrain material incrementally until I start seeing blacks everywhere if nobody else could figure out from those screenshots. Thanks for trying though!