12
$\begingroup$

I want to add a gradient background to my render, but within the compositor (not with the actual background world setting of the scene). I would also like to don't have to use an image (neither external nor internal) to achieve that.

I rendered my image with transparent enabled in film section of render panel. Then I tried to add a ColorRamp node with an Alpha over node, but now I'm stick on how to give a Factor to this color ramp.

My thought is to give it some coordinates corresponding to Y axis of the image, but I can't find a way to.

Is there a node that give some image coordinates ? (like mapping node in materials)

$\endgroup$
13
$\begingroup$

Add a Texture Node with a blend texture and color ramp. You can adjust the gradient using the Color Ramp in the Textures panel. (See image)

Node Setup

$\endgroup$
  • $\begingroup$ Not my question but from what I read, this was not what I was expecting as it uses a texture. A good answer nonetheless. $\endgroup$ – iKlsR Dec 12 '13 at 20:09
  • $\begingroup$ Well, it actually does the trick, so I'll accept this one. Considering that a "Blend texture" isn't exactly an image... :P Thanks @rioforce!! $\endgroup$ – Polosson Dec 12 '13 at 22:55
  • $\begingroup$ @Polosson I am glad I could help you. :) $\endgroup$ – rioforce Dec 12 '13 at 23:08
  • $\begingroup$ Makes you wonder why every node editor in Cycles has the gradient node available except the compositor... $\endgroup$ – BloodyRain2k Dec 30 '16 at 15:52
6
$\begingroup$

You can generate a Gradient by displacing a RGB node with a white value on the Y axis, and using that as a factor to mix two colors (Note the Wrap Value on X axis on the Transform node).

enter image description here enter image description here

To soften the edge between the two colors apply a Blur node. enter image description here

Then just mix it with your rendered image.

enter image description here

All done within the compositor, with total control on the placement and softness, and no need for additional textures or images.

enter image description here enter image description here

$\endgroup$
1
$\begingroup$

I know this is a little late in coming, but I think I have something closer to what you want and others may benefit from it.

This is a render of the world background done without a texture as shown in the node setup. Blender naturally wants to project the color ramp along the x-axis, but you can rotate it around the y-axis until it faces upward.

$\endgroup$
  • 6
    $\begingroup$ Welcome to the site :) While this is useful in material nodes, the OP was asking about doing this in the compositor.. $\endgroup$ – gandalf3 Jun 29 '14 at 18:07
0
$\begingroup$

I don't think such a node exists. However, you can create a gradient fairly easily if you bring in an external image, convert it to BW, move it around and crop it, then blur it.

For example:

enter image description here

Node setup:

enter image description here

$\endgroup$
  • 2
    $\begingroup$ Good answer but I think OP was looking for something inbuilt, not external, the amount of nodes you used to blur, why not just import a gradient image or use the world settings. ;) $\endgroup$ – iKlsR Dec 12 '13 at 17:58
  • $\begingroup$ @iKlsR yes, you're right I was looking for something inbuilt, not using an external image (nor internal :P). Thanks for the answer BTW @CharlesL! $\endgroup$ – Polosson Dec 12 '13 at 18:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.