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 nameParentsClassificationMFn typeCompatible function sets
samplerInfoshadingDependNodeutility/general:drawdb/shader/operation/samplerInfokSamplerInfokBase
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)TypeDefaultFlags
matrixEyeToWorld (e2w) fltMatrixidentityoutputinputconnectablestorable
The transform to go from eye to world space
facingRatio (fr) float0.0outputinputconnectablestorable
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.

flippedNormal (fn) boolfalseoutputinputconnectablestorable
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.

normalCamera (n) float30.0, 0.0, 1.0outputinputconnectablestorable
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) float0.0outputinputconnectablestorable
The X component of Normal Camera
normalCameraY (ny) float0.0outputinputconnectablestorable
The Y component of Normal Camera
normalCameraZ (nz) float0.0outputinputconnectablestorable
The Z component of Normal Camera
pixelCenter (pc) float20.0, 0.0outputinputconnectablestorable
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) float0.0outputinputconnectablestorable
The X component of Pixel Center
pixelCenterY (pcy) float0.0outputinputconnectablestorable
The Y component of Pixel Center
pointCamera (p) float30.0, 0.0, 0.0outputinputconnectablestorable
Point Camera gives you the position of the point being sampled, in camera coordinate space.
pointCameraX (px) float0.0outputinputconnectablestorable
The X component of Point Camera
pointCameraY (py) float0.0outputinputconnectablestorable
The Y component of Point Camera
pointCameraZ (pz) float0.0outputinputconnectablestorable
The Z component of Point Camera
pointObj (po) float30.0, 0.0, 0.0outputinputconnectablestorable
Point Obj gives you the position of the point being sampled, in the object's local coordinate space.
pointObjX (pox) float0.0outputinputconnectablestorable
The X component of Point Obj
pointObjY (poy) float0.0outputinputconnectablestorable
The Y component of Point Obj
pointObjZ (poz) float0.0outputinputconnectablestorable
The Z component of Point Obj
pointWorld (pw) float30.0, 0.0, 0.0outputinputconnectablestorable
Point World gives you the position of the point being sampled, in world coordinate space.
pointWorldX (pwx) float0.0outputinputconnectablestorable
The X component of Point World
pointWorldY (pwy) float0.0outputinputconnectablestorable
The Y component of Point World
pointWorldZ (pwz) float0.0outputinputconnectablestorable
The Z component of Point World
rayDirection (r) float30.0, 0.0, 1.0outputinputconnectablestorable
Ray Direction gives you a vector that points from the point being sampled to the camera position, in camera coordinate space.
rayDirectionX (rx) float0.0outputinputconnectablestorable
The x component of Ray Direction
rayDirectionY (ry) float0.0outputinputconnectablestorable
The y component of Ray Direction
rayDirectionZ (rz) float0.0outputinputconnectablestorable
The z component of Ray Direction
tangentUCamera (tu) float31.0, 0.0, 0.0outputinputconnectablestorable
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) float0.0outputinputconnectablestorable
The X component of Tangent U Camera
tangentUy (tuy) float0.0outputinputconnectablestorable
The Y component of Tangent U Camera
tangentUz (tuz) float0.0outputinputconnectablestorable
The Z component of Tangent U Camera
tangentVCamera (tv) float30.0, 1.0, 0.0outputinputconnectablestorable
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) float0.0outputinputconnectablestorable
The X component of Tangent V Camera
tangentVy (tvy) float0.0outputinputconnectablestorable
The Y component of Tangent V Camera
tangentVz (tvz) float0.0outputinputconnectablestorable
The Z component of Tangent V Camera
uvCoord (uv) float20.0, 0.0outputinputconnectablestorable
U V Coord gives you the U and V surface coordinates of the point being sampled.
uCoord (u) float0.0outputinputconnectablestorable
The u component of U V Coord
vCoord (v) float0.0outputinputconnectablestorable
The v component of U V Coord