Hi !
Finally, thanks to the new Lamp Data node, we are able to do a mask capable to adjust itself with the orientation of the object’s faces.
Let’s take an example of a concrete application : The snow.
(same effect in UDK)
The snow only fall on the top of an object. If you use a diffuse texture to apply that effect and then rotat the object, the snow follow and will not be well placed anymore.
With this shader based on the world orientation, if you do a rotation, the snow will stay on the top (and adapt itself to the geometry of the object!)
(all the rocks are the same object with the same shader and textures)
The realisation of the mask is really simple in fact, we use the Vector of the lamp (Hemi) as a World Vector. All we have to do is make a dot product with the Normal Vector of our Geometry node. The Lamp is only used as a vector reference, so if you don’t want the lighting effect, just desactivate it.
I’m in the beginning of the experimentations but the possibilities are endless to create easily some variations (rain, volcannic dust,usury…) in your environnement or put new assets without create a separate texture for each object .
Hope you find this trick usefull !
Please forgive my bad english (and the poor quality of the model, it was just for tests)