Skip to main content

Shader nodes

95 nodes in 7 categories, for building materials from nodes. To learn how to use them, see Material graphs.

Inputs and outputs have one of four types: float is one number, and vec2, vec3 and vec4 hold two, three and four numbers. A vec3 holds a colour or a direction. If you connect ports of different sizes, this is handled for you where it makes sense.

const​

Fixed values you type in.

NodeWhat it doesInputsOutputs
constFloatA fixed number.—out:float
constVec3Three fixed numbers.—out:vec3

input​

Values to start from: texture coordinates (UVs), the surface normal, time, textures, and which copy of an object is being drawn.

NodeWhat it doesInputsOutputs
cameraDistanceHow far this pixel is from the camera. Good for fading things out with distance.—out:float
chromaKey — Chroma keyRemoves a colour, for example to make a green screen transparent.color:vec3, key:vec3, similarity:float, smoothness:float, spill:floatrgba:vec4
instanceColor — Instance ColorThe tint of the copy being drawn.—out:vec3
instanceId — Instance IDWhich copy of an instanced object is being drawn. Feed it into a hash to make every copy different.—out:float
materialRef — MaterialUses another material as a starting point.—out:vec3
normalWhich way the surface faces.—out:vec3
normalMapApplies a normal map, adding surface detail without more geometry.uv:vec2, strength:floatout:vec3
paramColor — Param (color)A colour shown as a material setting, so you can change it without editing the graph.—out:vec3
paramFloat — Param (float)A number shown as a material setting, so you can change it without editing the graph.—out:float
positionThe point on the surface, in the object’s own space.—out:vec3
sampleLod — Sample Texture LODReads an image at a chosen blur level. A cheap way to soften it.uv:vec2, lod:floatrgba:vec4
screenUvWhere the pixel is on the screen, instead of on the surface.—out:vec2
texelFetch — Texel FetchReads one exact pixel, without smoothing.texel:vec2rgba:vec4
texelSize — Texture SizeThe size of one pixel of a texture, for effects that read neighbouring pixels.—size:vec2, texel:vec2
textureReads an image at the given coordinates.uv:vec2rgba:vec4
timeSeconds since the scene started. Use it for anything that moves.—out:float
triplanarProjects a texture from three directions at once, so shapes without texture coordinates, or with stretched ones, still look right.scale:float, blend:floatrgba:vec4
uvThe texture coordinates of the pixel being drawn. Most patterns start here.—out:vec2
viewDirectionThe direction from the surface toward the camera.—out:vec3
worldPositionThe same point in world space. Use it for effects that stay in place when an object moves.—out:vec3

light​

Lighting that you can shape yourself.

NodeWhat it doesInputsOutputs
fresnelStronger at the edges, where the surface turns away. Use it for rim light, force fields or the sheen on a car.power:float, normal:vec3out:float
lit — Lit (scene lights)Standard lighting, so a custom graph still fits the scene.color:vec3, roughness:float, specular:float, normal:vec3out:vec3
toonLit — Toon (scene lights)Lighting in bands, for a cartoon look.color:vec3, steps:float, normal:vec3out:vec3

math​

Maths on single numbers.

NodeWhat it doesInputsOutputs
absRemoves the minus sign.x:floatout:float
addAdds.a:float, b:floatout:float
atan2The angle to a point. Use it to build round (radial) patterns.y:float, x:floatout:float
ceilRounds up.x:floatout:float
clampKeeps a value inside a range.x:float, min:float, max:floatout:float
cosCosine.x:floatout:float
divideDivides.a:float, b:floatout:float
expe to the power of the input.x:floatout:float
fbmLayered noise, for clouds, smoke, rust and terrain.uv:vec2, scale:float, octaves:floatout:float
floorRounds down.x:floatout:float
fractKeeps only the part after the decimal point. The usual way to make a pattern repeat.x:floatout:float
logNatural logarithm.x:floatout:float
maxThe larger of two.a:float, b:floatout:float
minThe smaller of two.a:float, b:floatout:float
mixBlends between two values.a:float, b:float, t:floatout:float
modThe remainder after division. Another way to make a value wrap around.x:float, y:floatout:float
multiplyMultiplies.a:float, b:floatout:float
noiseSmooth random values. Start here for anything natural-looking.uv:vec2, scale:floatout:float
oneMinusTurns a 0–1 value around: 0 becomes 1, and 1 becomes 0.x:floatout:float
posterizeSnaps values to a set number of levels, for a banded look.x:float, steps:floatout:float
powRaises to a power.x:float, e:floatout:float
remapConverts a value from one range to another.x:float, inMin:float, inMax:float, outMin:float, outMax:floatout:float
roundRounds to nearest.x:floatout:float
signGives −1, 0 or 1.x:floatout:float
sinSine. Use it for wobbles, pulses and ripples.x:floatout:float
smoothstepA soft edge, with a smooth blend between the two thresholds. One of the most used nodes.from:float, to:float, x:floatout:float
sqrtSquare root.x:floatout:float
stepA hard edge: 0 below the threshold, 1 above it.edge:float, x:floatout:float
subtractSubtracts.a:float, b:floatout:float
tanTangent.x:floatout:float
voronoiCell patterns, for scales, cracked earth and stained glass.uv:vec2, scale:floatdist:float, cell:float

output​

Where the graph ends: how the surface finally looks.

NodeWhat it doesInputsOutputs
mrtOutput — Output (MRT)Writes several outputs at once, for advanced setups.color:vec3, alpha:float, color1:vec3, alpha1:float, color2:vec3, alpha2:float, color3:vec3, alpha3:float—
outputWhere the graph ends: the finished look of the surface.color:vec3, alpha:float, offset:vec3—
surfaceOutput — Output (surface)Describes the surface: base colour, metallic, roughness, normal, emissive and alpha.baseColor:vec3, metallic:float, roughness:float, emissive:vec3, normal:vec3, alpha:float, offset:vec3, clearcoat:float, clearcoatRoughness:float, ior:float, transmission:float, thickness:float—

post​

Nodes that read the finished frame. Using one turns the graph into a full-screen effect instead of a surface material.

NodeWhat it doesInputsOutputs
chromaticAberrationSplits the colour channels at the edges, like a real lens.uv:vec2, amount:floatout:vec3
contrastMakes light parts lighter and dark parts darker.color:vec3, amount:floatout:vec3
exposureMakes the whole image brighter or darker.color:vec3, amount:floatout:vec3
grainAdds film grain.color:vec3, intensity:floatout:vec3
invertInverts the colours of the image.color:vec3out:vec3
saturationMakes colours stronger or weaker.color:vec3, amount:floatout:vec3
screenColorThe scene as already drawn. Using this node turns the graph into a full-screen effect.—out:vec3
tintShifts the image toward a colour.color:vec3, tint:vec3out:vec3
vignetteDarkens the edges of the frame.color:vec3, offset:float, darkness:floatout:vec3

vector​

Build, split and change vectors and colours.

NodeWhat it doesInputsOutputs
addVec3Adds two three-number vectors.a:vec3, b:vec3out:vec3
alphaTakes out the transparency channel.v:vec4out:float
combineVec2Builds a vector from two numbers.x:float, y:floatout:vec2
combineVec3Builds a vector from three numbers.r:float, g:float, b:floatout:vec3
combineVec4Builds a vector from four numbers.rgb:vec3, a:floatout:vec4
crossA direction at right angles to both.a:vec3, b:vec3out:vec3
distanceThe distance between two points.a:vec3, b:vec3out:float
dotDot product: how closely two directions match.a:vec3, b:vec3out:float
equirectUv — Equirect UVMaps a direction onto a panoramic image.dir:vec3uv:vec2
flipbook — FlipbookPlays a grid of frames in one image as an animation.uv:vec2, frame:float, tilesX:float, tilesY:floatuv:vec2
gammaApplies a gamma curve.rgb:vec3, gamma:floatout:vec3
hsvToRgbTurns hue, saturation and value back into a colour.hsv:vec3out:vec3
hueToRgbTurns a hue straight into a colour.h:floatout:vec3
lengthHow long a vector is.v:vec3out:float
luminanceHow bright a colour looks to the eye.rgb:vec3out:float
mixVec3Blends two three-number vectors.a:vec3, b:vec3, t:floatout:vec3
multiplyVec3Multiplies two three-number vectors.a:vec3, b:vec3out:vec3
normalizeKeeps the direction and sets the length to 1.v:vec3out:vec3
pannerScrolls coordinates over time, for flowing water, conveyor belts or energy beams.uv:vec2, speed:vec2out:vec2
reflectBounces a direction off a surface.v:vec3, normal:vec3out:vec3
rgbBuilds a colour from three numbers.v:vec4out:vec3
rgbToHsvTurns a colour into hue, saturation and value. The easy way to shift hue.rgb:vec3out:vec3
scaleVec2Multiplies a two-number vector by a number.v:vec2, s:floatout:vec2
scaleVec3Multiplies a three-number vector by a number.v:vec3, s:floatout:vec3
splitVec2Splits two numbers apart.v:vec2x:float, y:float
splitVec3Splits three numbers apart.v:vec3x:float, y:float, z:float
uvTransformScales, rotates and moves coordinates before reading an image.uv:vec2, tiling:vec2, offset:vec2, rotation:float, center:vec2out:vec2