Can you set 'Matte' colour of an outputted image (Cycles)?

Hi there,

Let’s say you have a cube with white Emission material, rendered in empty space. The ‘Film’ render setting is set to transparent, so if you rendered the scene to output as an RGBA, you would get a transparent area around the cube.

Now let’s say you switch the output to RGB or BW. The empty/transparent space would be filled with black, but what if you wanted the empty space to be white on a BW or RGB output image? You may say that it cannot be white because the cube is in a dark empty space, therefore the antialiasing would need to put black bits in the antialiased edges. It might also be said to make the World Background white, but doing that casts light onto the cube and you might not want World light to effect the cube.

Right now, I am having to render it as RGBA then use Compositing Node Editor to fill the transparent hole with white.

The Compositor it’s the best way to do it. But if you want to do it directly in the render, go to the World Settings Panel, and set the Ray Visibility just to Camera.

Thanks. So the way I said I was doing it at the end is the best way to do it?

There’s no best way, but different ways to different goals…

if for example you need your scene illuminated by the world, then you have to do it in Composing, or with a more complex Word Shader, based on the IsCamera flag.

I said compositor was the best way, just because it’s the more versatile for different situations.

Do a search for my Ubershader. It has a built in matte option.

Thanks all!