3
$\begingroup$

I have transparent objects, with colors, like seen here:

enter image description here

If I switch on Render Settings -> Film -> Transparent Background, I loose all colors of my transparent objects:

enter image description here

I've already tried to get it with compositing running, but I dont get a renderpass with the color on it. Someone have an idea why, and how to solve this?

$\endgroup$
  • $\begingroup$ Isn't this because the path traced through a transparent object doesn't have any component going back to the camera (in this scene)? If you put a diffuse plane (or background as you did) behind it then there will be reflected rays which allows you to see the colour. $\endgroup$ – PaulMc Aug 29 '17 at 19:27
2
$\begingroup$

As it's been said, your setup lacks a source of white light.

You can add such a source with a trick: an emissive and shadeless plane that is only visible through transparent objects, and completely transparent otherwise.

  1. Add a plane big enough to fill your Camera view, place it in the background and parent it to the camera

    enter image description here

  2. Give it a material like the one in the figure below. The value in the Mix Shader to the left determines the maximum transparency that your objects will have in the rendered png (since this is a residual opacity of the plane itself).

    The only rays we are interested in are the ones pointed towards the camera, so uncheck all the other rays from the Object > Cycles settings panel

    enter image description here

  3. The result

    enter image description here

  4. You can unveil the plane's trick by looking at its boundaries

    enter image description here

$\endgroup$
0
$\begingroup$

The color in the first image is comes from the background color as seen through the tansparent color of the objects. The objects themselves don't reflect any light. If you set the background color to black, the objects would also appear black.

In the second case, you're also seeing the background as seen through the transparency of the object. However, since transparency is expressed in an alpha channel, there is no color to it. Alpha channels are grey scale only and do not contain any RGB information. Since the objects reflect no color either, the result is a black and white image.

Within the restriction of grey scale alpha channels, there is no immediate solution to what you're trying. If you add a coloured surface reflection to the objects, you will get alpha transparency and a color surface, but the result will not be the same as in the first case.

$\endgroup$

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.