I’m trying to make a terrain shader with shader graph that makes steep areas rock and flat areas grass. In order to do that I need to get the normal (I think?) of each vertex and then compare it to some kind of threshold? How do I get that vertex normal? I’ve tried using the normal node, but it doesn’t seem to work (I might just be using it wrong though). Thanks!
Thanks for replying! I’m currently doing this (getting y axis from normal vector, checking if its greater than 1) but that just always returns false, and if I change the compare value from 1 to 0 it always returns true. Idrk why, but it kinda seems like it’s comparing the entire mesh normal or something like that?
The Normal Vector is a normalized vector, meaning it has a length of 1, meaning the value range for any component is between -1 and 1. For the y axis, a value of -1 means straight down, 0 means a vertical surface, and 1 means straight up. At no time will the y axis of the normal be greater than 1. Indeed on a sphere you’ll basically never see it equal one. It’ll only ever equal 1 if it’s on a perfectly flat surface.
However a greater comparison with a B of 0 should produce exactly what you’re looking for. If that’s not what you’re getting, I have no idea why not.
Just posting to say thank you: I am inexperienced with ShaderGraph and I was looking for exactly this kind of solution for a simple walls & floors shader.