Help home · Beginner · Intermediate · Advanced authoring · Catalogue · Command reference · Samples
This guide walks through every effect that ships inside Blitz3D+: 35 named
builtin: effects, plus the Standard material, the image-quality options
and the entity operations that support them. Each entry has a screenshot from the
matching sample, a plain-English summary, step-by-step instructions with working
code, and a short explanation of what happens under the hood. You do not need to
know anything about shader programming to use any of them.
| Section | What it tells you |
|---|---|
| Summary | What the effect does in game terms, and the kinds of scenes and moments it suits. |
| How to use it | Working code, the steps to get the effect on screen, the controls worth changing and the mistakes to avoid. The bracket control listed at the end is the value the sample lets you adjust with the [ and ] keys. |
| How it works | A short, slightly more technical account of what the renderer actually does, so you can predict what the effect can and cannot do. |
The full parameter list for every effect, with defaults and units, is in the built-in shader catalogue. Each entry below covers the controls you are most likely to touch; defaults are shown in brackets.
Every entry links to a numbered .bb file in
samples/shaders/showcase. Open one in the IDE and run it in Extended
mode; the models and textures are included. All the samples run with HDR rendering,
filmic tone mapping and FXAA switched on unless the entry says otherwise.
| Key | Action |
|---|---|
| Space | Switches the effect off and on for comparison. |
| [ and ] | Lower or raise the parameter shown on screen. |
| W A S D and arrow keys | Move and look around. |
| Tab | Return to the original camera position. |
| P | Pause robot animation and any moving object or light. Shader clocks (wind, scan lines, grain) keep running. |
| F12 | Save a PNG screenshot to the working directory. |
| Esc | Exit. |
A few studies have extra keys; their entries list them. The showcase README covers capture options for repeatable screenshots.
Reading the screenshots. Each entry shows the effect switched on, with the same scene switched off underneath. For most effects the comparison simply bypasses the effect. Parallax, foliage, wet surface, snow and UV flow instead keep their material and turn the demonstrated contribution down to zero. Transparent exhibits (hologram, water, glass, force field, soft particles and heat haze) vanish completely in their "off" view, because there is nothing else to draw in their place. Open an image at full size to judge fine edges; run the sample to judge motion.
There are two kinds of effect. A surface effect changes how one model is drawn
and is attached with EntityShader (or stored in a brush with
BrushShader). A camera effect changes the finished picture and is
attached with CameraEffect.
| On a model | On a camera |
|---|---|
effect=LoadShader("builtin:rim-light")
ShaderFloat effect,"Strength",1.2
EntityShader actor,effect |
effect=LoadShader("builtin:vignette")
ShaderFloat effect,"Strength",.35
CameraEffect camera,effect |
Every control has a type, and you must use the matching command. Control names are not case-sensitive, but a misspelled name or the wrong command is reported as a runtime error, which makes mistakes easy to find.
| Type of value | Command | Example |
|---|---|---|
| A decimal number | ShaderFloat | ShaderFloat effect,"Strength",.8 |
| A whole number, such as a quality level or a mode | ShaderInt | ShaderInt effect,"Quality",2 |
| A colour, 0 to 255 per channel | ShaderColor | ShaderColor effect,"RimColor",40,140,255 |
| A direction or a set of four numbers | ShaderVector | ShaderVector effect,"WindDirection",1,0,.2,0 |
| A texture | ShaderTexture | ShaderTexture effect,"BaseTexture",brick |
Textures belong to your game: keep their handles alive while the shader uses them.
Use CopyShader when two objects need different settings of the same effect,
and pass 0 to EntityShader to restore a model's ordinary appearance.
CameraEffectEnabled switches a camera effect off without losing its
settings. The intermediate guide covers effect stacks,
copies and lifetime in detail.
Two things to keep in mind. Camera effects that read depth only know about what the
camera can see, so they cannot react to hidden or off-screen objects. And anything you
draw in 2D after RenderWorld is composited after all camera effects, so
your HUD stays sharp and keeps its colours.
| You want to... | Try... |
|---|---|
| Give a game a cartoon or illustrated look | Toon on the characters and Outline on the camera |
| Make a pickup or enemy stand out | Rim Light, or Highlight for a selection outline |
| Teleport, burn or despawn something | Dissolve, or Dither Fade for streamed scenery |
| Show a hit, a power-up or a status | Colour overlay |
| Make a scene glow, or show a neon sign | Bloom with HDR and tone mapping |
| Add atmosphere or hide the end of a level | Depth Fog; Volumetric Fog if you want visible light beams |
| Give a room depth without more lights | SSAO |
| Add reflections to a floor or a mirror | SSR for polished floors, Planar Reflection for a true mirror or pool |
| Set a mood with colour | Colour adjustment for quick changes, LUT grading for an authored look, Grayscale and Vignette for flashbacks and damage |
| Show rain, snow or seasons | Wet Surface, Snow |
| Add water, glass or an energy shield | Water, Glass, Force Field, Hologram |
| Animate plants, conveyors or energy conduits | Foliage, UV flow, Heat Haze |
| Texture rocks and cliffs without UV mapping | Triplanar; Parallax for deep-looking brickwork |
| Frame a cinematic or photo moment | Depth of field, Motion Blur, Light Shafts, Lens |
| Clean up jagged or shimmering edges | FXAA, TAA, MSAA, then Sharpen |
| Effect | Alias | In one line |
|---|---|---|
| Unlit | builtin:unlit | Ignores lighting, for screens and signs. |
| Toon | builtin:toon | Cartoon lighting in flat bands. |
| Rim Light | builtin:rim-light | Coloured glow along the edges of a model. |
| Dissolve | builtin:dissolve | Eats a model away with a glowing edge. |
| Foliage | builtin:foliage | Leaves that sway in the wind. |
| Fur | builtin:fur | Short coats for plush toys, animals and fuzzy fabric. |
| Triplanar | builtin:triplanar | Textures rocks without UV mapping. |
| Parallax | builtin:parallax | Fake depth in brickwork and panels. |
| Hologram | builtin:hologram | Translucent scanning projection. |
| Wet Surface | builtin:wet-surface | Rain-soaked ground with puddles. |
| Snow | builtin:snow | Snow on upward-facing surfaces. |
| Water | builtin:water | Calm water with depth colour, ripples and foam. |
| Glass | builtin:glass | Tinted, refracting glass. |
| Force Field | builtin:force-field | Energy barrier that lights up where it meets scenery. |
| Soft Particle | builtin:soft-particle | Smoke that no longer cuts hard lines into floors. Development preview. |
| UV flow | builtin:uv-flow | Textures that flow along a direction map. Development preview. |
| Heat Haze | builtin:heat-haze | Wobbling air behind exhausts and furnaces. Development preview. |
| Matcap | builtin:matcap | Studio lighting baked into one image. Development preview. |
| Planar Reflection | builtin:planar-reflection | True mirrors and reflecting pools. Development preview. |
| Effect | Alias | In one line |
|---|---|---|
| Grayscale | builtin:grayscale | Drains colour from the view. |
| Vignette | builtin:vignette | Darkens or tints the screen edges. |
| Bloom | builtin:bloom | Glow around bright objects. |
| LUT grading | builtin:lut-grade | Colour look from an authored image. |
| SSAO | builtin:ssao | Soft shadows in creases and contacts. |
| Depth Fog | builtin:depth-fog | Distance and height fog. |
| Depth of field | builtin:depth-of-field | Camera focus with near and far blur. |
| Outline | builtin:outline | Ink lines around shapes. |
| Sharpen | builtin:sharpen | Restores crispness after scaling or anti-aliasing. |
| Lens | builtin:lens | Grain, fringing, scanlines and distortion. |
| Motion Blur | builtin:motion-blur | Smears fast movement. |
| SSR | builtin:ssr | Reflections of on-screen objects. |
| Volumetric Fog | builtin:volumetric-fog | Haze with visible light beams and shadows. |
| Light Shafts | builtin:light-shafts | Rays streaming from a bright source. |
| Colour adjustment | builtin:color-adjust | Exposure, contrast, saturation and tint. |
| Highlight | builtin:highlight | Outline style for selected objects. Development preview. |
| Feature | Commands | In one line |
|---|---|---|
| Standard | CreateStandardBrush, BrushPBR | The everyday physically based material. |
| FXAA | AntiAliasMode 1 | Cheap edge smoothing. |
| TAA | AntiAliasMode 3 | Stable edges using previous frames. |
| Tone mapping | HDRRendering, ToneMapMode | Fits bright HDR lighting onto the display. |
| Terrain | TerrainLayer, TerrainSplatMap | Blends four ground textures across a landscape. |
| Skybox | CreateSkyBox | Distant panoramic backdrop. |
| Decal | CreateDecal, AlignDecal | Marks projected onto scenery. |
| MSAA depth resolve | AntiAliasMode 2 | Keeps depth effects aligned under 4x MSAA. |
| Colour overlay | EntityColorOverlay | Damage flashes and status tints. Development preview. |
| Dither Fade | EntityDitherFade, EntityLODTransition | Pop-free fading and LOD crossfades. Development preview. |
Development previews are undergoing final release acceptance. Their samples and descriptions are supplied for evaluation; the established effects and commands keep their existing support.
builtin:unlit · Surface effect, attach with EntityShader · Sample 01_unlit.bb


Unlit draws a surface at exactly the colour and texture you gave it. Scene lights, shadows and the time of day make no difference: the surface looks the same whether a torch is sweeping across it or the room is pitch black. That makes it the right choice for anything that has to stay readable: computer screens, control panels, glowing runes, painted signs, map boards and deliberately flat cartoon props.
shader=LoadShader("builtin:unlit")
ShaderTexture shader,"Texture",LoadTexture("terminal.png")
EntityShader screenMesh,shader
BrushShader lets you target one surface of a larger model.Texture
control lets you bind one from code instead, which is handy for a plain quad.| Control | What it does |
|---|---|
Texture | Optional texture to show instead of the brush texture. |
In the sample: there is no numeric control. Press Space while the light sweeps past.
Instead of feeding the texture and material colour into the lighting calculation, the shader sends them straight to the emission output, so lights and shadows never touch the pixel colour. The mesh is still an ordinary 3D object: it is depth-tested, hidden behind nearer objects, and fogged with everything else. In an HDR scene the tone-mapping pass still runs over the result, so the displayed colour can differ slightly from the texture's pixel values. Unlit means "not lit", not "exact monitor colour".
builtin:toon · Surface effect, attach with EntityShader · Sample 02_toon.bb


Toon gives a model the flat, stepped shading of a cartoon or comic. Instead of a smooth fade from light to dark, the surface is split into a few solid bands. It suits stylised games, characters with simple readable shapes, and any art direction that wants to look hand-drawn. It does not draw the black ink lines you may expect from a cel-shaded game; for those, add the Outline camera effect.
shader=LoadShader("builtin:toon")
ShaderFloat shader,"Bands",4
ShaderColor shader,"ShadowColor",32,65,90
ShaderFloat shader,"RimStrength",.08
EntityShader robot,shader
ShadowColor rather than pure black; it reads as
illustration instead of a hole.| Control | What it does |
|---|---|
Bands (4) | How many lighting steps. Whole numbers; anything else is rounded. |
ShadowColor (51,64,89) | Colour of the darkest band. |
RimStrength (.15) | A thin white edge light towards the camera. Keep it low. |
Texture | Optional texture override. |
In the sample: the brackets change Bands, starting at 4 (range 2 to 10).
The surface is lit normally first. The shader then measures how bright that lit colour
is, rounds the brightness to the nearest of the Bands steps, and uses the
stepped value to blend between ShadowColor and the surface's own colour.
The rim is a separate accent: pixels whose surface turns away from the camera receive a
little extra white light, scaled by RimStrength. Because it works from the
lit colour, the bands follow your real lights and shadows, which is why low ambient light
and one clear key light give the cleanest result.
builtin:rim-light · Surface effect, attach with EntityShader · Sample 03_rim_light.bb


Rim Light adds a coloured glow along the edges of a model, where its surface turns away from the camera. It is the classic trick for making a character pop out of a dark scene, colouring a team, marking something the player can interact with, or giving a ghost or energy creature its outline. Because it follows the surface, smooth curved shapes show it best; flat panels show little.
shader=LoadShader("builtin:rim-light")
ShaderColor shader,"RimColor",50,200,255
ShaderFloat shader,"RimPower",3.5
ShaderFloat shader,"Strength",1.4
EntityShader sentinel,shader
RimColor that separates the subject from the background.Strength around 1 for ordinary gameplay. Values of 2 or 3 deliberately
turn the model into something glowing and unnatural.RimPower for a thinner, tighter edge; lower it for a broad soft glow.| Control | What it does |
|---|---|
RimColor (77,166,255) | Colour of the edge light. |
RimPower (3) | How narrow the edge is. Higher is thinner. |
Strength (1) | Brightness of the edge. |
Texture | Optional texture override. |
In the sample: the brackets change Strength, starting at 1.4 (range 0 to 3).
For every pixel the shader compares the surface normal with the direction to the camera.
A surface facing the camera gets nothing; the more it turns away, the larger the rim term
becomes. RimPower raises that term to a power, which sharpens the falloff, and
Strength scales how much RimColor is added on top of the normal
lighting. Because the calculation uses the surface normal, a flat panel is either entirely
inside or outside the rim, whereas a rounded shape shows a gradual edge.
builtin:dissolve · Surface effect, attach with EntityShader · Sample 04_dissolve.bb


Dissolve eats a model away piece by piece, leaving a glowing edge along the frontier. Animate it from 0 to 1 and you have a teleport-out, a collected pickup, a burning object or an enemy despawn, all without any extra art. The model's shadow is eaten away in step with the surface.
shader=LoadShader("builtin:dissolve")
ShaderTexture shader,"NoiseMap",LoadTexture("dissolve_noise.png")
ShaderFloat shader,"EdgeWidth",.09
ShaderColor shader,"EdgeColor",255,88,12
EntityShader enemy,shader
; Each frame while the enemy despawns:
amount#=amount+elapsed#*.5
ShaderFloat shader,"Amount",amount
Amount a
little every frame. At 0 the model is intact; at 1 it has gone, and you can hide or
free the entity.NoiseMap is optional. A greyscale image decides which parts vanish first,
so you can author a burn or crumble pattern. Without one, the shader uses its own smooth
noise.Texture too so the colour does not vanish.| Control | What it does |
|---|---|
Amount (0) | How much has dissolved, 0 to 1. |
EdgeWidth (.08) | Width of the glowing frontier. |
EdgeColor (255,64,8) | Colour of the frontier. |
NoiseMap | Optional greyscale pattern that controls where holes appear first. |
Texture | Optional base texture override. |
In the sample: the brackets change Amount, starting at .46 (range 0 to 1).
Each pixel reads a mask value, either from NoiseMap or from procedural
noise, and compares it with Amount. Pixels whose mask value is below the
threshold are discarded. Pixels that survive but sit within EdgeWidth of the
threshold are given EdgeColor as emission, which forms the glowing frontier.
The shadow pass performs the same test, so the shadow develops the same holes and you
can leave shadow casting enabled during a despawn. Geometry is never changed, which is
why collision is unaffected.
builtin:foliage · Surface effect, attach with EntityShader · Sample 05_foliage.bb


Foliage makes leaves, fronds and grass sway in the wind, with occasional gusts, so that gardens, forests and jungles feel alive rather than frozen. Leaf textures with transparent holes are cut out properly, light passes faintly through thin leaves, and the shadows move with the plants. The one thing it needs from your art is a note of which parts of each mesh are allowed to move.
shader=LoadShader("builtin:foliage")
ShaderTexture shader,"BaseTexture",LoadTexture("leaf.png",1+2+8)
ShaderTexture shader,"NormalTexture",LoadTexture("leaf_normal.png")
ShaderFloat shader,"WindStrength",.45
ShaderFloat shader,"GustStrength",.75
ShaderFloat shader,"WindSpeed",2
EntityShader fern,shader
EntityFX fern,16+8192
VertexAlpha when building meshes in
code.EntityFX 16 so both sides of each leaf are drawn, plus 8192 to turn on
alpha testing for the holes. AlphaCutoff decides how opaque a texel must be
to count as leaf.WindStrength is the steady sway, GustStrength
adds pulses, WindSpeed sets the tempo and WindDirection uses its
X and Z components. Gusts keep going at zero WindStrength unless
GustStrength is also zero.| Control | What it does |
|---|---|
WindDirection (1,0,0) | Horizontal wind direction. |
WindStrength (.15), GustStrength (.5) | Steady sway and gust amount. |
WindSpeed (1), WindScale (1) | Tempo and spatial size of the wind pattern. |
AlphaCutoff (.5) | Texture alpha needed for a pixel to be drawn. |
Translucency (.35) | How much light shows through thin leaves. |
NormalStrength (1) | Strength of the normal map. |
In the sample: the brackets change WindStrength, starting at .45 (range 0 to 1).
The vertex stage moves each vertex by a wind function of time and position, then scales that movement by the vertex alpha, so a root with alpha 1 stays put while a tip with alpha 0 swings fully. The same displacement is used for the visible pass, for the previous-frame position that motion blur and TAA rely on, and for the shadow pass, so shadows sway in step and carry the same holes as the cut-out texture. Texture alpha and vertex alpha have separate jobs: texture alpha makes holes, vertex alpha controls flexibility.
builtin:fur · Surface effect · Sample
45_fur.bb and gallery
18_Fur.bb

Use fur for a short animal coat, plush toy or fuzzy fabric. The material draws a lit supporting surface with a layer of small strand-like patches above it. It works on meshes with useful normals and UVs, including skinned and morphed meshes.
fur=LoadShader("builtin:fur")
ShaderFloat fur,"Length",.045
ShaderInt fur,"ShellCount",16
ShaderFloat fur,"Density",.85
EntityShader actor,fur
Length is in world units: scaling the actor does not scale its coat length.
Start short and inspect the silhouette at your game's normal camera distance.
For a character with separate eyes, clothing or pads, use BrushShader
on its coat brushes instead of replacing the whole entity's material.
Fur replaces the selected material; it cannot be layered over an arbitrary glass or
custom shader. CopyShader gives a comparison actor independent settings.
An optional BaseTexture supplies colour and cutout alpha.
FurMap is linear data: red scales length, green scales density and blue
scales wind response; its alpha is ignored. Each texture keeps its own UV selection
and live transform. Length uses vertex sampling at mip zero, so sharp masks need
enough mesh tessellation. Material and vertex alpha fade the coat through cutout
coverage rather than conventional transparent blending.
In the samples, 1 through 5 choose 0, 8, 16, 24 or 32 shells; [ and ] adjust length; comma and full stop adjust density; H toggles wind; P pauses the pose and disables wind while paused. Space toggles the coat. Move with WASD and look with the arrow keys. The gallery's T cycles antialiasing. The smooth reference uses an independent shader copy.
The renderer draws the same geometry at several offsets from its posed surface. Aligned UV patches form the apparent strands; taper narrows them toward the tips. The coat receives lighting, fog and overlays, and participates in shadows, highlight coverage and reflection captures. Static bend and animated wind act in world space after the mesh's skinning and morphing.
Sixteen shells mean seventeen geometry draws per compatible batch, plus work for uncached shadow views and coverage passes. Instancing shares draw submission but does not remove the multiplied triangle and pixel cost. Lower shell count, actor count or shadow coverage when a scene becomes expensive. Zero shell count, length, density or thickness keeps only the base draw.
This is a short-fur technique. Long coats, macro views and extreme grazing angles can expose the space between shells. Inspect motion as well as still images and compare AA modes at your intended resolution. Changing complete CPU-deformed normals invalidates that frame's history; stable poses can recover it. The catalogue lists every parameter, limit and default.
builtin:triplanar · Surface effect, attach with EntityShader · Sample 06_triplanar.bb


Triplanar textures rocks, cliffs, cave walls and sculpted terrain without anyone having to UV-map them. The texture is projected onto the mesh from the front, the side and the top, and blended where those projections meet, so there are no seams or stretched patches. A second texture for upward-facing surfaces adds moss, snow or dust on top of a cliff. It is meant for scenery that stays still.
shader=LoadShader("builtin:triplanar")
ShaderTexture shader,"SideTexture",LoadTexture("rock.png")
ShaderTexture shader,"TopTexture",LoadTexture("moss.png")
ShaderFloat shader,"Scale",.65
ShaderFloat shader,"BlendSharpness",4
EntityShader cliff,shader
Scale is the number of texture repeats per world unit, so a larger number
gives smaller features.BlendSharpness sets how quickly one projection gives way to the next around
a corner. Very sharp blends can show seams on diagonal faces. SlopeBias pushes
the top texture further down gentle slopes.| Control | What it does |
|---|---|
SideTexture, TopTexture | Textures for the sides and for upward-facing surfaces. |
Scale (.25) | Texture repeats per world unit. |
BlendSharpness (4) | How abruptly the three projections meet. |
SlopeBias (1) | How far the top texture reaches onto slopes. |
Roughness (.8), Metallic (0) | Lighting response of the surface. |
In the sample: the brackets change Scale, starting at .65 (range .1 to 2).
For each pixel the shader samples the texture three times, using the pixel's world X, Y
and Z position as texture coordinates for the three projections. The surface normal decides
how much each projection counts, and BlendSharpness controls how strongly the
weights favour the dominant direction. Upward-facing pixels use TopTexture.
This is a blend of colours only; the effect does not attempt triplanar normal mapping.
builtin:parallax · Surface effect, attach with EntityShader · Sample 07_parallax.bb


Parallax makes a flat, patterned surface look as if it has real depth. Mortar joints sink between bricks, engraved lines recess into a floor and grooves appear in machinery panels, all without adding a single triangle. It is most convincing on floors and walls seen at an angle. The outer silhouette stays flat, so it is not a replacement for modelled geometry at the edges of an object.
shader=LoadShader("builtin:parallax")
ShaderTexture shader,"BaseTexture",LoadTexture("masonry.png")
ShaderTexture shader,"NormalTexture",LoadTexture("masonry_normal.png")
ShaderTexture shader,"HeightTexture",LoadTexture("masonry_height.png")
ShaderFloat shader,"HeightScale",.075
ShaderInt shader,"MinimumSteps",12
ShaderInt shader,"MaximumSteps",40
EntityShader floor,shader
HeightScale small. It is measured in texture-coordinate units, so a
texture that tiles four times across a wall looks a quarter as deep as one that tiles
once. Adjust it per surface.MaximumSteps if you see stair-stepping at grazing angles.| Control | What it does |
|---|---|
HeightScale (.04) | Apparent depth, in texture-coordinate units. |
MinimumSteps (8), MaximumSteps (24) | Quality of the depth tracing. |
NormalStrength (1) | Strength of the normal map. |
Roughness (.65) | Lighting response of the surface. |
In the sample: the brackets change HeightScale, starting at .075 (range 0 to .16).
For each pixel the shader follows the viewing direction a short way into the height texture, stepping through layers until it reaches the recorded surface, then reads the colour and normal maps at that shifted position. Because the shift depends on the view angle, the texture detail moves as the camera moves, which is what the eye reads as depth. The number of steps is chosen between the minimum and maximum according to how oblique the view is. Relief runs along the surface normal, so bricks on a floor recess straight down, and the texture directions are derived from the UVs, including rotated or mirrored mapping. Interpolation across layer crossings and stable mip selection keep the result smooth.
builtin:hologram · Surface effect, attach with EntityShader · Sample 08_hologram.bb


Hologram turns any model into a translucent, flickering projection with moving scan lines. Use it for mission-planning tables, navigation ghosts that show where to go, recorded messages from a character, and futuristic interfaces. It is a surface treatment: the whole model is still drawn, just see-through and glowing.
shader=LoadShader("builtin:hologram")
ShaderColor shader,"Color",25,190,255,220
ShaderFloat shader,"Opacity",.62
ShaderFloat shader,"ScanDensity",9
ShaderFloat shader,"Flicker",.08
EntityShader ship,shader
Flicker and Noise and a moderate
Opacity. Too much noise hides the shape you are trying to show.| Control | What it does |
|---|---|
Color (40,190,255,220) | Hologram colour; its alpha also affects transparency. |
Opacity (.65) | Overall transparency. |
ScanDensity (14), ScanSpeed (1) | Number and speed of the scan bands. |
Noise (.2), Flicker (.15) | Static and brightness flicker. |
RimPower (2) | How tightly the edges glow. |
In the sample: the brackets change Opacity, starting at .62 (range 0 to 1).
Three animated terms build the colour, opacity and emission of each pixel: horizontal scan bands computed from the pixel's world height, procedural noise and flicker driven by time, and a view-angle rim that brightens the edges. The material draws with alpha blending, does not write depth, casts no shadow and shows both faces, which is why it looks like a projection rather than a solid object.
builtin:wet-surface · Surface effect, attach with EntityShader · Sample 09_wet_surface.bb


Wet Surface turns dry ground into rain-soaked ground. The surface darkens, becomes glossy so that lights glint across it, and puddles with small moving ripples gather where you paint them. It suits rainy streets, cave floors, leaking machinery and anywhere a storm has just passed. For a deep, see-through pool use Water instead.
shader=LoadShader("builtin:wet-surface")
ShaderTexture shader,"BaseTexture",LoadTexture("cobbles.png")
ShaderTexture shader,"NormalTexture",LoadTexture("cobbles_normal.png")
ShaderTexture shader,"PuddleMap",LoadTexture("puddles.png")
ShaderFloat shader,"Wetness",.6
ShaderFloat shader,"PuddleLevel",.72
EntityShader road,shader
Wetness is the overall amount, from 0 (dry) to 1. Raise it over a few
seconds as rain begins.PuddleLevel decides how much of the puddle map counts. Setting
Wetness to 0 does not remove authored puddles; lower PuddleLevel
as well to dry them out.| Control | What it does |
|---|---|
Wetness (.6) | Overall wet amount. |
PuddleLevel (.5) | How much of the puddle map becomes puddle. |
DryRoughness (.75), WetRoughness (.12) | Glossiness when dry and when wet. |
RippleScale (8), RippleSpeed (1), RippleStrength (.03) | Size, speed and strength of the rain ripples. |
In the sample: the brackets change Wetness, starting at .6 (range 0 to 1).
Two sources of wetness are combined per pixel, the global Wetness value and
the puddle map thresholded by PuddleLevel, and the larger one wins. The wet
amount darkens the base colour and blends the roughness from DryRoughness
towards WetRoughness, which sharpens highlights and reflections. An animated
ripple pattern perturbs the surface normal in wet areas so the glints move. Underneath it
is ordinary Standard lighting; there is no separate body of water and no depth.
builtin:snow · Surface effect, attach with EntityShader · Sample 10_snow.bb


Snow settles on the upward-facing parts of existing models while leaving walls and undersides clear, so a summer level becomes a winter one without new art. Use it for seasonal variants, mountain outposts and weathered scenery. It paints the appearance of snow onto the surface; it does not build up a thick layer or change the silhouette.
shader=LoadShader("builtin:snow")
ShaderTexture shader,"BaseTexture",LoadTexture("stone.png")
ShaderFloat shader,"Coverage",.9
ShaderColor shader,"SnowColor",232,245,255
ShaderFloat shader,"HeightBlend",.25
ShaderFloat shader,"Sparkle",.035
EntityShader checkpoint,shader
Coverage runs from 0 (none) to 1 (full). Animate it for a snowfall; 0
clears the overlay completely.SlopeSharpness and HeightBlend to keep vertical walls
mostly clear and to widen or narrow the transition.Direction defaults to straight up. Tilt it for wind-blown drifts on one
side of objects.Sparkle is an emissive glint; keep it low or the snow looks like glitter.| Control | What it does |
|---|---|
Coverage (.75) | How much snow has settled. |
Direction (0,1,0) | Direction the snow falls from. |
SlopeSharpness (4), HeightBlend (.1) | How quickly snow stops on slopes, and the width of the transition. |
NoiseScale (1) | Size of the pattern that breaks up the snow edge. |
SnowColor (235,242,255), BaseRoughness (.7), Sparkle (.08) | Snow colour, glossiness and glint. |
In the sample: the brackets change Coverage, starting at .9 (range 0 to 1).
The shader compares each pixel's surface normal with Direction to decide
how directly it faces the sky; SlopeSharpness sharpens that decision and
HeightBlend widens the blend band. World-space noise breaks up the boundary so
it does not look ruled. Where snow applies, the colour shifts to SnowColor, the
normal is softened, the roughness changes and Sparkle adds emissive speckles.
Nothing is added to the mesh, which is why edges and collision are unchanged.
builtin:water · Surface effect, attach with EntityShader · Sample 11_water.bb


Water turns a flat mesh into a calm body of water: shallow edges look clear, deep areas take on a darker colour, the surface ripples, objects beneath it appear bent, and foam gathers where stones and shores break the surface. It suits ponds, flooded ruins, canals and shallow lakes. It is not an ocean simulator: there are no big waves, and by default it shows surface highlights rather than a true reflection of the scene (see Planar Reflection for that).
shader=LoadShader("builtin:water")
ShaderTexture shader,"NormalMapA",LoadTexture("waves.png")
ShaderTexture shader,"NormalMapB",LoadTexture("waves.png")
ShaderColor shader,"ShallowColor",35,145,170
ShaderColor shader,"DeepColor",8,38,70
ShaderFloat shader,"DepthFade",2.5
ShaderFloat shader,"Refraction",1.3
EntityShader waterMesh,shader
DepthFade for how quickly (in scene
units) the deep colour takes over.FoamWidth and
FoamStrength tune it. Give the basin real depth and put stones through the
surface to see it.Refraction and IOR bend the view of what lies beneath;
Refraction 0 or IOR 1 removes the bending. Transmission
sets how much of the underwater scene shows through; 0 gives an opaque lit surface.| Control | What it does |
|---|---|
ShallowColor (35,145,170), DeepColor (8,38,70) | Water colour at the edge and in the depths. |
WaveScale (.08), WaveSpeed (.04) | Size and speed of the ripples. |
DepthFade (4) | Distance over which shallow becomes deep. |
FoamWidth (.35), FoamStrength (.8) | Foam at contacts. |
Refraction (1), IOR (1.333), Transmission (.9) | Bending and visibility of the scene beneath. |
Reflection (.65), Roughness (.18) | Strength and sharpness of the surface highlights. |
In the sample: the brackets change Refraction, starting at 1.3 (range 0 to 3).
Two normal maps scroll across the surface in different directions and combine into a
moving ripple normal. For each pixel the shader reads the depth of the opaque scene behind
the surface to estimate how far light travels through the water; that distance blends the
shallow colour towards the deep colour and, where it is tiny, produces foam. The renderer's
capture of the opaque scene is sampled with an offset derived from the ripple normal,
Refraction and IOR, which is what bends the view. Transmission
sets the share of that captured background; the colour's alpha controls coverage separately.
Reflection scales the surface highlights; with a planar reflection attached it also
scales the reflected view. Roughness softens highlights, not the transmitted image.
builtin:glass · Surface effect, attach with EntityShader · Sample 12_glass.bb


Glass makes a prop look like tinted, transparent glass. The scene behind it is bent by the curve of the object, and thicker parts absorb more colour, so a bottle looks darker through its base than through its neck. Use it for bottles, vases, display cases, lamps and decorative panels. Objects behind the glass must be solid: glass cannot show other glass, water or smoke through itself.
shader=LoadShader("builtin:glass")
ShaderColor shader,"Tint",160,220,230
ShaderColor shader,"AttenuationColor",60,210,190
ShaderFloat shader,"Thickness",.8
ShaderFloat shader,"AttenuationDistance",.8
EntityShader bottle,shader
Thickness is the distance, in scene units, that light is assumed to travel
through the glass. Keep it modest. 0 disables bending and absorption; a negative value
asks the shader to estimate thickness from the scene depth instead.Tint colours the glass surface itself. Leave its alpha at 255 for a solid
pane; Transmission separately controls how much of the background shows through.AttenuationColor colours the light passing through, and
AttenuationDistance sets how quickly that colour builds up with thickness
(0 disables absorption).IOR 1 removes both the bending and the surface reflection.
Roughness softens the highlights; it does not blur the background.| Control | What it does |
|---|---|
Tint (230,245,255) | Colour of the surface lighting; alpha is coverage. |
Transmission (.95) | How much of the background shows through. |
IOR (1.5) | How strongly the view bends; 1 is no bending. |
Thickness (.1) | Authored travel distance through the glass. |
AttenuationColor (220,245,255), AttenuationDistance (2) | Colour absorbed by the glass and how quickly. |
Roughness (.08) | Sharpness of the highlights. |
In the sample: the brackets change Thickness, starting at .8 (range 0 to 2).
Before transparent objects are drawn, the renderer keeps a capture of the opaque scene.
The glass shader reads that capture at a position offset by the surface normal,
IOR and Thickness, which produces the refraction, then darkens the
result by AttenuationColor according to the travel distance, so thicker glass
absorbs more. A view-dependent surface reflection is added on top and Tint
colours the local lighting. Because every glass object reads the same opaque capture, glass
cannot refract other glass, and because the shader never measures the back faces of the
mesh, Thickness is a single authored value rather than a per-pixel measurement.
builtin:force-field · Surface effect, attach with EntityShader · Sample 13_force_field.bb


Force Field turns a shell mesh into an energy barrier. The barrier is mostly see-through, brightens where its surface curves away from the camera, and lights up in a band wherever it cuts through walls, floors or objects. Use it for shields, quarantine gates, force walls and the boundary of an impact zone. Blocking the player is separate game logic: the shader draws the barrier, your collision code enforces it.
shader=LoadShader("builtin:force-field")
ShaderColor shader,"Color",30,165,245
ShaderFloat shader,"Opacity",.6
ShaderFloat shader,"Emission",2
ShaderFloat shader,"IntersectionWidthWorld",.35
EntityShader barrier,shader
IntersectionWidthWorld above zero to measure the contact band in scene
units; the sample uses .35. Leaving it at 0 falls back to the older
IntersectionWidth control, which works in device-depth units and is harder to
tune.Emission to make
the edges glow.NoiseStrength and NoiseSpeed add a crawling energy pattern;
RimPower sets how tightly the grazing edges glow.| Control | What it does |
|---|---|
Color (40,150,255) | Barrier colour. |
Opacity (.7) | Overall transparency. |
Emission (1.5) | Glow strength. |
RimPower (2.5) | Tightness of the edge glow. |
IntersectionWidthWorld (0) | Width of the contact band in scene units. |
NoiseSpeed (1), NoiseStrength (.2) | Animated energy pattern. |
In the sample: the brackets change IntersectionWidthWorld, starting at .35 (range .05 to 1.2).
Three terms drive the brightness and alpha of each pixel: a view-angle rim, animated
noise, and an intersection term. For the intersection, the shader compares the barrier's
own depth with the depth of the opaque scene behind it; where the two are within
IntersectionWidthWorld of each other along the viewing direction, the pixel
brightens. That is a separation along the view ray, not an exact distance to the nearest
surface, but it looks right for contact bands. The scene-unit path rejects sky and
foreground depth and works with perspective and orthographic cameras. The material blends
transparently and does not write depth.
builtin:grayscale · Camera effect, attach with CameraEffect · Sample 14_grayscale.bb


Grayscale drains the colour out of the camera's picture. Fade it in for a flashback, a
pause or death screen, a security-camera view, or a slow loss of life as the player's
health runs out. Strength lets you go partway, so a scene can look merely
washed out rather than black and white.
effect=LoadShader("builtin:grayscale")
ShaderFloat effect,"Strength",1
CameraEffect camera,effect
Strength between 0 and 1 for transitions rather than switching it
on abruptly.RenderWorld keep their colours, because
the HUD is composited after camera effects.| Control | What it does |
|---|---|
Strength (1) | 0 keeps full colour, 1 is fully grey. |
In the sample: the brackets change Strength, starting at 1 (range 0 to 1).
For each pixel the shader computes a weighted average of red, green and blue that
matches how bright the eye perceives each channel, then blends the original colour towards
that grey by Strength. It runs in the display-linear stage, after tone mapping,
so it is a treatment of the finished picture and has no effect on lighting or bloom.
builtin:vignette · Camera effect, attach with CameraEffect · Sample 15_vignette.bb


Vignette darkens or tints the edges of the screen so the eye settles on the centre. A gentle one gives a cinematic frame; a red one pulsing in and out is the standard low-health warning; a heavy one suits flashbacks, dream sequences and item inspection. It changes colour only; it does not blur.
effect=LoadShader("builtin:vignette")
ShaderFloat effect,"Strength",.85
ShaderFloat effect,"Radius",.3
ShaderFloat effect,"Softness",.65
ShaderColor effect,"Color",3,9,16
CameraEffect camera,effect
Radius is the size of the clear centre and Softness the width
of the fade, both in aspect-corrected screen units rather than pixels. A generous softness
looks more natural; compare on a wide display.Strength sets how far the edges go towards Color. For damage
feedback, use a red colour and pulse the strength from code.| Control | What it does |
|---|---|
Strength (.65) | How dark or coloured the edges become. |
Radius (.45) | Size of the untouched centre. |
Softness (.3) | Width of the transition. |
Color (0,0,0) | Colour the edges fade towards. |
In the sample: the brackets change Strength, starting at .85 (range 0 to 1).
The shader measures each pixel's distance from the centre of the screen, corrected for
the aspect ratio so the shape stays round, and builds a smooth ramp that starts at
Radius and finishes at Radius plus Softness. The pixel
is then blended towards Color by that ramp multiplied by Strength.
It runs in the presentation stage, after tone mapping, and is a plain colour overlay rather
than a simulation of a real lens.
builtin:bloom · Camera effect, attach with CameraEffect · Sample 16_bloom.bb


Bloom spreads a soft glow around anything very bright: neon signs, energy weapons, hot metal, lamp cores and sun glints on water. It is the single effect that most makes a scene feel lit rather than painted. It works best with HDR rendering, which lets the renderer tell a real light source apart from ordinary white paint. Bloom makes an object look bright; it does not light the geometry around it, so pair a glowing sign with a real point light.
HDRRendering True
lampBrush=CreateStandardBrush(255,75,20)
BrushEmissive lampBrush,255,75,20,6
PaintEntity lampCore,lampBrush
effect=LoadShader("builtin:bloom")
ShaderFloat effect,"Threshold",1
ShaderFloat effect,"Intensity",1.1
ShaderFloat effect,"Radius",2.7
CameraEffect camera,effect
HDRRendering.BrushEmissive and a strength well above 1.Threshold first. A value of 1 means only pixels brighter than white
bloom, which keeps pale walls and skies clean. Then raise Intensity, and only
then Radius.| Control | What it does |
|---|---|
Threshold (.65) | How bright a pixel must be before it glows. |
Intensity (.65) | Strength of the glow. |
Radius (2) | How far the glow spreads. |
SoftKnee (.5), Scatter (1) | Softness of the threshold and spread of the blur. |
Quality (1) | 0 low, 1 balanced, 2 high. |
In the sample: the brackets change Intensity, starting at 1.1 (range 0 to 2.5).
Bloom runs four passes. The first keeps only the pixels brighter than
Threshold, with SoftKnee softening the cut-off. The next two blur
that bright image horizontally and then vertically at half resolution, spreading it by
Radius and Scatter. The last pass adds the blurred glow back onto
the scene, scaled by Intensity. All of this happens in the scene-linear stage,
before tone mapping, which is why HDR values above 1 give a much cleaner separation between
real emitters and merely light-coloured surfaces.
builtin:lut-grade · Camera effect, attach with CameraEffect · Sample 17_lut_grade.bb


LUT grading applies a complete colour "look" to the picture from an image you author in an ordinary image editor. Warm evening, cold steel, faded film, a level-specific palette that matches your concept art: whatever you can do to a screenshot with curves and colour balance, a lookup table (LUT) reproduces in the game. It is the effect to reach for when Colour adjustment is not precise enough.
effect=LoadShader("builtin:lut-grade")
ShaderTexture effect,"LUT",LoadTexture("evening_lut.png")
ShaderFloat effect,"Strength",1
CameraEffect camera,effect
LUT. Strength blends between the original and the
graded picture, which is useful for fading between two looks.Exposure, Temperature and Tint adjust the picture
before the lookup and stay active even at Strength 0. Compare against the
identity LUT before you judge the look.| Control | What it does |
|---|---|
LUT | The 256 by 16 lookup strip. |
Strength (1) | Blend between original and graded colour. |
Exposure (0), Temperature (0), Tint (0) | Adjustments applied before the lookup. |
In the sample: the brackets change Strength, starting at 1 (range 0 to 1).
The strip is a three-dimensional colour table stored as sixteen square slices side by side. Within a slice, red runs across and green runs down; the blue value chooses which slice to read. For each pixel the shader looks up its colour in the table, sampling bilinearly within a slice and blending between the two nearest slices, so the result is smooth even though the table holds only 16 steps per channel. It runs in the display-linear stage, after tone mapping, which is why the pre-adjustments exist: they prepare the input before it is mapped.
builtin:ssao · Camera effect, attach with CameraEffect · Sample 18_ssao.bb


SSAO (screen-space ambient occlusion) adds the soft shading that real light leaves in creases, corners and the gaps where objects touch. Without it, a machine sitting on a floor can look as if it is floating slightly; with it, everything feels grounded and the room gains depth, even though no extra lights are added. It is a subtle effect that is usually noticed only when it is switched off.
effect=LoadShader("builtin:ssao")
ShaderFloat effect,"Radius",.85
ShaderFloat effect,"Strength",1.2
ShaderFloat effect,"Power",1.6
ShaderInt effect,"Quality",2
CameraEffect camera,effect
Radius is the size of crease it looks for, in scene units. Match it to the
scale of your objects: too large and every open floor darkens.Strength and Power set how dark the shading gets. If creases
turn into black outlines, lower the strength.| Control | What it does |
|---|---|
Radius (.6) | Size of the creases it shades, in scene units. |
Strength (1), Power (1.5) | Darkness and contrast of the shading. |
Bias (.02) | Small offset that prevents flat surfaces shading themselves. |
Quality (1) | 0 low, 1 balanced, 2 high; higher values search more directions. |
In the sample: the brackets change Strength, starting at 1.2 (range 0 to 3).
From the depth buffer the shader rebuilds a 3D position and a surface direction for each
pixel, then checks several points around it within Radius to see how many are
blocked by nearby geometry. The more blocked, the darker the pixel. The search runs at half
resolution and uses a blue-noise pattern to hide its sampling, then the result is smoothed
without crossing depth edges and multiplied into the scene lighting. Because directions are
reconstructed from depth, it works with classic materials as well as Standard ones.
builtin:depth-fog · Camera effect, attach with CameraEffect · Sample 19_depth_fog.bb


Depth Fog fades distant scenery towards a fog colour. It adds atmosphere, hides the end of a level or the camera's far clipping distance, and makes foreground silhouettes easier to read against the distance. A height mode lets fog pool in valleys and low rooms. If you want visible beams of light and shadows inside the fog, use Volumetric Fog instead.
effect=LoadShader("builtin:depth-fog")
ShaderColor effect,"FogColor",103,151,174
ShaderFloat effect,"Density",.045
ShaderFloat effect,"Start",6
ShaderInt effect,"Mode",1
CameraEffect camera,effect
CameraClsColor camera,103,151,174
FogColor.Density sets how quickly the fog thickens. Start keeps a clear
distance in front of the camera.Mode 0 is linear, 1 is exponential (the natural-looking default), and 2 is
exponential weighted by height: fog is denser below Height and thins out above
it at a rate set by HeightFalloff.CameraRange reaches far enough for the scene you are fogging.| Control | What it does |
|---|---|
FogColor (90,120,155) | Colour the scene fades towards. |
Density (.025) | How quickly fog builds with distance. |
Start (0) | Distance before fog begins. |
Mode (1) | 0 linear, 1 exponential, 2 height-weighted. |
Height (0), HeightFalloff (.2) | Fog level and thinning rate in mode 2. |
In the sample: the brackets change Density, starting at .045 (range 0 to .12).
The shader reads scene depth and reconstructs the distance from the camera to each
pixel, minus Start. In mode 0 the fog amount grows in a straight line with
distance. In mode 1 it follows the exponential curve 1 - e-distance × density,
which never quite reaches full fog and looks like real haze. Mode 2 uses the same curve but
scales the density by the height of the surface being looked at, so low points fog more.
That is a treatment of the visible surface height, not a true integration through a fog
volume, which is why light beams and fog shadows need the volumetric effect. Runs in the
scene-linear stage.
builtin:depth-of-field · Camera effect, attach with CameraEffect · Sample 20_depth_of_field.bb


Depth of field mimics a camera lens: one distance is sharp and everything nearer or farther softens. It draws the eye to a character during dialogue, makes an inventory item feel photographed when you inspect it, and gives cut-scenes and photo modes a cinematic quality. Avoid heavy blur during precision gameplay, where players need to see the whole scene.
effect=LoadShader("builtin:depth-of-field")
ShaderFloat effect,"FocusDistance",12
ShaderFloat effect,"FocusRange",3
ShaderFloat effect,"Aperture",1.6
ShaderFloat effect,"MaxBlur",18
ShaderInt effect,"Quality",2
CameraEffect camera,effect
FocusDistance is measured in scene units straight ahead of the camera.
To follow a character, set it each frame from EntityDistance.FocusRange is the band that stays sharp; Aperture sets how
quickly blur grows outside it.MaxBlur around 8, and use Quality 2 for larger
radii. Setting MaxBlur to 0, or both strengths to 0, restores a sharp picture.| Control | What it does |
|---|---|
FocusDistance (5) | Distance that stays sharp, in scene units. |
FocusRange (2), Aperture (1) | Width of the sharp band and how fast blur grows. |
MaxBlur (8) | Largest blur radius in internal render pixels, up to 32. |
NearStrength (1), FarStrength (1) | Separate strengths for the foreground and background blur. |
Quality (1) | 8, 16 or 32 samples per layer. |
In the sample: the brackets change FocusDistance, starting at 12 (range 4 to 28).
For every pixel the shader compares its depth with the focus distance to decide how large
a blur it needs. The foreground and background are blurred separately at half resolution,
with the number of samples set by Quality, and then combined. Keeping the two
layers separate lets nearer objects soften over a sharp background, as a real lens does.
MaxBlur is a radius in internal render pixels, so at RenderScale .5
a radius of 8 covers about 16 display pixels.
builtin:outline · Camera effect, attach with CameraEffect · Sample 21_outline.bb


Outline draws ink lines wherever one shape ends and another begins, or where a surface turns a corner. Combined with Toon it completes the cel-shaded look; on its own it gives an illustrated or technical-manual style. It applies to the whole picture. To outline just one selected object, use Highlight.
effect=LoadShader("builtin:outline")
ShaderColor effect,"Color",8,18,24
ShaderFloat effect,"Thickness",1.6
ShaderFloat effect,"NormalThreshold",.36
ShaderFloat effect,"DepthThreshold",.003
CameraEffect camera,effect
Thickness is measured in render pixels.NormalThreshold. If lines
are missing between objects at similar distances, lower DepthThreshold.Strength fades the lines for a lighter touch.| Control | What it does |
|---|---|
Color (0,0,0) | Line colour. |
Thickness (1) | Line width in render pixels. |
DepthThreshold (.002) | How large a depth step counts as an edge. |
NormalThreshold (.15) | How sharp a corner counts as an edge. |
Strength (1) | Opacity of the lines. |
In the sample: the brackets change Thickness, starting at 1.6 (range .5 to 4).
The shader reads the depth and the surface normal at four neighbouring positions around
each pixel. If the depth jumps by more than DepthThreshold, or the normals
differ by more than NormalThreshold, the pixel is painted with the line colour.
An object mask helps separate touching objects, although it identifies reactive regions
rather than giving each entity its own number. It runs in the scene-linear stage.
builtin:sharpen · Camera effect, attach with CameraEffect · Sample 22_sharpen.bb


Sharpen brings back some crispness after the picture has been softened, typically by
rendering at a lower RenderScale to save GPU time, or by anti-aliasing. It is
a small finishing touch, not a detail generator: it makes edges that were rendered look
more defined, but cannot invent detail that was never drawn.
RenderScale .7
effect=LoadShader("builtin:sharpen")
ShaderFloat effect,"Strength",.7
ShaderFloat effect,"Clamp",.12
CameraEffect camera,effect
Strength until edges look crisp, then back off a little.
Clamp limits how much any one pixel may change, which prevents halos.| Control | What it does |
|---|---|
Strength (.2) | Amount of sharpening. |
Clamp (.1) | Maximum change per pixel. |
In the sample: the brackets change Strength, starting at .7 (range 0 to 1.5). The sample renders at 70 percent scale so the difference is visible.
This is an unsharp mask. The shader compares each pixel with the average of its four
neighbours to find the local detail, limits that difference by Clamp, scales it
by Strength and adds it back. The neighbour offsets are tied to the real input
resolution, so it behaves the same at any render scale. It runs in the presentation stage,
after upscaling and tone mapping.
builtin:lens · Camera effect, attach with CameraEffect · Sample 23_lens.bb


Lens makes the picture look as if it came through a real, imperfect camera: film grain, colour fringing at high-contrast edges, curved barrel distortion and scanlines. It is the effect for security feeds, damaged helmet cameras, found footage and retro monitors. Each ingredient has its own control, so you can use just grain, or just distortion.
effect=LoadShader("builtin:lens")
ShaderFloat effect,"Grain",.055
ShaderFloat effect,"ChromaticAberration",2
ShaderFloat effect,"Distortion",.075
ShaderFloat effect,"Scanlines",.1
CameraEffect camera,effect
Distortion bulges the picture outwards; negative pinches it.
Check the corners for stretching.ChromaticAberration is measured in source pixels.TimeScale above zero for moving grain, or set it to zero for a fixed
pattern.| Control | What it does |
|---|---|
Grain (.025) | Amount of film grain. |
ChromaticAberration (1) | Colour fringing, in source pixels. |
Distortion (0) | Barrel (positive) or pincushion (negative) distortion. |
Scanlines (0) | Strength of the alternating dark rows. |
TimeScale (1) | Speed of the grain animation. |
In the sample: the brackets change Distortion, starting at .075 (range -.15 to .2).
The shader first remaps each pixel's sampling position by its distance from the centre,
which produces the distortion. It then samples the red and blue channels at slightly
different offsets from the green channel, which produces the fringing. A blue-noise pattern,
advanced over time by TimeScale, supplies the grain, and alternate rows are
darkened for scanlines. All of it runs in the presentation stage on the finished picture.
builtin:motion-blur · Camera effect, attach with CameraEffect · Sample 24_motion_blur.bb


Motion Blur smears fast-moving objects, and the whole view during quick camera turns, along the direction of movement. Used gently it adds a sense of speed to vehicles and action cameras and hides the stutter of very fast movement. Used heavily it makes the game hard to read, so most games keep it subtle or offer a switch.
effect=LoadShader("builtin:motion-blur")
ShaderFloat effect,"ShutterAngle",270
ShaderFloat effect,"MaximumRadius",48
ShaderInt effect,"Quality",2
CameraEffect camera,effect
ShutterAngle sets the trail length in degrees of a film-camera shutter:
180 blurs across half a frame, 360 across a whole frame. MaximumRadius caps the
smear in pixels.CameraWeight and ObjectWeight to favour camera movement or
object movement, for example to keep the player's own vehicle sharp.| Control | What it does |
|---|---|
ShutterAngle (180) | Length of the blur, in degrees. |
MaximumRadius (24) | Longest smear in pixels. |
CameraWeight (1), ObjectWeight (1) | Balance between camera and object motion. |
Quality (1) | 0 low, 1 balanced, 2 high. |
In the sample: the brackets change ShutterAngle, starting at 270 (range 0 to 360).
The renderer records, for every pixel, where it was on screen in the previous frame. A first pass spreads that velocity outward near moving silhouettes, so trails can extend beyond the object itself. A second pass then gathers colour samples along each pixel's velocity over the shutter interval and averages them. The camera and object weights work from the available motion and mask classification rather than from fully separated motion layers.
builtin:ssr · Camera effect, attach with CameraEffect · Sample 25_ssr.bb


SSR (screen-space reflections) adds real reflections of the things currently on screen to polished floors, wet ground and metal. A character walking across a marble hall is mirrored in the floor beneath them. Its limitation is in the name: it can only reflect what the camera can already see, so a reflection vanishes when its source leaves the screen. Give reflective materials an environment map as a fallback, and use Planar Reflection for a true mirror.
floorBrush=CreateStandardBrush(95,107,119)
BrushPBR floorBrush,.85,.055
BrushEnvironmentMap floorBrush,environment,0,.8
PaintEntity floor,floorBrush
effect=LoadShader("builtin:ssr")
ShaderFloat effect,"Strength",.9
ShaderFloat effect,"MaxDistance",35
ShaderFloat effect,"Thickness",.04
CameraEffect camera,effect
RoughnessFade intends.MaxDistance is how far a
reflection ray travels, in scene units; EdgeFade softens reflections near the
screen edges where they would otherwise cut off.TemporalWeight smooths the result across frames; 0 disables that history.| Control | What it does |
|---|---|
Strength (.6) | Reflection brightness. |
MaxDistance (20) | How far reflections reach, in scene units. |
Thickness (.01) | How thick surfaces are assumed to be when the ray tests for a hit. |
RoughnessFade (.7), EdgeFade (1.5) | Fade on rough surfaces and near screen edges. |
Quality (1), TemporalWeight (.7) | Search quality and frame-to-frame smoothing. |
In the sample: the brackets change Strength, starting at .9 (range 0 to 1).
For each reflective pixel the shader works out the direction a mirror would bounce the
view, then marches a ray along that direction through the depth buffer, using a reduced
depth hierarchy for speed, until the ray dips behind a surface. The colour at that point
becomes the reflection. The search runs at half resolution, fades hits near the screen
edges and on rough surfaces, and blends with a dedicated history buffer according to
TemporalWeight. A ray that finds nothing contributes no reflection, leaving
the material's environment lighting visible.
builtin:volumetric-fog · Camera effect, attach with CameraEffect · Sample 26_volumetric_fog.bb


Volumetric Fog fills the air with haze that reacts to your lights. Beams become visible, objects cast shadows through the mist, and a light behind a doorway throws a shaft across the room. It suits misty pump rooms, underwater spaces, dusty warehouses and atmospheric corridors. It costs more than Depth Fog, so use it where the lighting will be seen.
beam=CreateLight(3)
LightShadows beam,True,10
LightColor beam,1800,1450,950
effect=LoadShader("builtin:volumetric-fog")
ShaderFloat effect,"Density",.055
ShaderColor effect,"Color",145,179,207
ShaderInt effect,"Steps",40
ShaderInt effect,"Quality",2
CameraEffect camera,effect
LightShadows with
a high priority makes sure the right one is chosen.Density and Color.Height and HeightFalloff for fog that lies low, and
Distance for how far the effect looks.Anisotropy makes the haze brighter when you look towards a light,
which is how real mist behaves.Steps and Quality trade smoothness against cost.
TemporalWeight is 0 by default; raising it smooths a static scene, but moving
shadow casters reject that history to avoid smearing.| Control | What it does |
|---|---|
Density (.025), Color (160,180,200) | Thickness and colour of the haze. |
Height (0), HeightFalloff (.2) | Fog level and how quickly it thins above it. |
Distance (50) | How far the effect looks, in scene units. |
Anisotropy (.2) | Extra brightness when looking towards a light. |
ShadowStrength (1) | How dark the shadows in the fog are. |
Steps (24), Quality (1), TemporalWeight (0) | Cost, quality and frame-to-frame smoothing. |
In the sample: the brackets change Density, starting at .055 (range 0 to .15). Press H to compare with and without shadows in the fog at the same density.
For every pixel, at quarter resolution, the shader walks along the view ray in
Steps stages up to the scene depth or Distance. At each stage it adds
a little fog, lit by the ambient light and the scene lights, and for the selected shadow
light it checks the shadow map to see whether that point is in shadow. Anisotropy
shapes how strongly the fog scatters light forward. Blue noise dithers the steps so the
result does not band, and an optional history buffer smooths the result over time. Outside
the area covered by the shadow map, the fog is simply unshadowed.
builtin:light-shafts · Camera effect, attach with CameraEffect · Sample 27_light_shafts.bb


Light Shafts streak rays outward from a bright spot on screen, such as the sun, a window or a doorway, around the silhouettes in front of it. They are the "god rays" of a forest clearing or a cathedral. The effect is drawn on the picture rather than in the world, so the bright source must be visible on screen, and it works best in a shot you have framed for it.
effect=LoadShader("builtin:light-shafts")
ShaderFloat effect,"Density",1.5
ShaderFloat effect,"Decay",.98
ShaderFloat effect,"Exposure",.16
CameraEffect camera,effect
; Each frame, point the effect at the sun:
CameraProject camera,EntityX(sun,True),EntityY(sun,True),EntityZ(sun,True)
ShaderVector effect,"Source",ProjectedX()/GraphicsWidth(),ProjectedY()/GraphicsHeight(),0,0
Source every frame from the source's screen
position. The values are fractions of the screen, from 0 to 1.Exposure sets the brightness of the rays; reduce it before they wash out
the foreground. Density and Decay shape how far the streaks reach
and how quickly they fade.Exposure down or disable the effect
with CameraEffectEnabled.| Control | What it does |
|---|---|
Source (.5,.3) | Screen position of the light, 0 to 1 on each axis. |
Exposure (.35) | Brightness of the rays. |
Density (.8), Decay (.95) | Reach and fade of the streaks. |
MaxDistance (.8) | Longest streak, in screen units. |
In the sample: the brackets change Exposure, starting at .16 (range 0 to .8).
For each pixel the shader takes 24 samples along the straight line from the pixel
towards Source, adding up the bright colour it finds, with each successive
sample weighted down by Decay and a falloff with distance. The sum is scaled by
Exposure and added to the scene. Because everything happens in screen space, an
object in front of the source blocks the samples behind it, which is what produces the
silhouette streaks. There is no true volumetric shadow tracing.
builtin:color-adjust · Camera effect, attach with CameraEffect · Sample 28_color_adjust.bb


Colour adjustment gives you the four basic dials of a photo editor, exposure, contrast, saturation and tint, without any image asset. It is the quickest way to change the mood of a level, flash a red alert, drain colour as a timer runs out, or check whether your lighting is balanced. When you need a carefully crafted look, move up to LUT grading.
effect=LoadShader("builtin:color-adjust")
ShaderFloat effect,"Exposure",.15
ShaderFloat effect,"Contrast",1.18
ShaderFloat effect,"Saturation",.45
ShaderVector effect,"Tint",1,.784,.659,1
CameraEffect camera,effect
Exposure 0, Contrast 1,
Saturation 1 and Tint 1,1,1,1. Note that Tint is a
vector of multipliers, not a 0 to 255 colour.ToneMapExposure instead.| Control | What it does |
|---|---|
Exposure (0) | Brightness, in stops. |
Contrast (1) | Contrast around mid-grey. |
Saturation (1) | 0 is grey, 1 is normal, above 1 is vivid. |
Tint (1,1,1,1) | Multiplier for red, green and blue. |
In the sample: the brackets change Saturation, starting at .45 (range 0 to 2).
Exposure multiplies the colour by two to the power of its value, so each
whole step doubles or halves the brightness. Contrast stretches or squeezes the
values around mid-grey. Saturation blends between the pixel's grey value and its
full colour. Tint multiplies each channel. The result is clamped to the display
range in the display-linear stage, after tone mapping.
builtin:soft-particle · Surface effect, attach with EntityShader · Development preview · Sample 38_soft_particles.bb


Flat particle sprites cut a hard, straight line wherever they pass through a floor, a wall or a machine, which instantly gives away that the smoke is a picture. Soft Particle fades each particle out where it approaches solid scenery, so steam curls around a pipe and mist settles onto a floor without any visible seam. It is applied to an ordinary particle emitter and changes nothing about the simulation.
emitter=CreateParticleEmitter(160)
ParticlePreset emitter,2
EntityTexture emitter,LoadTexture("steam.png",3)
shader=LoadShader("builtin:soft-particle")
ShaderFloat shader,"SoftDistance",.65
ShaderFloat shader,"NearFadeDistance",.25
EntityShader emitter,shader
EntityShader. It also works on a
sprite made with CreateSprite.SoftDistance is the width of the contact fade in scene units; 0 disables
it. NearFadeDistance fades particles that come too close to the camera.| Control | What it does |
|---|---|
SoftDistance (.5) | Width of the contact fade, in scene units. |
NearFadeDistance (.2) | Fade for particles near the camera. |
Color, Opacity (1), Emission (1) | Tint, transparency and brightness. |
BaseTexture | Optional texture override; white if absent. |
In the sample: the brackets change SoftDistance, starting at .65 (range 0 to 1.5). P pauses the emitter, B switches between steam and fire, and M changes the render mode.
For each particle pixel the shader compares the particle's depth with the depth of the
opaque scene behind it, in scene units. When the gap is smaller than
SoftDistance, the opacity is scaled down in proportion, so the particle fades
out before it can cut into the surface. A second fade handles the near plane. The shader
runs as an unlit path that reuses the emitter's own vertex data and UV animation, decodes
colour maps to linear colour, keeps opacity linear, and under MSAA evaluates the matching
depth samples at edges. It does not write depth or cast shadows.
EntityHighlight and builtin:highlight · Camera effect, attach with CameraEffect · Development preview · Sample 39_entity_highlight.bb


Highlight draws an outline around one chosen object, the pickup under the cursor, the enemy you are targeting or the prop selected in an editor, without touching its material. One command does it. The outline is hidden by anything in front of the object, so it reads as part of the scene rather than a sticker on the screen. Picking and targeting stay your game's logic; the highlight just shows the result.
EntityHighlight crate ; default amber outline
EntityHighlight crate,0 ; remove it
; Optional: change the style for this camera.
style=LoadShader("builtin:highlight")
ShaderColor style,"Color",40,220,255
ShaderFloat style,"Width",3
ShaderFloat style,"FillOpacity",.15
CameraEffect camera,style
EntityHighlight on the entity. Pass 1 for children to
cover an imported hierarchy, or a camera handle to highlight in one view only.builtin:highlight if you want to change the colour, width,
strength or fill. Attach it with CameraEffect; each camera has one style shared
by everything it highlights. The style alone highlights nothing.Width is 1 to 6 display pixels, independent of RenderScale.
Choose a colour that contrasts with the scene, and keep any fill subtle.| Control | What it does |
|---|---|
Color (255,190,48) | Outline colour. |
Width (2) | Outline width in display pixels, 1 to 6. |
Strength (1) | Outline opacity; 0 bypasses the effect. |
FillOpacity (0) | Tint inside the object's visible area. |
In the sample: the brackets change Width, starting at 2 (range 1 to 6). Click a prop in either view to select it, E adds a second highlight, and H switches the style.
The renderer redraws the visible coverage of the highlighted entities, using their real
silhouettes and alpha cut-outs, and tests it against the depth buffer so nearer objects
block it. It then grows that coverage outward by Width display pixels to form
the outline, and optionally tints the inside. The result is composited after the scene
filters and anti-aliasing but before the HUD, so it never blooms and never lingers in the
temporal history.
builtin:uv-flow · Surface effect, attach with EntityShader · Development preview · Sample 40_uv_flow.bb


UV flow animates a texture along directions you paint into a map, so energy can travel
round a curved conduit, water can pour down a cascade and a current can swirl across a
surface, all on a mesh whose UVs would never scroll neatly on their own. For a texture
that just slides in one direction, such as a straight conveyor belt, you do not need it:
TextureScroll on the ordinary material does that.
shader=LoadShader("builtin:uv-flow")
ShaderTexture shader,"BaseTexture",LoadTexture("energy.png")
ShaderTexture shader,"FlowMap",LoadTexture("flow_map.png",1+8+16+32)
ShaderFloat shader,"FlowStrength",.24
ShaderFloat shader,"FlowSpeed",1
ShaderFloat shader,"Emission",1.5
EntityShader conduit,shader
FlowStrength above zero. The default is 0, which shows no flow at all.FlowSpeed is cycles per second; negative values reverse the flow.Time is -1 by default, meaning the engine clock. Supply your own
non-negative seconds to control or pause the flow. PauseTextureScroll only
freezes ordinary texture scrolling, not this.| Control | What it does |
|---|---|
FlowStrength (0) | How far the texture is displaced. |
FlowSpeed (1) | Cycles per second. |
Time (-1) | -1 uses the engine clock; otherwise seconds. |
Color, Emission (0) | Tint and glow. |
NormalStrength (1), Roughness (.6) | Normal map strength and lighting response. |
In the sample: the brackets change FlowStrength, starting at .24 (range 0 to .6). P pauses the props, the scrolling and the flow together; R rebases the belt texture with PositionTexture.
The flow map gives each point on the surface a direction. The shader offsets the base
texture lookup along that direction by an amount that grows with time, and runs two such
copies half a cycle apart, cross-fading between them as each one restarts so the reset is
never seen. Colours blend in linear space and decoded normals are blended and renormalised.
The surface keeps ordinary lighting, tint, texture alpha and the supported blend modes, and
each map keeps its own PositionTexture, ScaleTexture and
RotateTexture settings. The frame time is shared across cameras, shadows and
canvases so every view stays in phase.
builtin:heat-haze · Surface effect, attach with EntityShader · Development preview · Sample 41_heat_haze.bb


Heat Haze makes the air wobble behind a hot exhaust, a furnace mouth, a desert horizon or a magical field. You place a transparent quad or sprite where the hot air is, and everything solid behind it ripples while everything in front of it stays sharp. The distortion is an image trick: the scene itself does not move.
shader=LoadShader("builtin:heat-haze")
heatMap=LoadTexture("heat_distortion.png")
ShaderTexture shader,"DistortionMap",heatMap
ShaderTexture shader,"MaskTexture",LoadTexture("exhaust_mask.png",3+16+32)
ShaderFloat shader,"DistortionPixels",16
ShaderFloat shader,"SoftDistance",.3
TextureScroll heatMap,0,.15
EntityShader hazeQuad,shader
DistortionMap is a texture of offsets: red moves the lookup sideways and
green vertically, with mid-grey meaning no movement. A tiling noise texture works well.
MaskTexture shapes the visible region with its alpha; load it with alpha and
clamp flags.DistortionPixels is the largest shift, in display pixels, up to 32.
Opacity, entity alpha and vertex alpha all scale the effect.TextureScroll; the mask keeps its own
transform, so it can stay still. PauseTextureScroll freezes the movement.SoftDistance fades the haze where the quad meets solid scenery; 0 disables
that fade.| Control | What it does |
|---|---|
DistortionPixels (6) | Largest shift in display pixels, 0 to 32. |
Opacity (1) | Overall strength of the haze. |
SoftDistance (.3) | Fade where the quad meets scenery, in scene units. |
DistortionMap, MaskTexture | Offset data and coverage shape. |
In the sample: the brackets change DistortionPixels, starting at 16 (range 0 to 32). P freezes the map, and G places a glass vessel behind the exhaust to show what the haze cannot see.
The renderer keeps a capture of the opaque scene before transparent objects are drawn.
For each pixel of the haze quad, the shader reads the distortion map, turns red and green
into a horizontal and vertical offset scaled by DistortionPixels, and samples
the capture at that shifted position, so the background appears to move the opposite way.
Coverage is the mask alpha multiplied by Opacity and the entity and vertex alpha.
Where a solid object is nearer than the quad, the displaced lookup is rejected, which keeps
the foreground straight. The material blends with alpha, writes no depth and casts no shadow.
builtin:matcap · Surface effect, attach with EntityShader · Development preview · Sample 43_matcap.bb


A matcap ("material capture") is a picture of a sphere rendered in a studio with the material you want: clay, polished chrome, wax, jade. The shader wraps that picture onto your model so it appears to have been lit in that studio, whichever way it is turned. It is the look of a sculpting program's viewport, and it suits collectibles, inspection screens, statues and deliberately stylised games. Your scene lights do not affect it.
shader=LoadShader("builtin:matcap")
ShaderTexture shader,"MatcapTexture",LoadTexture("matcap_clay.png",1+8+16+32)
ShaderFloat shader,"Intensity",1
EntityShader bust,shader
Color tints the result and Intensity scales
it; values above 1 are useful with HDR and 0 gives black. With no texture bound you get the
plain material colour.NormalTexture and NormalStrength if the model needs surface
detail; the normal map uses the mesh's own UVs.| Control | What it does |
|---|---|
MatcapTexture | The lit-sphere image. |
Color, Intensity (1) | Tint and brightness of the baked lighting. |
NormalTexture, NormalStrength (1) | Optional surface detail. |
In the sample: the brackets change Intensity, starting at 1 (range 0 to 3). R stops and starts the rotation, O orbits the camera and P pauses. The small silver relic keeps Standard lighting for comparison.
The shader converts each pixel's final surface normal into camera space and uses its
horizontal and vertical components to pick a point on the matcap image: a normal pointing
straight up reads the top of the image, one pointing at the camera reads the centre. The
image's colour is converted from sRGB to linear light, tinted and scaled by
Intensity; its alpha is ignored. Texture transforms such as
RotateTexture reposition the lookup, but mesh UVs do not. The material reports
full roughness to the renderer so SSR does not add a second, conflicting reflection.
builtin:planar-reflection with CreatePlanarReflection · Surface effect and scene service · Development preview · Sample 44_planar_reflection.bb


Planar Reflection is a true mirror. The scene is rendered a second time from the other side of a flat plane, so the mirror shows everything, including objects behind the camera that SSR can never see. Use it for an observatory mirror, a polished wall, a still pool or calm reflecting water. Because it renders the scene again, it costs real geometry and shadow work, so use it for a few important surfaces rather than every shiny floor.
shader=LoadShader("builtin:planar-reflection")
EntityShader mirrorMesh,shader
plane=CreatePivot()
RotateEntity plane,-90,0,0 ; local +Y must face the camera's side
PositionEntity plane,0,3.5,7
reflection=CreatePlanarReflection(camera,plane)
EntityPlanarReflection mirrorMesh,reflection
CreatePlanarReflection
makes the capture and EntityPlanarReflection connects it to the mesh.Strength runs from 0 to 1. Color is both the base colour and
the reflection tint, so lowering the strength of a white mirror reveals a white surface.
FresnelPower 0 keeps a constant mirror; higher values favour grazing views.FallbackColor, and optionally a panoramic FallbackTexture,
for when the capture is disabled or seen from behind.EntityPlanarReflection on a
Water mesh, then tune its Reflection and
ReflectionDistortion.PlanarReflectionSettings (capture scale .25 to 1),
switch captures off with PlanarReflectionEnabled when they are out of view,
and release them with FreePlanarReflection. Up to two enabled planes per camera
and one bounce are supported; receivers must be flat and rigid.| Control | What it does |
|---|---|
Strength (1) | Reflection weight, 0 to 1. |
Color | Base colour and reflection tint. |
FresnelPower (0) | 0 for a constant mirror; higher favours grazing angles. |
FallbackColor (128,128,128), FallbackIntensity (1), FallbackTexture | What shows when no capture is available. |
In the sample: the brackets change Strength, starting at 1 (range 0 to 1). M selects the mirror, pool or facing mirrors, V compares an SSR floor, R changes the capture size, C crosses the plane and P pauses the courier and robot.
The service mirrors the camera across the declared plane and renders the scene again from there into a separate scene-linear image, clipping away geometry behind the plane. That extra view has its own lighting and shadows but no camera effects, highlight, temporal history or multisampling. The receiving surface projects each of its pixels into that image to find its reflection, and the main view tone maps the combined result once. Captures update only for enabled receivers that might be visible; anything else uses the fallback. Reflectors seen inside a capture use their own fallback, which is the one-bounce limit.
CreateStandardBrush, BrushPBR and the Brush map commands · Material · Sample 29_standard.bb


BrushStandard off.Standard is the everyday material for modern-looking models: painted metal, ceramics, plastic, stone, skin and glowing parts. Two numbers, metallic and roughness, give the same model very different identities under the same light, and an environment map adds reflections and soft ambient light. Models imported from glTF and GLB files use it automatically. Standard also supplies the surface information that several camera effects depend on, so it is the material to use wherever you want the best from SSR, SSAO, outline and motion blur.
brush=CreateStandardBrush(200,150,60) BrushPBR brush,1,.25 ; metallic, roughness BrushEnvironmentMap brush,environment,0,1.2 PaintEntity prop,brush ; A tinted glass vessel: glassBrush=CreateStandardBrush(160,230,255) BrushPBR glassBrush,0,.1 BrushTransmission glassBrush,.92,1.45 BrushVolume glassBrush,.35,3,160,230,255 PaintEntity vessel,glassBrush
BrushStandard.BrushPBR. Metallic is 0 for paint, clay, wood and skin and 1 for bare
metal. Roughness near 0 gives sharp mirror-like highlights; near 1 gives broad, soft ones.BrushBaseColorMap,
BrushNormalMap, BrushMetallicRoughnessMap,
BrushOcclusionMap and BrushEmissiveMap.BrushEnvironmentMap. It provides the reflections
and ambient light that make metal read as metal, and stays available when SSR misses.BrushTransmission for the light passing through and
BrushVolume for the authored thickness that bends and absorbs it. Alpha stays
surface coverage. Clearcoat, sheen, anisotropy and iridescence are further optional layers.| Command | What it does |
|---|---|
BrushPBR brush,metallic,roughness | The two numbers that define the surface. |
BrushEnvironmentMap | Reflections and ambient light from a panorama. |
BrushEmissive | Self-illumination, and the input for Bloom. |
BrushTransmission, BrushVolume | Glass and other transparent solids. |
In the sample: the brackets change roughness, starting at .25 (range .05 to .9). Roughness changes the highlights, not the sharpness of what shows through the glass.
Standard uses a physically based microfacet lighting model. Base colour, metallic and roughness describe how the surface scatters light, and the renderer evaluates that against each light and against the environment map, which stands in for the surroundings when screen-space reflections have nothing to show. The maps add detail: normals for small bumps, occlusion to darken crevices, emission for parts that give off light. Transmission and volume extend the model to light passing through the material along an authored optical distance. While drawing, Standard also writes the normals, roughness and motion data that the depth-based camera effects read.
AntiAliasMode 1 · Image quality · Sample 30_fxaa.bb


FXAA smooths the jagged stair-steps along edges in a single cheap pass over the finished picture. It is the default anti-aliasing and the right choice for modest hardware, and it works alongside every depth-based camera effect. Its trade-off is that it can slightly soften fine texture detail and text as well as edges, and it cannot stop thin details from shimmering when they move; for that, see TAA.
AntiAliasMode 1
In the sample: there is no numeric control. Space switches FXAA off and on.
FXAA looks at the brightness contrast between neighbouring pixels to find likely edges, estimates the direction each edge runs, and blends colours along that direction to hide the steps. It is purely a filter on the current image and needs no information from previous frames, which is why it is cheap, robust and available everywhere.
AntiAliasMode 3 · Image quality · Sample 31_taa.bb


TAA (temporal anti-aliasing) uses the previous frames as well as the current one to produce stable, smooth edges. It is the best answer to shimmering foliage, thin antennae, fences and distant detail, and it is the natural partner for Motion Blur and Dither Fade. Its weakness is fast motion and hard camera cuts, where old frames can briefly trail behind moving objects.
AntiAliasMode 3
In the sample: there is no numeric control. Space switches TAA off and on; the sentinel walks a patrol so you can judge motion, and P pauses it.
Each frame the camera projection is nudged by a fraction of a pixel, so successive frames sample slightly different positions. The previous result is moved to where it should now be using the per-pixel motion data, its colours are clamped to the range found in the current frame's neighbourhood so stale detail cannot survive, and the two are blended. Around moving objects and reactive pixels the history weight is reduced. The renderer resets the history on camera cuts, resizes and quality changes.
HDRRendering, ToneMapMode, ToneMapExposure · Image quality · Sample 32_tone_map.bb


With HDR rendering on, the scene can hold brightness far above white: a lantern core, a furnace, sunlight on metal. Tone mapping squeezes that range onto a normal display so the bright parts keep their colour and their differences instead of all clipping to the same flat white. It is the foundation for Bloom and for any art direction built on strong emissive lighting.
HDRRendering True ToneMapMode 2 ToneMapExposure 0
ToneMapMode in the command reference for the full list.ToneMapExposure shifts the exposure in stops before the curve is applied:
+1 doubles the brightness, -1 halves it.In the sample: the brackets change the exposure, starting at 0 (range -2 to 2). Space compares the filmic curve with mode 0 at the same exposure.
HDR rendering draws the scene into a floating-point buffer where values above 1 are kept. After the scene-linear camera effects, one engine-owned output pass multiplies by two to the power of the exposure and then applies the tone curve. The filmic curve keeps mid-tones close to linear and rolls the highlights off gently, so a red lamp core stays red as it brightens instead of turning white. Everything in the display stage, including vignette, grading and the HUD, happens after this pass.
TerrainLayer, TerrainSplatMap, TerrainNormalMap · Material · Sample 33_terrain.bb


The terrain material paints a landscape with up to four tiled ground textures, grass, rock, path and snow, and blends between them wherever you say. One stretched texture over a hillside always looks repetitive and blurry; four small tiling textures mixed by a painted map look like real ground. A shared detail normal map adds grain and pebbles up close.
TerrainLayer terrain,0,LoadTexture("moss.png"),.3
TerrainLayer terrain,1,LoadTexture("rock.png"),.25
TerrainLayer terrain,2,LoadTexture("path.png"),.2
TerrainLayer terrain,3,LoadTexture("snow.png"),.3
TerrainSplatMap terrain,LoadTexture("splat.png",1+2+8)
TerrainNormalMap terrain,LoadTexture("ground_normal.png"),.3,.4
TerrainLayer is how many times the texture repeats per grid unit.TerrainLayerColor tints a single layer, which is what the sample's bracket
control changes. Keep the grid and texture scales appropriate to the size of the level.| Command | What it does |
|---|---|
TerrainLayer terrain,layer,texture,scale | One of four tiled ground textures. |
TerrainSplatMap terrain,texture | Which layer shows where. |
TerrainNormalMap terrain,texture,scale,strength | Shared close-up bump detail. |
TerrainLayerColor | Tint for one layer. |
In the sample: the brackets change the rock layer brightness, starting at 1 (range .2 to 1.5). Space removes the splat map so only the base layer shows.
For every pixel the terrain shader samples the four tiled colour textures at their own scales and reads the splat map, which is stretched once across the whole heightfield. The four weights are normalised so they always add up to one, then used to mix the colours. The shared normal map is sampled at its own scale and blended in by strength. The heightfield geometry and its level-of-detail are handled by the terrain system and are separate from this material.
CreateSkyBox, SkyBoxIntensity · Scene backdrop · Sample 34_skybox.bb


A skybox wraps the whole scene in a distant sky or panoramic backdrop. However far the camera travels, the horizon never gets closer, which is exactly how a real sky behaves. It gives outdoor levels a horizon and an otherwise empty background a sense of place, and its brightness can be faded for dusk and night.
skyTexture=LoadTexture("ridge_sky.jpg",1+8+32)
sky=CreateSkyBox(skyTexture)
SkyBoxIntensity sky,1
BrushEnvironmentMap.SkyBoxIntensity towards 0 for evening and night, or fade it over
time for a day cycle. RotateEntity on the skybox drifts the sky.BrushEnvironmentMap separately.| Command | What it does |
|---|---|
CreateSkyBox(texture) | Creates the sky from a panorama. |
SkyBoxIntensity sky,value | Display brightness of the sky. |
SkyBoxTexture | Swaps the panorama. |
In the sample: the brackets change the sky intensity, starting at 1 (range .1 to 2). Space hides and shows the skybox.
The skybox shader looks up the panorama by the direction of each pixel's view ray, after removing the camera's position so that only its rotation matters. That is what keeps the sky at infinite distance. The texture colour is converted to linear light and multiplied by the intensity. It draws full-bright, ignores fog and neither casts nor receives shadows.
CreateDecal, DecalSize, AlignDecal · Scene service · Sample 35_decal.bb


A decal stamps a picture onto whatever solid scenery it touches: bullet holes, scorch marks, paint, blood, tyre tracks, landing-pad markings. It wraps over edges and bumps and crosses from the floor onto a machine without you building a separate mesh for every surface. Place it, size it, and the renderer projects it.
decal=CreateDecal(LoadTexture("landing_mark.png",1+2))
DecalSize decal,4.8,4.8,4
AlignDecal decal,x#,y#,z#,nx#,ny#,nz#,17
; After LinePick, stamp at the hit point:
AlignDecal decal,PickedX(),PickedY(),PickedZ(),PickedNX(),PickedNY(),PickedNZ()
DecalSize sets the width and height of the mark in world units, and how
deep the projection reaches behind the decal's plane. Keep the depth tight enough that it
does not mark unrelated geometry behind the target.AlignDecal places it flush on a surface point, aimed along the surface
normal, with an optional roll. The pick commands give you exactly those values.EntityAlpha, and use EntityReceivesDecals
to stop a particular prop, such as a character, from being marked.| Command | What it does |
|---|---|
CreateDecal(texture) | Creates a decal entity. |
DecalSize decal,width,height,depth | Size of the mark and reach of the projection. |
AlignDecal decal,x,y,z,nx,ny,nz,roll | Sits the decal on a surface point. |
EntityReceivesDecals | Excludes an entity from being marked. |
In the sample: the brackets change the decal opacity through EntityAlpha, starting at 1 (range 0 to 1). Space hides the decals.
A decal is a small projection box. For each pixel inside the box the shader reads the scene depth, rebuilds the point on the surface behind it, converts that point into the decal's own texture coordinates and samples the mark. Surfaces seen at a grazing angle fade out so the texture does not smear across them. The result is a colour and alpha overlay on the existing lighting. Under 4x MSAA a variant that reads multisampled depth is used automatically.
AntiAliasMode 2 · Image quality · Sample 36_msaa_depth.bb


4x MSAA smooths geometry edges by drawing four samples per pixel, and is the crispest of the anti-aliasing options on edges. The catch is that camera effects such as fog, depth of field and SSAO read a single depth per pixel. The MSAA depth resolve is the built-in helper that gives them one, chosen so that fog and focus stay lined up with thin rails and curved edges instead of leaking around them. You never load it yourself; the renderer uses it whenever it is needed.
AntiAliasMode 2
fog=LoadShader("builtin:depth-fog")
ShaderFloat fog,"Density",.035
ShaderColor fog,"FogColor",140,172,186
CameraEffect camera,fog
DrawRenderStats 8,8,1023 to see the pass count, buffer mask and current AA
state.In the sample: there is no numeric control. Space switches between 4x MSAA and no anti-aliasing while depth fog stays on.
With MSAA the depth buffer holds four depth samples per pixel. Before the single-sample camera effects run, the helper picks the nearest covered sample for each pixel, giving a conservative depth at edges: a thin rail keeps its own depth rather than an average with the background behind it, so fog and blur respect its silhouette. The colour buffer is resolved separately before the camera effects see it.
EntityColorOverlay · Entity operation · Development preview · Sample 37_color_overlay.bb


Colour overlay is the damage flash, the invulnerability pulse and the team or status
tint, applied on top of whatever material an entity already has. Unlike
EntityColor, which multiplies and therefore leaves dark panels dark, an overlay
blends towards a colour, so a white overlay really does turn a dark robot white for a
frame. Paint, metal, normal maps, cut-outs and shadows stay exactly as they were.
; When the robot is hit: flash#=1 ; Each frame: flash=flash-elapsed#*3 If flash<0 Then flash=0 EntityColorOverlay robot,255,255,255,flash,2
EntityColorOverlay with the colour, an amount from 0 to 1 and an
optional emission. Amount 0 clears the overlay.CopyEntity start with no overlay.| Command | What it does |
|---|---|
EntityColorOverlay entity,red,green,blue,amount,emission | Blends the finished material colour towards a colour, with optional glow. |
In the sample: the brackets change the peak amount, starting at .65 (range 0 to 1). F triggers a hit, M cycles steady, hit and pulse modes, T changes the right robot's base tint with the overlay still active, and Space clears only the overlay.
After the material has produced its final local colour, the renderer blends that colour towards the overlay colour by the amount and adds the emission as extra brightness. Because this happens after the material, alpha cut-outs, transparency, shadows and surface detail are untouched, and a Standard glass material keeps the background visible through it: only the locally lit share receives the overlay.
EntityDitherFade, EntityDitherRange, EntityLODTransition · Entity operation · Development preview · Sample 42_dither_fade.bb


Dither Fade removes the pop. Streamed scenery can fade in and out over a distance band instead of appearing from nowhere, and a model can crossfade between its detailed and low-detail meshes instead of snapping. Because it works by dropping pixels rather than by transparency, the remaining pixels keep proper depth and shadows, and nothing needs to be sorted. The pattern is visibly grainy on its own, so it is designed to be used with TAA.
; Manual fade, driven by your own timer: EntityDitherFade prop,coverage# ; 1 is solid, 0 is gone ; Distance band, measured to the entity origin: EntityDitherRange prop,14,24 ; solid up to 14 units, gone at 24 ; Crossfade between real LOD meshes: AddEntityLOD courier,courierLow,14 EntityLODTransition courier,6 ; 6-unit band around each threshold
AddEntityLOD as usual and
add a transition width. Inside the band both meshes are drawn, so keep it narrow.| Command | What it does |
|---|---|
EntityDitherFade entity,coverage,seed | Manual coverage from 1 to 0. |
EntityDitherRange entity,near,far | Automatic fade over a camera-distance band. |
EntityLODTransition entity,width | Crossfade band around each LOD threshold; 0 restores hard switching. |
In the sample: the brackets change the LOD transition width, starting at 6 (range 0 to 12). Space compares hard switching, T toggles TAA, R restarts the camera path, P pauses it and L cycles the shadow light. Anti-aliasing starts off so the grain is visible.
A screen-space dither pattern discards a share of each surface's pixels equal to one minus its coverage. The pixels that remain are drawn fully opaque, so they take part in the depth and shadow passes exactly as a solid object would. During an LOD transition the two meshes use complementary patterns, so between them the projected pixels stay fully covered while the mix shifts from one mesh to the other. TAA averages the pattern across frames into a smooth fade. Differences in silhouette between the two meshes can still show, which is why matching LOD outlines matter.
Save a neutral screenshot before you build a stack of effects, so you always have something to compare against. Then add one effect at a time and check it in motion, not just in a still.
CameraEffectEnabled, especially on secondary cameras, and lower
Quality on the expensive ones. DrawRenderStats 8,8,1023 shows the
pass count, buffer usage and memory of the current stack.Resolution, camera range, material setup and the graphics card all change the result. Treat these sample scenes as working starting points, then test the exact combinations and frame rate your own game needs.
Original showcase assets and runtime captures, September 2026. All media is included locally; this guide needs no network connection. · Built-in shaders · Extended mode