[C4DtoA] How can I make my background object visible in refractions?


You can’t. The background object isn’t visible in refractions. Or reflections, or anything but camera rays.

Here’s an example: a refractive sphere in front of a torus, in front of the background checkerboard object. The black areas are where the background object isn’t visible to refraction rays.

c4d_background_object_refraction

The “background object” is actually a shader plugged into the Arnold background slot.

You won’t see it in Cinema 4D, but when C4DtoA translates the scene to Arnold, the background object is translated as a shader plugged into the options.background parameter (in Cinema 4D, this is the Environment > Background parameter in the Render Settings).

In an ASS file, it looks like this:

options
{
background "c4d|Background"
}

image_plane
{
 name c4d|Background
 color c4d|Arnold_Shader_Network|checkerboard
 lenx 1
 leny 1
 ox 0
 oy 0
}

The image_plane node is a shader, and if you were to check its code, you’d see that it handles camera rays only; for any other ray type (like refraction), the image_plane shader returns black.

shader_evaluate 
{ 
    if (!(sg->Rt & AI_RAY_CAMERA)) 
    {
        sg->out.RGBA = AI_RGBA_BLACK;
        return; 
    }

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s