Gradient Fade on this texture in cycles I have a bunch of planes with a laser beam texture applied, from the CGCookie tutorial.

I want the beam to fade along the length of the beam. Unfortunately fiddling around with the color gradient node has the fading action along the wrong axis (side to side instead of end to end).

How can I fix this?
This can be done quite a number of different ways, I have listed three.

You could make a new UV map, and rotate the uvs 90° (like chebhou said). Then use that uv map just for the length fade.


You could add a Gradient Texture node (or a image of a gradient) and use a mapping node to control which way the gradient is going.


(my favorite) You could add a Texture Coordinate node and then a Separate XYZ node. That will give you a gradient running along the axis specified. In this picture it would be black at the left edge, and running along the X axis white at the right edge.




So your whole setup could look something like this. The X axis from the separate node is used for the "length fade." The Y axis is how I'm creating the beam fading out top to bottom. Then the Multiply node combines the two gradients.