How to use alpha to model a rainbow?

I’m trying to model a rainbow and I’d like it to fade out at the edges. I can get the colors I want with a ramp, but up to now I’m not able to get a variable alpha value at the edges.

Unfortunately, it does not work to set the alpha value of the material to zero and use ‘add’ mode with a color ramp (with different alpha values). The alpha of the material seems to be constant all the way. Multiplying does not work, too.

Is there another way to get the desired effect? I know it would be possible with textures mapped to alpha, but the correct coordinate mapping seems to require a lot of effort.

Keep the Material Alpha and assign a texture to the Material, to control the fading Alpha
This texture could be for example a blend texture, and must be mapped to Alpha.

Pat

Using a texture would be a solution, but is this the only way to do it? Maybe there is an option with material nodes?

Yes you can do it with Nodes as well.
Render the Rainbow alone in an extra renderlayer with no background.
This way you will get the opaque rainbow and an Alphamask.
You could for example blur the mask to get an fade out at the edges.

If you feel like using textures, etc., the mapping should be very easy to set up with a UV map unless you’re using some really interesting geometry for your rainbow. :stuck_out_tongue_winking_eye: See this example. (Forgive my choice of colours and note that this can be setup without nodes just as easily; I just felt like playing with them. :P)

Thank you very much for the replies. Blurring the mask was a good idea from Patel and the result in a simple test scenario looks convincing. But the texture mapping in the blend file of Koryo looks good, too. So now I have to decide which way to go… :slight_smile: