Hazel

Material Nodes Reference

Every node type in the material graph, with its pins and what it compiles to. There are 168 node types in 14 categories. The definitions are ALL_NODES in crates/renzora_shader/src/material/nodes/ (one module per category) and the code each emits is in material/codegen/emit/, in files of the same names. The file format, domains and compile paths are in the Material API; to add a node, see Custom Material Nodes.

This page is written by hand. Code that needs the list should read the MaterialNodeCatalog resource, which renzora_shader fills from the same definitions (see Material API).

Reading this page

Pins are written name: Type = default. A pin's name is what .material files and connections use; the editor shows a label, given in brackets where it differs in a way worth knowing. An input with no default compiles to zero when unwired. Rules that hold everywhere:

  • Numeric pins coerce. Float, Vec2, Vec3, Vec4 and Color connect freely; a scalar widens into every component, a wider vector narrows to its leading components. Bool connects only to Bool.
  • Math nodes take the width of their widest wire. Every pin of a math/* node is declared Float, but the node latches to the widest type among its connected inputs (resolve_math_ranks), so one Add adds two floats or two colours. math/lerp's t stays a scalar. With nothing wired, a math node is Float.
  • Mesh UV fallback. The texture sampling nodes, the input/uv_* transforms, procedural/hex_tile, animation/flipbook_uv and Sprite Color read the mesh UV when their uv pin is unwired. The other procedural and animation nodes read their uv pin's default (a constant), so wire a UV into them.
  • Settings are not pins. A few nodes read a value from the node's input_values that cannot be wired: the texture of every texture node (texture, a TexturePath), the constants of the Color category, Blend's mode, Swizzle's out_*, Static Switch's use_a, Component Mask's keep_* and Function Call's function.

Input

Data the fragment already has. Header colour blue.

NodeInputsOutputsWhat it does
input/uv, UVnoneuv: Vec2, u, v: FloatThe mesh UV
input/uv_scale, UV Scaleuv: Vec2, scale: Vec2 = (2, 2), offset: Vec2 = (0, 0)uv: Vec2uv * scale + offset, for tiling
input/uv_polar, Polar UVuv: Vec2, center: Vec2 = (0.5, 0.5)uv: Vec2, angle, radius: FloatCartesian to polar around center: x is the angle in 0 to 1, y the radius
input/uv_rotator, UV Rotatoruv: Vec2, angle: Float = 0 (radians), center: Vec2 = (0.5, 0.5)uv: Vec2Rotates UVs around center
input/uv_panner, UV Panneruv: Vec2, speed: Vec2 = (0.1, 0), time_offset: Float = 0uv: Vec2Time-driven pan in any direction
input/world_position, World Positionnoneposition: Vec3, x, y, z: FloatFragment position in world space
input/world_normal, World Normalnonenormal: Vec3, x, y, z: FloatFragment normal in world space
input/view_direction, View Directionnonedirection: Vec3Normalized direction from the fragment to the camera
input/time, Timenonetime, sin_time, cos_time: Floatglobals.time in seconds, and its sine and cosine
input/vertex_color, Vertex Colornonecolor: Color, r, g, b, a: FloatThe mesh's COLOR attribute, white on a mesh without one
input/sprite_color, Sprite Coloruv: Vec2 (the sprite's UV when unwired)color: Color, rgb: Vec3, a: FloatThe sprite's own texture at a UV, with its flip, tiling and slicing applied. Sprite materials only; refused in a 3D domain
input/camera_position, Camera Positionnoneposition: Vec3Camera position in world space
input/object_position, Object Positionnoneposition: Vec3The object's pivot in world space (translation of its model matrix)
input/particle_color, Particle Colornonecolor: Color, rgb: Vec3, a: FloatOn a particle, its colour after colour over life. White elsewhere
input/particle_age, Particle Agenoneage: FloatOn a particle, its age over its lifetime, 0 at birth to 1 at death. 0 elsewhere
input/particle_random, Particle Randomnonevalue: FloatOn a particle, a 0 to 1 random fixed for its life. 0 elsewhere
input/particle_velocity, Particle Velocitynonevelocity: Vec3, speed: Float, direction: Vec3On a particle, its world-space velocity, speed and direction. Zero elsewhere

The four Particle nodes read particle data in a Surface, Unlit or Vegetation graph drawn on a particle (see Particle System) and are the constants above anywhere else, so one material can dress both a level and its particles. A graph that uses them has no virtual geometry branch, since particle inputs come from the particle pipeline's own vertex stage. In a Sprite graph they are always the constants.

Parameter

Named values a material instance overrides by name. name is the key; default is the value the master uses. A graph holds at most 32 distinct names. Header colour purple.

NodeInputsOutput
param/float, Float Parametername: String = "FloatParam", default: Float = 0value: Float
param/color, Color Parametername: String = "ColorParam", default: Color = (1, 1, 1, 1)value: Color
param/vec2, Vec2 Parametername: String = "Vec2Param", default: Vec2 = (0, 0)value: Vec2
param/vec3, Vec3 Parametername: String = "Vec3Param", default: Vec3 = (0, 0, 0)value: Vec3
param/vec4, Vec4 Parametername: String = "Vec4Param", default: Vec4 = (0, 0, 0, 0)value: Vec4
param/bool, Bool Parametername: String = "BoolParam", default: Bool = falsevalue: Bool

Texture

Each node samples the image in its texture setting. A graph samples at most 16 distinct 2D images (6 in a Sprite graph); nodes reading the same image share one slot. Every slot shares one sampler, the first 2D texture's. Header colour tan.

NodeInputsOutputsWhat it does
texture/sample, Sample Textureuv: Vec2color: Color, rgb: Vec3, r, g, b, a: FloatSamples a 2D texture
texture/sample_normal, Sample Normal Mapuv: Vec2, strength: Float = 1, flip_green: Bool = falsenormal: Vec3Samples and decodes a tangent-space normal map, scaled by strength. Assumes the OpenGL convention (green up); flip_green reads a DirectX map
texture/triplanar, Triplanar Samplescale: Float = 1, sharpness: Float = 2color: Color, rgb: Vec3Projects the texture along world X, Y and Z and blends by the world normal: no UVs, no seams
texture/sample_lod, Sample Texture LODuv: Vec2, lod: Float = 0color, rgb, r, g, b, atextureSampleLevel at an explicit mip: blurred reflections, or sampling where automatic derivatives are invalid
texture/sample_grad, Sample Texture Graduv: Vec2, ddx: Vec2 = (0, 0), ddy: Vec2 = (0, 0)color, rgb, r, g, b, atextureSampleGrad with explicit derivatives, for UVs rotated or warped in ways that fool the automatic ones
texture/sample_cubemap, Sample Cubemapdirection: Vec3 = (0, 1, 0), lod: Float = 0color, rgb, aSamples a cubemap of the material's own along a direction, separate from the scene's environment map
texture/sample_2d_array, Sample 2D Arrayuv: Vec2, layer: Float = 0color, rgb, r, g, b, aSamples a layer of a 2D array texture; layer rounds to the nearest integer
texture/sample_3d, Sample 3D Textureuvw: Vec3 = (0.5, 0.5, 0.5)color, rgb, r, g, b, aSamples a volume texture at a coordinate in 0 to 1 cubed

Math

Each has one output, result, and works per component at the node's latched width. Domain guards are there because one NaN propagates through the rest of the shader and blanks the surface. Header colour grey.

NodeInputs (defaults)Computes
math/add, Adda = 0, b = 0a + b
math/subtract, Subtracta = 0, b = 0a - b
math/multiply, Multiplya = 1, b = 1a * b
math/divide, Dividea = 1, b = 1a / max(b, 0.000001)
math/power, Powerbase = 2, exp = 2pow(abs(base), exp)
math/abs, Absvalue = 0abs(value)
math/negate, Negatevalue = 0-value
math/one_minus, One Minusvalue = 01 - value
math/fract, Fractvalue = 0fract(value)
math/floor, Floorvalue = 0floor(value)
math/ceil, Ceilvalue = 0ceil(value)
math/min, Mina = 0, b = 1min(a, b)
math/max, Maxa = 0, b = 1max(a, b)
math/clamp, Clampvalue = 0.5, min = 0, max = 1clamp(value, min, max)
math/lerp, Lerpa = 0, b = 1, t = 0.5mix(a, b, t); t stays scalar
math/smoothstep, Smoothstepedge0 = 0, edge1 = 1, value = 0.5smoothstep(edge0, edge1, value)
math/step, Stepedge = 0.5, value = 0step(edge, value): 0 below the edge, 1 from it
math/remap, Remapvalue = 0.5, in_min = 0, in_max = 1, out_min = 0, out_max = 1out_min + (value - in_min) / max(in_max - in_min, 0.000001) * (out_max - out_min)
math/sin, Sinvalue = 0sin(value)
math/cos, Cosvalue = 0cos(value)
math/saturate, Saturatevalue = 0.5saturate(value): clamp to 0 to 1
math/modulo, Moduloa = 0, b = 1a - b * floor(a / max(b, 0.000001))
math/sign, Signvalue = 0sign(value)
math/atan2, Atan2y = 0, x = 1atan2(y, x) in radians
math/trunc, Truncvalue = 0trunc(value)
math/round, Roundvalue = 0round(value)
math/exp, Expvalue = 0exp(value)
math/log, Logvalue = 1log(max(value, 0.000001)), natural log
math/sqrt, Sqrtvalue = 1sqrt(max(value, 0))
math/reciprocal, Reciprocalvalue = 11 / max(value, 0.000001)
math/tan, Tanvalue = 0tan(value)
math/asin, Asinvalue = 0asin(clamp(value, -1, 1))
math/acos, Acosvalue = 1acos(clamp(value, -1, 1))
math/radians, To Radiansvalue = 0 (degrees)radians(value)
math/degrees, To Degreesvalue = 0 (radians)degrees(value)

Vector

Header colour green.

NodeInputsOutputsWhat it does
vector/split_vec2, Split Vec2vector: Vec2 = (0, 0)x, y: FloatUnpacks a Vec2
vector/split_vec3, Split Vec3vector: Vec3 = (0, 0, 0)x, y, z: FloatUnpacks a Vec3
vector/combine_vec2, Combine Vec2x, y: Float = 0vector: Vec2Packs a Vec2
vector/combine_vec3, Combine Vec3x, y, z: Float = 0vector: Vec3Packs a Vec3
vector/combine_vec4, Combine Vec4x, y, z: Float = 0, w: Float = 1vector: Vec4Packs a Vec4
vector/dot, Dot Producta, b: Vec3 = (0, 0, 0)result: Floatdot(a, b)
vector/cross, Cross Producta: Vec3 = (1, 0, 0), b: Vec3 = (0, 1, 0)result: Vec3cross(a, b)
vector/normalize, Normalizevector: Vec3 = (1, 0, 0)result: Vec3normalize(vector)
vector/distance, Distancea, b: Vec3 = (0, 0, 0)result: Floatdistance(a, b)
vector/length, Lengthvector: Vec3 = (0, 0, 0)result: Floatlength(vector)
vector/reflect, Reflectincident: Vec3, normal: Vec3result: Vec3reflect(incident, normal)
vector/refract, Refractincident: Vec3, normal: Vec3 = (0, 1, 0), eta: Float = 1 [IOR Ratio]result: Vec3refract(incident, normal, eta)
vector/swizzle, Swizzlevector: Vec4 = (0, 0, 0, 1); settings out_x = 0, out_y = 1, out_z = 2, out_w = 3vector: Vec4Each output channel picks 0 = X, 1 = Y, 2 = Z, 3 = W, 4 = zero, 5 = one

Color

Constants, colour space and grading. The four constant nodes have no input pins: their value is the node's color or value setting. Header colour amber.

NodeInputsOutputsWhat it does
color/constant, Colorsetting color (white when unset)color: Color, rgb: Vec3, r, g, b, a: FloatA constant colour
color/float, Floatsetting valuevalue: FloatA constant scalar
color/vec2, Vec2setting valuevalue: Vec2A constant Vec2
color/vec3, Vec3setting valuevalue: Vec3A constant Vec3
color/lerp, Color Lerpa: Color = (0, 0, 0, 1), b: Color = (1, 1, 1, 1), t: Float = 0.5color: Colormix(a, b, t)
color/cosine_palette, Cosine Palettet: Float = 0, a: Vec3 = (0.5, 0.5, 0.5) [Bias], b: Vec3 = (0.5, 0.5, 0.5) [Amplitude], c: Vec3 = (1, 1, 1) [Frequency], d: Vec3 = (0, 0.33, 0.67) [Phase]color: Vec3a + b * cos(2 pi (c * t + d))
color/fresnel, Fresnelpower: Float = 5result: Floatpow(1 - max(dot(view_dir, world_normal), 0), power): bright at grazing angles
color/srgb_to_linear, sRGB → Linearcolor: Color = (1, 1, 1, 1)result: ColorPiecewise sRGB decode
color/linear_to_srgb, Linear → sRGBcolor: Color = (1, 1, 1, 1)result: ColorPiecewise sRGB encode
color/rgb_to_hsv, RGB → HSVrgb: Vec3 = (1, 0, 0)hsv: Vec3, h, s, v: FloatRGB to hue, saturation, value
color/hsv_to_rgb, HSV → RGBhsv: Vec3 = (0, 1, 1)rgb: Vec3Back to RGB
color/hue_shift, Hue Shiftrgb: Vec3 = (1, 0, 0), shift: Float = 0rgb: Vec3Rotates hue by shift (1 is a full turn)
color/luminance, Luminancergb: Vec3 = (1, 1, 1)value: FloatRec.709 luminance
color/gamma, Gammacolor: Color = (1, 1, 1, 1), gamma: Float = 2.2result: Colorpow(rgb, gamma), alpha unchanged
color/brightness_contrast, Brightness / Contrastcolor: Color = (0.5, 0.5, 0.5, 1), brightness: Float = 0, contrast: Float = 1result: Color(rgb - 0.5) * contrast + 0.5 + brightness, alpha unchanged
color/saturation, Saturationcolor: Color = (1, 1, 1, 1), saturation: Float = 1result: ColorMixes from Rec.709 grey (0) through the original (1) and beyond
color/blend, Blendbase: Color = (0.5, 0.5, 0.5, 1), blend: Color = (1, 1, 1, 1), opacity: Float = 1; setting mode = 0result: ColorLayer blend. mode: 0 normal, 1 multiply, 2 screen, 3 overlay, 4 add, 5 subtract, 6 soft light, 7 hard light, 8 difference, 9 divide

Procedural

Patterns computed in the shader. Header colour violet.

Noise

NodeInputsOutputsWhat it does
procedural/noise_perlin, Perlin Noiseuv: Vec2, scale: Float = 10value: FloatSmooth gradient noise
procedural/noise_simplex, Simplex Noiseuv: Vec2, scale: Float = 10value: FloatGradient noise with fewer directional artifacts
procedural/noise_voronoi, Voronoiuv: Vec2, scale: Float = 5distance [F1], f2, edge, cell_id: FloatCell noise: nearest and second-nearest distance, distance to the cell edge, and a per-cell id
procedural/noise_fbm, FBM Noiseuv: Vec2, scale = 5, octaves = 4, lacunarity = 2, persistence = 0.5value: FloatFractal Brownian motion: layered noise
procedural/noise_ridged, Ridged FBMuv: Vec2, scale = 4, octaves = 4, lacunarity = 2, persistence = 0.5value: FloatRidged multifractal: sharp crests
procedural/noise_turbulence, Turbulenceuv: Vec2, scale = 4, octaves = 5, lacunarity = 2, persistence = 0.5value: FloatAbsolute noise summed over octaves
procedural/noise_billow, Billow Noiseuv: Vec2, scale = 4, octaves = 4, lacunarity = 2, persistence = 0.5value: FloatSquared absolute noise summed over octaves: rounded, puffy shapes
procedural/noise_white, White Noiseuv: Vec2, scale: Float = 50value: FloatUncorrelated random value per cell
procedural/noise_curl, Curl Noiseuv: Vec2, scale = 3, epsilon = 0.01flow: Vec2Divergence-free 2D flow field

Triplanar noise

World-space noise projected on the X, Y and Z planes and blended by the world normal, so no UVs and no seams.

NodeInputsOutputs
procedural/noise_triplanar_fbm, Triplanar FBMscale = 1, octaves = 4, lacunarity = 2, persistence = 0.5, sharpness = 4value: Float
procedural/noise_triplanar_ridged, Triplanar Ridgedscale = 1, octaves = 4, lacunarity = 2, persistence = 0.5, sharpness = 4value: Float
procedural/noise_triplanar_turbulence, Triplanar Turbulencescale = 1, octaves = 5, lacunarity = 2, persistence = 0.5, sharpness = 4value: Float
procedural/noise_triplanar_billow, Triplanar Billowscale = 1, octaves = 4, lacunarity = 2, persistence = 0.5, sharpness = 4value: Float
procedural/noise_triplanar_voronoi, Triplanar Voronoiscale = 3, sharpness = 4distance [F1], cell_id: Float

Patterns and gradients

NodeInputsOutputsWhat it does
procedural/checkerboard, Checkerboarduv: Vec2, scale: Float = 8value: FloatAlternating 0 and 1
procedural/gradient, Gradientuv: Vec2u, v: FloatThe UV's two ramps
procedural/brick, Brickuv: Vec2, scale: Vec2 = (4, 8), mortar: Float = 0.05value: FloatOffset rows of bricks with mortar lines
procedural/gradient_radial, Radial Gradientuv: Vec2 = (0.5, 0.5), center: Vec2 = (0.5, 0.5), radius = 0.5, softness = 0.3value: Float0 at the centre to 1 at radius, with soft falloff
procedural/gradient_linear, Linear Gradientuv: Vec2 = (0.5, 0.5), angle: Float = 0 (radians, 0 is +X), center: Vec2 = (0.5, 0.5)value: FloatRamp along a direction
procedural/gradient_angular, Angular Gradientuv: Vec2 = (0.5, 0.5), center: Vec2 = (0.5, 0.5), offset: Float = 0value: Float0 to 1 around the centre
procedural/gradient_diamond, Diamond Gradientuv: Vec2 = (0.5, 0.5), center: Vec2 = (0.5, 0.5), size: Float = 0.5value: FloatManhattan-distance falloff around the centre

Height, warp and anti-tiling

NodeInputsOutputsWhat it does
procedural/normal_from_height, Normal From Height (tangent)height: Float = 0, strength: Float = 1normal: Vec3Tangent-space normal (Z up) from a height, by screen-space derivatives
procedural/world_normal_from_height, World Normal From Heightheight: Float = 0, strength: Float = 1normal: Vec3World-space perturbed normal, with the tangent frame rebuilt per fragment from derivatives of the world position, so it works on any orientation. Wire it straight into Surface Output's normal
procedural/domain_warp, Domain Warpuv: Vec2, scale: Float = 1.5, strength: Float = 0.35, offset: Vec2 = (5.2, 1.3)uv: Vec2Offsets UVs by FBM noise
procedural/bump_offset, Bump Offsetuv: Vec2, height: Float = 0, reference: Float = 0.5, strength: Float = 0.05uv: Vec2Cheap parallax: shifts UVs along the view vector by a height
procedural/hex_tile, Hex Tile UVuv: Vec2, scale: Float = 1, variation: Float = 1uv1, uv2, uv3: Vec2, w1, w2, w3: FloatHexagonal anti-tiling. Sample one texture with all three UVs and blend by the weights; variation is the random rotation per cell (0 plain tiling, 1 full scramble)

Animation

Functions of globals.time. Header colour teal.

NodeInputsOutputsWhat it does
animation/uv_scroll, UV Scrolluv: Vec2, speed: Vec2 = (0.1, 0)uv: Vec2uv + speed * time
animation/flow_map, Flow Mapuv: Vec2, flow: Vec2 = (0.1, 0), speed: Float = 1, strength: Float = 0.1uv1, uv2: Vec2, blend: FloatTwo UV phases half a cycle apart and the weight to crossfade them. Sample twice and mix by blend
animation/sine_wave, Sine Wavefrequency = 1, amplitude = 1, offset = 0value: Floatsin(time * frequency + offset) * amplitude
animation/ping_pong, Ping Pongspeed: Float = 1value: FloatTriangle wave, 0 to 1 to 0
animation/wind, Windstrength = 0.3, speed = 1, direction: Vec2 = (1, 0), turbulence = 0.2, mask = 1displacement: Vec3A sway offset along direction (X and Z), phased by world position. Meant for a Vegetation Output's vertex_offset
animation/flipbook_uv, Flipbook UVuv: Vec2, frame: Float = 0, cols: Float = 4, rows: Float = 4uv: Vec2The UV of one frame of a cols by rows sheet; frame wraps. Drive it with time * fps

Utility

Header colour slate.

NodeInputsOutputsWhat it does
utility/world_pos_mask, World Position Maskheight: Float = 10, falloff: Float = 2mask: Floatsaturate((world_y - height) / falloff): snow on peaks, water lines
utility/slope_mask, Slope Maskthreshold: Float = 0.5, falloff: Float = 0.2mask: Floatsmoothstep of the world normal's Y around threshold: flat ground against cliffs
utility/depth_fade, Depth Fadedistance: Float = 1fade: Floatsaturate(world_y / distance). Despite the name it does not read scene depth; for a real proximity fade use scene/depth_fade
utility/dpdx, DDXvalue: Float = 0result: Floatdpdx(value)
utility/dpdy, DDYvalue: Float = 0result: Floatdpdy(value)
utility/fwidth, FWidthvalue: Float = 0result: Floatfwidth(value)
utility/dither, Dithernonevalue: Float4 by 4 Bayer threshold from the screen position
utility/hash, Hashvalue: Vec2 = (0, 0)result: FloatDeterministic 0 to 1 hash

Control

Header colour yellow. Material functions' bracket and call nodes are also in this category; they are listed under Functions.

NodeInputsOutputsWhat it does
control/if, Ifcondition: Float = 0, threshold: Float = 0.5, if_true: Vec4 = (1, 1, 1, 1), if_false: Vec4 = (0, 0, 0, 1)result: Vec4select(if_false, if_true, condition > threshold). Both sides are computed
control/static_switch, Static Switcha: Vec4 = (1, 1, 1, 1), b: Vec4 = (0, 0, 0, 1); setting use_a = trueresult: Vec4Compile-time choice: only the chosen input's subgraph is emitted
control/component_mask, Component Maskvector: Vec4 = (0, 0, 0, 1); settings keep_r, keep_g, keep_b = true, keep_a = falsevector: Vec4Zeroes the channels not kept
control/greater_than, Greater Thana, b: Float = 0result: Float1 if a > b, else 0
control/less_than, Less Thana, b: Float = 0result: Float1 if a < b, else 0
control/equal, Equala, b: Float = 0, epsilon: Float = 0.001result: Float1 if abs(a - b) < epsilon, else 0
control/not_equal, Not Equala, b: Float = 0, epsilon: Float = 0.001result: Float1 if abs(a - b) >= epsilon, else 0
control/and, Anda, b: Float = 1result: Floatmin(a, b)
control/or, Ora, b: Float = 0result: Floatmax(a, b)
control/not, Notvalue: Float = 0result: Float1 - value

Functions

Reusable subgraphs stored as .material_function files beside the material (see Material API). Category Control.

NodeInputsOutputsWhat it does
function/input_point, Function Inputsnonein_0 to in_3: Vec4Inside a function: the call site's four inputs
function/output_point, Function Outputsout_0 to out_3: Vec4 = (0, 0, 0, 0)noneInside a function: what it returns
function/call, Function Callin_0 to in_3: Vec4 = (0, 0, 0, 0); setting function (the name)out_0 to out_3: Vec4Calls the named function. An empty or unknown name, or a recursive call, outputs zeros

Scene

Reads of the frame's other buffers. Each depends on something the view may not have, so each is gated with @if on its flag and falls back to the value given here instead of failing to compile. Every one except Pixel Depth, Refraction UV Offset and Screen UV is refused in a Sprite graph. A graph that reads scene depth, scene normal, motion vectors, scene colour or the environment map has no deferred G-buffer branch. Header colour cyan.

NodeInputsOutputsWhat it does
scene/pixel_depth, Pixel Depthnonedepth: FloatLinear view-space depth of this fragment
scene/scene_depth, Scene Depthnonedepth: FloatLinear depth of the opaque scene at this pixel, from the depth prepass. 1.0e6 without DepthPrepass
scene/depth_fade, Scene Depth Fadedistance: Float = 1fade: Float0 where this surface meets the opaque scene, 1 once the scene is distance behind it: shoreline foam, soft intersections. 1 without DepthPrepass
scene/scene_normal, Scene Normalnonenormal: Vec3World normal from the normal prepass. +Y without NormalPrepass
scene/motion_vector, Motion Vectornonevelocity: Vec2, speed: FloatScreen-space motion from the motion vector prepass. Zero without MotionVectorPrepass
scene/refraction_uv_offset, Refraction UV Offsetnormal: Vec3 = (0, 0, 1), strength: Float = 0.05offset: Vec2normal.xy * strength, a screen-UV offset for refraction
scene/screen_uv, Screen UVnoneuv: Vec2Screen UV of the fragment, (0, 0) top left to (1, 1) bottom right
scene/scene_color, Scene Color (stub)uv: Vec2 = (0.5, 0.5)color: Color, rgb: Vec3Samples Bevy's view transmission texture. It is bound only when the camera has ScreenSpaceTransmission and filled only when something in the scene is transmissive; black otherwise. For sky in a refraction use Environment Map Sample
scene/env_map_sample, Environment Map Sampledirection: Vec3 = (0, 1, 0), mip_level: Float = 0color: Color, rgb: Vec3The view's environment map along a direction; higher mips are blurrier. Black when the view has none
scene/env_map_reflect, Environment Map Reflectnormal: Vec3 = (0, 1, 0), mip_level: Float = 0color: Color, rgb: Vec3The view direction reflected off normal, then sampled as above

Landscape

What a terrain material is built from (see Terrain). A terrain binds its painted layer weights and bounds to its own copy of the material. On any other mesh these still compile: coordinates are world X and Z, and the first layer's weight is 1 and the rest 0. Surface, Vegetation and Unlit graphs can use them; a Sprite graph cannot. Header colour green.

NodeInputsOutputsWhat it does
landscape/layer_coords, Landscape Layer Coordsscale: Float = 4 [Mapping Scale (m)], rotation: Float = 0 [degrees], pan: Vec2 = (0, 0) [metres]uv: Vec2Coordinates across the whole terrain in metres from its corner, so tiling never restarts at a chunk edge
landscape/layer_blend, Layer Blendfor each layer i from 0 to 7: name_i: String = "Layer i+1", blend_i: String = "Weight", layer_i: Vec4, height_i: Float = 0.5, auto_i: Float = 0; then height_blending: Float = 0.8result: Vec4, rgb: Vec3, normal: Vec3 (normalized), value: FloatMixes up to eight named layers by the painted weights. blend_i is Weight (an even mix), Height (the taller layer wins where two meet, using height_i; height_blending sets how crisp) or Alpha (laid over the rest by its weight). auto_i paints the layer on by rule, over the painted weights. Unwired layers are ignored. One value type per node: use one Layer Blend each for colour, normal and roughness, with the same names
landscape/layer_sample, Layer Samplename: String = "Layer 1"weight: FloatThe painted weight of one named layer. A name no Layer Blend uses is a layer of its own, still paintable
landscape/slope, Landscape Slopenonedegrees: Float, height: Float, normal_y: FloatSlope from flat in degrees (0 level, 90 a wall), world height in metres, and the normal's Y

The layer names, in the order the Layer Blends (by node id, then slot) and then the Layer Samples name them, are the layers the terrain's Paint tab lists, at most eight (LANDSCAPE_MAX_LAYERS). From code: renzora_shader::material::landscape::landscape_layers(&graph), also returned as CompileResult::landscape_layers.

Custom

Header colour red.

custom/code, Custom Code. Inputs code: String = "result = a;" [WGSL], a: Vec4 = (0, 0, 0, 1), b, c, d: Vec4 = (0, 0, 0, 0). Outputs result: Vec4, rgb: Vec3, x, y, z, w: Float. WGSL has no value-returning blocks, so the snippet becomes the body of a generated helper mat_custom_<id>(a, b, c, d) with result declared as opaque black; assign it:

result = a * b + vec4<f32>(sin(c.x), 0.0, 0.0, 1.0);

A compile error inside the snippet points at the node, through the shader's node line map.

Output

One per graph, set by the domain; it cannot be removed. An unwired pin uses the constant stored on the node, or the default given. Header colour dark red.

output/surface, Surface Output

PinTypeDefaultDrives
base_colorColor(0.8, 0.8, 0.8, 1)Albedo, multiplied by vertex colour
metallicFloat0Metalness
roughnessFloat0.5Perceptual roughness
normalVec3noneSurface normal
displacementFloat0Height for parallax occlusion mapping (white is the peak). Only a connection does anything; needs mesh tangents
displacement_scaleFloat0.05Parallax depth. Read as a literal, not an expression, because it is a loop constant
emissiveVec3(0, 0, 0)Emission
aoFloat1Ambient occlusion
alphaFloat1Opacity, multiplied by vertex alpha
reflectanceVec3(0.5, 0.5, 0.5)Dielectric specular reflectance
specular_transmissionFloat0Refraction (glass, water)
diffuse_transmissionFloat0Light through thin surfaces (leaves, skin)
thicknessFloat0Volume thickness
iorFloat1.5Index of refraction
attenuation_distanceFloat1.0e37Distance over which light attenuates; 1.0e37 means never
attenuation_colorVec3(1, 1, 1)Colour light attenuates toward
clearcoatFloat0Second specular layer (car paint)
clearcoat_roughnessFloat0.5Its roughness
anisotropy_strengthFloat0Directional specular (brushed metal, hair)
anisotropy_rotationFloat0Its direction

Wiring either transmission pin, or storing a value above zero on it, turns on Bevy's transmission pipeline for the material (requires_transmission).

output/vegetation, Vegetation Output

PinTypeDefault
base_colorColor(0.2, 0.5, 0.1, 1)
metallicFloat0
roughnessFloat0.7
normalVec3none
emissiveVec3(0, 0, 0)
aoFloat1
alphaFloat1
vertex_offsetVec3(0, 0, 0)

The generated vertex stage adds vertex_offset to the world position; wire Wind (or any Vec3) into it for sway. Only these eight pins exist: the other Surface pins are not available on Vegetation.

output/unlit, Unlit Output

Pins color: Color = (1, 1, 1, 1) and alpha: Float = 1. The base material is set unlit, so lighting returns the colour unchanged.

output/sprite, Sprite Output

Pins color: Color and alpha: Float, both without a default: an unwired color is the sprite's own texture and an unwired alpha keeps that colour's alpha, so an empty Sprite graph draws the sprite unchanged. The sprite's tint and alpha mode apply on top.