Go to: Related nodes. Attributes.

The Use Background shader allows you to mix computer-generated objects with scanned images in a seamless way. An object with a Use Background shader does not show up in the scene; wherever that material is, you just see the background image of the scene. However, shadows can fall on the material, and if it is made shiny, it can reflect other computer-generated objects.

For example, let's say you scan in a picture of a tree, and put that on an image plane. You can then create a tube to "stand in" for this tree in the scene. Position it so that it lines up with the tree, and assign a Use Background shader to it. When you render, you will not see the tube. Rather, you will see the tree in the background image. But if a computer-generated object should cast a shadow on the tube, it will appear to be cast on the tree. And if a computer-generated object should pass behind the tube, it will sppear to be passing behind the tree in the background image.

In the table below, important attributes have their names indicated in bold in the description column.

This node is MP safe

Node nameParentsClassificationMFn typeCompatible function sets
useBackgrounddependNode
shader/surfacekUseBackgroundkBase
kNamedObject
kDependencyNode
kUseBackground

Related nodes

lambert, reflect, phongE, phong, blinn, anisotropic, volumeShader, simpleVolumeShader, surfaceShader, displacementShader, layeredShader, defaultShaderList, shadingMap

Attributes (92)

The following quick index only shows top-level attributes (too many attributes to show them all): backgroundSampler, lightDataArray (14), matteOpacity, matteOpacityMode, miAbsorbs, miAngle, miColor (3), miDeriveFromMaya, miDiffuse, miFrameBufferWriteFactor, miFrameBufferWriteFlags, miFrameBufferWriteOperation, miNormalCamera (3), miOcclusionMask, miReflectionBlur, miReflectionRays, miReflectivity, miRefractions, miRefractiveIndex, miShinyness, miSpecularColor (3), miSpreadX, miSpreadY, miTranslucence, miTranslucenceFocus, miTransparency (3), miWhiteness (3), normalCamera (3), objectId, outColor (3), outMatteOpacity (3), outTransparency (3), pointCamera (3), primitiveId, rayDepth, rayDirection (3), rayInstance, raySampler, reflectionLimit, reflectivity, shadowMask, specularColor (3)

Long name (short name)TypeDefaultFlags
objectId (oi) addr0inputconnectablehidden
TrenderGroup*
primitiveId (pi) integer0inputconnectablehidden
triangle id
raySampler (rtr) addr0inputconnectablehidden
ray sample pointer
backgroundSampler (rtb) addr0inputconnectablehidden
background sample pointer
rayDepth (rd) short0inputconnectablehidden
current ray depth
rayInstance (ryi) integer0inputconnectablehidden
Unique ray identifier controlling the sampling distribution for volume light depth map shadows, fluid volume rendering, light fog, ray traced shadows, and motion blur.
rayDirection (rad) float3inputconnectable
the ray direction.
rayDirectionX (rdx) float0.0inputconnectable
ray direction X value.
rayDirectionY (rdy) float0.0inputconnectable
ray direction Y value.
rayDirectionZ (rdz) float1.0inputconnectable
ray direction Z value.
outColor (oc) float3outputconnectable
output color
outColorR (ocr) float0.0outputconnectable
outColor red value
outColorG (ocg) float0.0outputconnectable
outColor green value
outColorB (ocb) float0.0outputconnectable
outColor blue value
outTransparency (ot) float3outputconnectable
output Transparency
outTransparencyR (otr) float0.0outputconnectable
outTransparency R value
outTransparencyG (otg) float0.0outputconnectable
outTransparency G value
outTransparencyB (otb) float0.0outputconnectable
outTransparency B value
pointCamera (pc) float3outputinputconnectable
surface intersection point in camera space
pointCameraX (px) float1.0outputinputconnectable
point camera X value
pointCameraY (py) float1.0outputinputconnectable
point camera Y value
pointCameraZ (pz) float1.0outputinputconnectable
point camera Z value
normalCamera (n) float3outputinputconnectable
Normal Camera represents the surface normals in the camera's space. (These are used to calculate shading.)

To do Bump Mapping, connect the output of a bump node to this attribute.

normalCameraX (nx) float1.0outputinputconnectable
normal camera x value
normalCameraY (ny) float1.0outputinputconnectable
normal camera Y value
normalCameraZ (nz) float1.0outputinputconnectable
normal camera Z value
lightDataArray (ltd) lightDataNULLarrayinputconnectablehidden
The lighting information this node computes.
lightDirection (ld) float3inputconnectablehidden
The light direction.
lightDirectionX (ldx) float1.0inputconnectablehidden
The x component of the direction.
lightDirectionY (ldy) float1.0inputconnectablehidden
The y component of the direction.
lightDirectionZ (ldz) float1.0inputconnectablehidden
The z component of the direction.
lightIntensity (li) float3inputconnectablehidden
The light intensity (its a colour).
lightIntensityR (lir) float1.0inputconnectablehidden
The red component of the intensity.
lightIntensityG (lig) float1.0inputconnectablehidden
The green component of the intensity.
lightIntensityB (lib) float1.0inputconnectablehidden
The blue component of the intensity.
lightAmbient (la) booltrueinputconnectablehidden
The boolean that indicates if the light has an ambient component.
lightDiffuse (ldf) booltrueinputconnectablehidden
The boolean that indicates if the light has a diffuse component.
lightSpecular (ls) boolfalseinputconnectablehidden
The boolean that indicates if the light has a specular component.
lightShadowFraction (lsf) float0.5inputconnectablehidden
The visibility fraction to the light. value is in [0,1]
preShadowIntensity (psi) float1.0inputconnectablehidden
Luminance of pre shadow light intensity.
lightBlindData (lbd) addr0inputconnectablehidden
The light's blind data.
shadowMask (sm) float1.0outputinputconnectablestorablekeyable
shadow attenuation. If less than 1.0, it makes the shadows appear dimmer. At a value of 0, the shadows are not visible.
reflectionLimit (fll) short2outputinputconnectablestorable
reflected ray depth limit
specularColor (sc) float3outputinputconnectablestorable
Specular Color is the color of the specular reflections (also called 'hot spots') on the material. The final color of a specular reflection is a combination of the Specular Color and the color of the light.

By making the Specular Color brighter or dimmer, you can control the brightness of the specular reflections on an object.

Tip: To make a material look more plastic, use white for the specular color. To make a material look more metallic, make the specular color similar to the surface color.

specularColorR (sr) float0.5outputinputconnectablestorablekeyable
specular color red value
specularColorG (sg) float0.5outputinputconnectablestorablekeyable
specular color green value
specularColorB (sb) float0.5outputinputconnectablestorablekeyable
specular color blue value
reflectivity (rfl) float0.5outputinputconnectablestorablekeyable
Reflectivity is used to make an object reflect light like a mirror. Set this to 0 is you don't want your material to reflect at all. Increase the value to make brighter reflections. Note that brighter reflections hide more of the base surface color.

This attribute is only meaningful if there is a reflection map, or if you are doing Ray Tracing.

Here are some useful values for Reflectivity:

    Car Paint: 0.4
    Glass: 0.7
    Mirror: 1.0
    Chrome: 1.0

Note: If you are doing Ray Tracing, and you want other objects in the scene to be seen in reflections, then you must turn on the Visible In Reflections attribute of those objects.

matteOpacityMode (mom) enum2outputinputconnectablestorable
Matte Opacity Mode controls how the system will use the Matte Opacity attribute (below). When you are rendering with a matte (i.e. an alpha channel, or mask), these two attributes are used to control how this material will show up in the matte. This is useful if you will be compositing your rendered images later on.

There are three settings, used for different purposes:

    Opacity Gain: (the default). Matte values are calculated in the normal way (based on the transparency of the object) then multiplied by the Matte Opacity. (Matte Opacity has a default value of one, by default these attributes have no effect.) With Opacity Gain, you can animate the Matte Opacity value to change the overall transparency of the object when it is later composited.

    Solid Matte: This is like Opacity Gain, except that the normally-calculated matte values are ignored in favor of the Matte Opacity setting. The entire matte for the object is set to the value of the Matte Opacity attribute. If there are transparent areas on the object, their transparency is ignored in the matte. Use this setting to composite an object with transparent parts, when you don't want the background to show through them.

matteOpacity (mog) float1.0outputinputconnectablestorablekeyable
Matte Opacity is used (along with Matte Opactiy Mode) to affect how the matte (i.e. alpha channel or mask) for this material will be calculated. See Matte Opacity Mode above for full details.
outMatteOpacity (omo) float3outputconnectable
output Matte Opacity
outMatteOpacityR (omor) float0.0outputconnectable
output Matte Opacity red value
outMatteOpacityG (omog) float0.0outputconnectable
output Matte Opacity green value
outMatteOpacityB (omob) float0.0outputconnectable
output Matte Opacity blue value
miReflectionBlur (mircb) float0outputinputconnectablestorable
Enable reflection blur by shooting more reflection rays. Blurry reflections require supersampling because a ray's direction is not exactly determined anymore. It may deviate (randomly) from the perfect specular direction, within the bounds specified by miReflectionBlur (in angle). A value of zero implies a perfectly specular interaction, a value of 90 a perfectly diffuse reflection or refraction. Values of 10 to 30 are a good starting point
miReflectionRays (mircr) short1outputinputconnectablestorable
Number of reflection rays to use for blurring. miReflectionRays specifies number of rays to use to sample the random deviation. In general more rays are required for more blurry reflections or refractions. Other sampling parameters also affect this setting: per-object samples and the Render Settings sample setting supersample in image space. If you increase any of these two settings, you may be able to reduce the number of rays without loss of quality, but significant performance gain.
miDeriveFromMaya (mifm) booltrueoutputinputconnectablestorable
Derive photon shader parameters from the shading node if enabled, otherwise use explicit mental ray attributes.
miShinyness (mis) float10outputinputconnectablestorable
Photon shader shinyness parameter to control glossy reflection and refraction.
miAngle (mia) float0outputinputconnectablestorable
Photon shader angle parameter to control direction of anisotropic feature.
miSpreadX (misx) float10outputinputconnectablestorable
Photon shader x spread parameter to control size of anisotropic feature in x direction.
miSpreadY (misy) float5outputinputconnectablestorable
Photon shader spread parameter to control size of anisotropic feature in y direction.
miWhiteness (miwn) float3outputinputconnectablestorable
Photon shader whiteness parameter.
miWhitenessR (miwnr) float0.5outputinputconnectablestorable
Red component.
miWhitenessG (miwng) float0.5outputinputconnectablestorable
Green component.
miWhitenessB (miwnb) float0.5outputinputconnectablestorable
Blue component.
miSpecularColor (misc) float3outputinputconnectablestorable
Photon shader specular color parameter.
miSpecularColorR (miscr) float0.5outputinputconnectablestorable
Red component.
miSpecularColorG (miscg) float0.5outputinputconnectablestorable
Green component.
miSpecularColorB (miscb) float0.5outputinputconnectablestorable
Blue component.
miReflectivity (mirf) float0.5outputinputconnectablestorable
Photon shader reflectivity parameter.
miRefractiveIndex (miri) float1outputinputconnectablestorable
Photon shader index-of-refraction parameter.
miRefractions (mirc) booltrueoutputinputconnectablestorable
Photon shader refractions parameter.
miAbsorbs (miab) booltrueoutputinputconnectablestorable
Photon shader absorption parameter.
miDiffuse (midc) float0.8outputinputconnectablestorable
Photon shader diffuse parameter.
miColor (mic) float3outputinputconnectablestorable
Photon shader base color parameter.
miColorR (micr) float0.5outputinputconnectablestorable
Red component.
miColorG (micg) float0.5outputinputconnectablestorable
Green component.
miColorB (micb) float0.5outputinputconnectablestorable
Blue component.
miTransparency (mit) float3outputinputconnectablestorable
Photon shader transparency parameter.
miTransparencyR (mitr) float0outputinputconnectablestorable
Red component.
miTransparencyG (mitg) float0outputinputconnectablestorable
Green component.
miTransparencyB (mitb) float0outputinputconnectablestorable
Blue component.
miTranslucence (mitc) float0outputinputconnectablestorable
Photon shader translucency parameter.
miTranslucenceFocus (mitf) float0.5outputinputconnectablestorable
Photon shader translucence focus parameter.
miNormalCamera (minc) float3outputinputconnectablestorable
Port to connect bump node for photon shader.
miNormalCameraX (mincx) float0outputinputconnectablestorable
X coordinate
miNormalCameraY (mincy) float0outputinputconnectablestorable
Y coordinate
miNormalCameraZ (mincz) float0outputinputconnectablestorable
Z coordinate
miOcclusionMask (mio) float1outputinputconnectablestorable
This attribute controls contribution from indirect diffuse illumination to the useBackground shader. The alpha value of the indirect illumination on a surface point is scaled by this attribute, and contributes to the final color and alpha. 0 means no indirect illumination on the surface, which is same as the old behaviour. If set to 1, useBackground will be affected by final gather like other material shaders, but only in grey scale.
miFrameBufferWriteOperation (mifo) enum1outputinputconnectablestorable
Operation to use when writing shader results to frame buffers
miFrameBufferWriteFlags (mifl) integer0outputinputconnectablestorable
Bitfield of flags for write operation. Currently only the first bit has any affect. It sets the shader to use the scale factor parameter when writing to frame buffers.
miFrameBufferWriteFactor (miff) float1.0outputinputconnectablestorable
Scale factor for frame buffer write operation