Im making a terrain (grid and sculpt) and im building a shader for it. Just when i finished doing the grass i realized that i needed to add terrain also. So i thought of making a shader with two (or maybe more) colors and blend them using the height of the geometry as a mask or intensity. I'm trying to figure out how get the height of the geometry in VEX and i can't find it. Is this a handful method or there's something better for shading terrains with multi-textures? Maybe using various shaders, but i tried making groups of primitives by painting but the intersections looks very sharp, i prefer something blended.
You can also use attributes you created in SOPs in your shaders by accessing them with a parameter node and setting the parameter name equal to the attribute name.
PS. BTW, I think that you should strive to only have 1 Lighting Model VOP in your network. Use Constant VOPs (type color) for piping into the Mix. Then pipe the output of the Mix into the Lighting Model before piping that to the Output VOP. This way, you can also pipe the F output on your Lighting Model to the corresponding one on the Output VOP.
Thanks for all the advices! They are really useful and I learned a lot. I advanced with my grass/soil shader. I applied the Y value of the P to define if its grass or soil. For now the soil is just a lambert but i will add some noise and variance. I also add a antialiased noise to the union between. It still needs a lot of work buy I want to share with you for helping me a lot to get results. I'll keep you updated