Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Overview

...

Section
Column
width62%55%

The Sampler Info node is a Maya utility node that provides various scene information. V-Ray Extra Attributes can be applied to the node to increase the node's output options. For more information, see the Additional Outputs section of the Texture Attributes page.

The Sampler Info node is a color image that provides information about the scene, with the choice to show any of various aspects as color blocks. This provides information about various aspects of the shaded points such as position, normal, bump normal, reflection/refraction vectors and UVW coordinates. It can be used either for world position passes or normal passes. It also extracts information about the scene, converting the gathered information into RGB data for use in compositing.

 

UI Path: ||Select Sampler Info node|| > Attribute Editor > Attributes menu > VRay > Additional outputs

Column
width5%

 

Column
width33%40%

 

 

Additional Outputs

...

Section
Column
width62%55%

Normal Obj – Specifies the smooth normal in object space.

Normal World – Specifies – Specifies the smooth normal in world space.

Geom Normal World – Specifies the geometric normal in world space.

Point World Reference – Specifies the shading point in reference space. 

Normal World Reference – Specifies the bump normal in relative space. 

Bump Normal World – Specifies the bump normal in world space.

Bump Normal Camera – Specifies the bump normal in camera space.

Bump Normal Object – Specifies the bump normal in object space.

Ray Depth – Specifies the ray length.

Path Length – Specifies the path length. 

Surface Material ID – Specifies the material ID if the surface supports it. 

Object ID – Specifies the object ID of the hit object.

Parent Object ID – Specifies the object ID of the parent object.

Velocity World – Specifies the velocity at the intersection point in scene units per frame (in world space).

Speed – Specifies the speed at the intersection point in scene units per frame. 

Random by ID – Assigns a random color/texture by each object's ID.

Random by Polly Shell – Assigns a random color/texture based on the polygon shell the current face belongs to. 

Random by scene name – Assigns a random color/texture by each object's full scene path.

Frame Index Offset – Outputs an offset from the current frame for motion blur intervals longer than one frame. For example, if you have a Motion Blur interval spanning three frames, the output will return -1, 0, or 1 depending on the ray time. See the example below where the Frame Index Offset option is used to mix textures from a sequence to produce a motion blur effect. This option is not supported with V-Ray GPU.

Transparency Level – Outputs how many transparency intersections have occurred at the point of intersecting the first surface along the ray path. See the use case below for more information.

Column
width5%

 

Column
width33%40%

Image Removed 

Image Added 

Common Uses

...

The SamplerInfo node extracts particular information about the scene. It then converts the gathered information into RGB data. It can be used within the Maya Hypershade or to drive a material channel to achieve various effects. This can provide more render passes with information that can allow more possibilities to editing during the compositing process.

...

Section
Column
width10%

 

Column
width490px


The V coordinates of a V Ramp with Linear interpolation.

 

Column
width490px


The V coordinates of a V Ramp with Interpolation set to None.

 

Column
width10%

 

 

...

Anchor
frame
frame

Example: Frame Index Offset 

 

With Maya SamplerInfo's extra attribute Frame Index Offset you can simulate a motion blur effect on a sequence of textures. In this example, we have a sphere object that changes its position with with each frame. The Camera Motion Blur options are enabled with Duration set to 2 frames. The object is initially assigned a material with an Image sequence file connected to its Color. This results in motion blurred geometry that only uses a single texture per frame.

To achieve the mixing between the textures, a VRayMultiSubTex with three sub-textures starting from 0 is created and linked to the Color input instead. The three textures are connected to three file nodes within the same sequence, but a different Frame Offset: -1 for previous, 0 for current and 1 for next.

The VRayMultiSubTex Get ID from is set to Texture Switch and a floatMath node is connected to control the Switch texture. This is done because VRayMultiSubTex cannot have negative values for input.

The SamplerInfo's extra attribute Frame Index Offset is plugged in Float A. Float B is set to 1 with an Add operation between the two. Now the 0 texture is used for the -1 or previous frame, 1 for the current or 0 frame and 2 for the +1 or next frame.

 

Section
Column
width45%

Image Added 

Column
width5%

 

Column
width50%

Image Added

 

Image Added

Duration (frames) is set to 2 - the effect interpolates between the three frames using the three textures.

 

 

...

Anchor
intersect
intersect

Example: Translucency Level

 

The Translucency level output in the Additional Outputs of the samplerInfo node indicates the number of transparency intersections at a shaded point. In this example, we set up a VRaySwitchMtl with two semi-transparent materials: a reflective material at input 0 and a diffuse material at input 1. We use a floatLogic node to check the Transparency Level output and to return 0 (or false) when there are no more than 1 transparency intersections or 1 (true) when there are more than 1 intersections. The floatLogic then drives the VRaySwitchMtl so that the reflective material is assigned when we shade the first transparent object, but the diffuse material is used for the rest of the objects only when they are seen through the first transparent object. Download the scene to take a closer look at the setup.

 

UI Button
colorblue
sizesmall
icondownload
titleDownload Scene
urlhttps://drive.google.com/file/d/1oJ2eWFLNJitFK4eIojGgg-027iJj1pD3/view?usp=sharing

 

Section
Column
width50%

Image Added

Column
width5%

 

Column
width45%

Image Added