I want to color a terrain according to how steep the slope is at each point. I've read How do I colour a 3D terrain based on its height?. If I could generate a new surface that is the gradient of my terrain (such that height of the new surface corresponds to slope in the original), then I could create that height-based material and apply it to the the original terrain. Is this feasible? Is there a better way to create a slope-based material?
Yeah,, you can actually do it follow this video: https://youtu.be/qSafYNQrodk?t=1330
But here you have a simplified node setup to do it:
The color ramp is used to choose the steepnes you want to select, the white parts are what is selected, so maybe you'll need to inverse the color ramp colours. The "Average Node" of the video is actually the "Vector Math" node with the average option choosed, I don't know why he used it, the simplified node setup that I shared works equally.
How this works? I really don't know, I only know that you use the perpendicular normal axis (in this case the Z) to get the stepness in said axis and the ramp to set the threshold.
With three points (black, white, black) in the color ramp and the ease mode you can customize more the selection.