Blending Materials using a Gradient?

I’m trying to blend two materials together, but I want them to blend in a gradient fashion so that at the bottom it starts completely at one material and then at the top is completely the other -Does anyone know how I might go about doing this?

It seems like there would be a simple solution for this but I can’t seem to wrap my head around it today.

There’s two ways to approach it…
If it just textures you want to go from one to another, you can put a “Blend” texture between them and activate the “Stencil” button in the texture mapping options, but if you want to blend from one complete material to another, you will need to use Material Nodes (Which I haven’t had a chance to play around with, but there are plenty of tutorials and threads on here, so search away!)

Short answer is “Yes”!

Yeah, I’m looking to blend two complete materials together -I’ve played around with several node solutions but I haven’t been able to get the results I want -I’m sure I’m just overlooking something obvious but I can’t figure out what it is I have to do.

it’s not a node solution; the answer by Ammusionist is a texture channel solution. see wiki http://wiki.blender.org/index.php/Manual/Texture_Channels

Material nodes do not have any notion about height, or Y changes. They do have access to Z (distance from camera), so you could blend materials as the surface gets farther away from camera. To blend vertically using nodes, you would have to have two scene inputs into a compostiing noodle, with a mix node using a shading texture that feeds the mix channel, so that one image was used at the bottom of the image, and the other was used at the top, with a mix in-between. However, that is also relative to the camera, and not strictly height as in Y value.

I hope he doesn’t want to blend colour ramps, or shader properties :wink:

I’ve tried using the method outlined in the Node Tutorials on the wiki but with no success -The material just all blended together and didn’t produce any gradient. Basically I’m trying to blend the textures of the sand and the cliff in the image below so that there’s a gradual change instead of such an abrupt one like there is now.
http://img523.imageshack.us/img523/3236/opedoroxscastle10hl5.png

Read all of this thread about landscapes. You need to use slope detection.

http://blenderartists.org/forum/showthread.php?t=106425

3toedsloth did something similar with vertex painted masks and material nodes: http://www.blendernation.com/2006/08/19/videotutorial-mixing-textures-through-painting/. For more accuracy, you can also mask it with texture-painting if your object has uv coordinates.

Okay, well the solution was a lot more complicated than it should have been but Cyborg Dragon’s node setup for slope detection saved the day. Thanks ericsh6 for pointing me in the right direction.

Be careful - Cyborg Dragon’s node set up actually is view-dependent. If you pitch your camera up and down, it changes what is and isn’t masked by that setup. On page 3, the lighting-based slope detection shows much more promise.

It should be possible to use a simple blend texture to control the transition between two node-based materials, though. A third material, shadeless with just a single blend texture, can be used to factor the mix between your sand and rock materials.

Actually, it’s definitely possible.
http://img.photobucket.com/albums/v388/Psawhn/Blender/th_basicnodes-1.jpg