How can I make this material?

How can I make a material that change its colour on a specific angle? You know what I mean?
If I have a flat grass surface and sculpt this, I want that the sides have another material than the top! (automatically)
Sorry for my bad english, im german!

This Video should help you