Varying Procedural Textures by Height

I've come to rely a lot on the trick of using the geometric position of an object to vary a procedural texture. Eg to put moss around the base of a rock or snow on top. But it works globally, so if I move the rock up I have to change the amount I subtract from the z coordinate to put the area of transition back in place. Is there a way of doing it relative to the object itself? So if I move the object up or down the snow (for example) still stays in the same place? Thanks in advance. 

  • spikeyxxx replied

    What you are looking for is something like this:

    maybe? Where the X-, Y-Location in the World determine the pattern, but the Z-location is using the Object's coordinates and when you move an Object, it's coordinates (in this case only the Z-) stay the same. The Object's (X- and Y-)  Location are the Location of the Origin of the Object, so just single values, so I added the Generated X and Y to that to give some variation in X and Y on the Object itself. You can then use the Vector that comes out of the framed Nodes for whatever you want.

    Hope this helps.

  • Scott Beynon(sbe07862) replied

    That's done it nicely. Thanks for your help Spikey!