Go to: Related nodes. Attributes.

Sampler Info is a utility node you can use to get all kinds of information useful for building shader networks. The job of Sampler Info is to give you information about the each point on a surface as it is being "sampled", that is, calculated for rendering purposes.

Sampler Info can give you information about a point's position in space, its orientation and tangency, and its location relative to the camera. Many of the attributes for this node provide values in "camera coordinate space". This is the local object space of the camera. Each camera (in its own space) is located at the point 0, 0, 0. It is looking straight along the negative Z axis, and the positive Y axis is pointing up. In the table below, important attributes have their names listed in bold in the description column.

This node is MP safe

Node name Parents Classification MFn type Compatible function sets
samplerInfo node
utility/general kSamplerInfo kBase
kNamedObject
kDependencyNode
kSamplerInfo

Related nodes

blendColors, clamp, lightInfo, gammaCorrect, surfaceLuminance, contrast, luminance, rgbToHsv, hsvToRgb, setRange, resolution, renderQuality, renderGlobals, renderGlobalsList, baseShadingSwitch, singleShadingSwitch, doubleShadingSwitch, tripleShadingSwitch

Attributes (37)

facingRatio, flippedNormal, matrixEyeToWorld, normalCamera, normalCameraX, normalCameraY, normalCameraZ, pixelCenter, pixelCenterX, pixelCenterY, pointCamera, pointCameraX, pointCameraY, pointCameraZ, pointObj, pointObjX, pointObjY, pointObjZ, pointWorld, pointWorldX, pointWorldY, pointWorldZ, rayDirection, rayDirectionX, rayDirectionY, rayDirectionZ, tangentUCamera, tangentUx, tangentUy, tangentUz, tangentVCamera, tangentVx, tangentVy, tangentVz, uCoord, uvCoord, vCoord

Long name (short name) Type Default Flags
pointCamera (p) float3 0.0, 0.0, 0.0 outputinputconnectablestorable
Point Camera gives you the position of the point being sampled, in camera coordinate space.
pointCameraX (px) float 0.0 outputinputconnectablestorable
The X component of Point Camera
pointCameraY (py) float 0.0 outputinputconnectablestorable
The Y component of Point Camera
pointCameraZ (pz) float 0.0 outputinputconnectablestorable
The Z component of Point Camera
pointObj (po) float3 0.0, 0.0, 0.0 outputinputconnectablestorable
Point Obj gives you the position of the point being sampled, in the object's local coordinate space.
pointObjX (pox) float 0.0 outputinputconnectablestorable
The X component of Point Obj
pointObjY (poy) float 0.0 outputinputconnectablestorable
The Y component of Point Obj
pointObjZ (poz) float 0.0 outputinputconnectablestorable
The Z component of Point Obj
pointWorld (pw) float3 0.0, 0.0, 0.0 outputinputconnectablestorable
Point World gives you the position of the point being sampled, in world coordinate space.
pointWorldX (pwx) float 0.0 outputinputconnectablestorable
The X component of Point World
pointWorldY (pwy) float 0.0 outputinputconnectablestorable
The Y component of Point World
pointWorldZ (pwz) float 0.0 outputinputconnectablestorable
The Z component of Point World
normalCamera (n) float3 0.0, 0.0, 1.0 outputinputconnectablestorable
Normal Camera gives you the surface normal at the point being sampled, in camera coordinate space. The "surface normal" is a vector that points directly away from the surface (at right angles to it) at that point.
normalCameraX (nx) float 0.0 outputinputconnectablestorable
The X component of Normal Camera
normalCameraY (ny) float 0.0 outputinputconnectablestorable
The Y component of Normal Camera
normalCameraZ (nz) float 0.0 outputinputconnectablestorable
The Z component of Normal Camera
uvCoord (uv) float2 0.0, 0.0 outputinputconnectablestorable
U V Coord gives you the U and V surface coordinates of the point being sampled.
uCoord (u) float 0.0 outputinputconnectablestorable
The u component of U V Coord
vCoord (v) float 0.0 outputinputconnectablestorable
The v component of U V Coord
rayDirection (r) float3 0.0, 0.0, 1.0 outputinputconnectablestorable
Ray Direction gives you a vector that points from the point being sampled to the camera position, in camera coordinate space.
rayDirectionX (rx) float 0.0 outputinputconnectablestorable
The x component of Ray Direction
rayDirectionY (ry) float 0.0 outputinputconnectablestorable
The y component of Ray Direction
rayDirectionZ (rz) float 0.0 outputinputconnectablestorable
The z component of Ray Direction
tangentUCamera (tu) float3 1.0, 0.0, 0.0 outputinputconnectablestorable
Tangent U Camera is the surface tangent in the U direction at the point being sampled, in camera coordinate space. Tangents are not well-defined for polygon objects.
tangentUx (tux) float 0.0 outputinputconnectablestorable
The X component of Tangent U Camera
tangentUy (tuy) float 0.0 outputinputconnectablestorable
The Y component of Tangent U Camera
tangentUz (tuz) float 0.0 outputinputconnectablestorable
The Z component of Tangent U Camera
tangentVCamera (tv) float3 0.0, 1.0, 0.0 outputinputconnectablestorable
Tangent V Camera is the surface tangent in the V direction at the point being sampled, in camera coordinate space. Tangents are not well-defined for polygon objects.
tangentVx (tvx) float 0.0 outputinputconnectablestorable
The X component of Tangent V Camera
tangentVy (tvy) float 0.0 outputinputconnectablestorable
The Y component of Tangent V Camera
tangentVz (tvz) float 0.0 outputinputconnectablestorable
The Z component of Tangent V Camera
matrixEyeToWorld (e2w) fltMatrix identity outputinputconnectablestorable
The transform to go from eye to world space
pixelCenter (pc) float2 0.0, 0.0 outputinputconnectablestorable
Pixel Center gives you the location of the pixel in the final image that corresponds to the point being sampled. For example, let's say you are rendering an image at a resolution of 200 x 200. Then 0, 0 is the position of the lower-left corner of the image, and 200, 200 is the position of the upper-right corner. If we are sampling a point in the middle of the image, its Pixel Centre value would be approximately 100, 100.
pixelCenterX (pcx) float 0.0 outputinputconnectablestorable
The X component of Pixel Center
pixelCenterY (pcy) float 0.0 outputinputconnectablestorable
The Y component of Pixel Center
flippedNormal (fn) bool false outputinputconnectablestorable
Flipped Normal tells you which side of a surface is being sampled. Most shaders treat both sides of a surface the same, but you may want to have them different. For example, if you were creating an image of money, you would want single flat surfaces with one image on one side, and a different image on the other side.
facingRatio (fr) float 0.0 outputinputconnectablestorable
Facing Ratio gives you a number between 0 and 1 that tells you if the point being sampled is facing towards or away from the camera. A value of 1 means that it is facing the camera head-on. A value of 0 means that is is facing 90 degrees from the camera. In mathematical terms, Facing Ratio is the cosine of the angle between Ray Direction and Normal Camera.