How to make a texture always upright relative to the global Z? I have a character with a hologram effect by using the Layer Weight node.



The file won't upload so here's an image:



So when the Layer Weight node is connected in the Factor of the Mix Shader, the two inputs of the Mix shader are blended in a way that whatever is in the first input, it will be shown on the normals of the character that are more facing the camera (Emission and Transparent shader, in my example). I’m using a similar material with a gradient texture, its just that the polygons (with the "Lines" Attribute) that are more facing the camera are mixed with transparency and the other once with Emission. The normal map of the character is using a different UV layout/Attribute (this is more clear in the node setup of the file). But, is there a way for the lines to face the Global Z direction all the time even when I animate the character? Because the lines are likely to be animated to travel at the Z axis.

The texture for the lines - http://fc04.deviantart.net/fs71/i/2012/225/8/5/gradient_stock_01_by_gradient_textures-d5ayk4y.jpg
Yes.

The simplest way to do this is by using Object coordinates plugged into a Vector transform node set to transform from Object space to World space:



This will preserve the texture's location relative to the object, so moving the object up and down in world space will keep the textured "glued" to it:



If you don't want this, then you can use the Z channel of the ray position:



This will keep the texture fixed in world space:



Watch the upward translation closely to spot the difference between the two methods.

Note that I tested these with a procedural texture, so I'm not 100% sure it will work with an image texture. I assumed that a procedural texture might suit your needs better anyway. Here's the setup I used: