Help home · Beginner · Intermediate · Advanced authoring · Catalogue · Command reference · Samples

Built-in Effects Guide

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.

Before starting: shader commands need Extended language mode. Every effect here is packaged inside the runtime, so a standalone executable needs no shader files beside it. If shaders are completely new to you, read Shaders for Beginners first; it takes ten minutes.

What each entry contains

SectionWhat it tells you
SummaryWhat the effect does in game terms, and the kinds of scenes and moments it suits.
How to use itWorking 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 worksA 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.

Running the samples

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.

KeyAction
SpaceSwitches the effect off and on for comparison.
[ and ]Lower or raise the parameter shown on screen.
W A S D and arrow keysMove and look around.
TabReturn to the original camera position.
PPause robot animation and any moving object or light. Shader clocks (wind, scan lines, grain) keep running.
F12Save a PNG screenshot to the working directory.
EscExit.

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.

Attaching and adjusting an effect

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 modelOn 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 valueCommandExample
A decimal numberShaderFloatShaderFloat effect,"Strength",.8
A whole number, such as a quality level or a modeShaderIntShaderInt effect,"Quality",2
A colour, 0 to 255 per channelShaderColorShaderColor effect,"RimColor",40,140,255
A direction or a set of four numbersShaderVectorShaderVector effect,"WindDirection",1,0,.2,0
A textureShaderTextureShaderTexture 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.

A good order for camera effects: settle materials and lighting first, then add contact shading and reflections (SSAO, SSR), then fog, then focus and motion effects, then bloom, then tone mapping, and finally colour grading and finishing filters such as vignette, sharpen and lens. Each built-in effect declares the stage it belongs to, so the renderer keeps scene-linear work before tone mapping and display work after it. Within a stage, attachment order still matters.

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.

Which effect do I need?

You want to...Try...
Give a game a cartoon or illustrated lookToon on the characters and Outline on the camera
Make a pickup or enemy stand outRim Light, or Highlight for a selection outline
Teleport, burn or despawn somethingDissolve, or Dither Fade for streamed scenery
Show a hit, a power-up or a statusColour overlay
Make a scene glow, or show a neon signBloom with HDR and tone mapping
Add atmosphere or hide the end of a levelDepth Fog; Volumetric Fog if you want visible light beams
Give a room depth without more lightsSSAO
Add reflections to a floor or a mirrorSSR for polished floors, Planar Reflection for a true mirror or pool
Set a mood with colourColour adjustment for quick changes, LUT grading for an authored look, Grayscale and Vignette for flashbacks and damage
Show rain, snow or seasonsWet Surface, Snow
Add water, glass or an energy shieldWater, Glass, Force Field, Hologram
Animate plants, conveyors or energy conduitsFoliage, UV flow, Heat Haze
Texture rocks and cliffs without UV mappingTriplanar; Parallax for deep-looking brickwork
Frame a cinematic or photo momentDepth of field, Motion Blur, Light Shafts, Lens
Clean up jagged or shimmering edgesFXAA, TAA, MSAA, then Sharpen

Surface effects (attach to a model)

EffectAliasIn one line
Unlitbuiltin:unlitIgnores lighting, for screens and signs.
Toonbuiltin:toonCartoon lighting in flat bands.
Rim Lightbuiltin:rim-lightColoured glow along the edges of a model.
Dissolvebuiltin:dissolveEats a model away with a glowing edge.
Foliagebuiltin:foliageLeaves that sway in the wind.
Furbuiltin:furShort coats for plush toys, animals and fuzzy fabric.
Triplanarbuiltin:triplanarTextures rocks without UV mapping.
Parallaxbuiltin:parallaxFake depth in brickwork and panels.
Hologrambuiltin:hologramTranslucent scanning projection.
Wet Surfacebuiltin:wet-surfaceRain-soaked ground with puddles.
Snowbuiltin:snowSnow on upward-facing surfaces.
Waterbuiltin:waterCalm water with depth colour, ripples and foam.
Glassbuiltin:glassTinted, refracting glass.
Force Fieldbuiltin:force-fieldEnergy barrier that lights up where it meets scenery.
Soft Particlebuiltin:soft-particleSmoke that no longer cuts hard lines into floors. Development preview.
UV flowbuiltin:uv-flowTextures that flow along a direction map. Development preview.
Heat Hazebuiltin:heat-hazeWobbling air behind exhausts and furnaces. Development preview.
Matcapbuiltin:matcapStudio lighting baked into one image. Development preview.
Planar Reflectionbuiltin:planar-reflectionTrue mirrors and reflecting pools. Development preview.

Camera effects (attach to a camera)

EffectAliasIn one line
Grayscalebuiltin:grayscaleDrains colour from the view.
Vignettebuiltin:vignetteDarkens or tints the screen edges.
Bloombuiltin:bloomGlow around bright objects.
LUT gradingbuiltin:lut-gradeColour look from an authored image.
SSAObuiltin:ssaoSoft shadows in creases and contacts.
Depth Fogbuiltin:depth-fogDistance and height fog.
Depth of fieldbuiltin:depth-of-fieldCamera focus with near and far blur.
Outlinebuiltin:outlineInk lines around shapes.
Sharpenbuiltin:sharpenRestores crispness after scaling or anti-aliasing.
Lensbuiltin:lensGrain, fringing, scanlines and distortion.
Motion Blurbuiltin:motion-blurSmears fast movement.
SSRbuiltin:ssrReflections of on-screen objects.
Volumetric Fogbuiltin:volumetric-fogHaze with visible light beams and shadows.
Light Shaftsbuiltin:light-shaftsRays streaming from a bright source.
Colour adjustmentbuiltin:color-adjustExposure, contrast, saturation and tint.
Highlightbuiltin:highlightOutline style for selected objects. Development preview.

Materials, image quality and entity operations

FeatureCommandsIn one line
StandardCreateStandardBrush, BrushPBRThe everyday physically based material.
FXAAAntiAliasMode 1Cheap edge smoothing.
TAAAntiAliasMode 3Stable edges using previous frames.
Tone mappingHDRRendering, ToneMapModeFits bright HDR lighting onto the display.
TerrainTerrainLayer, TerrainSplatMapBlends four ground textures across a landscape.
SkyboxCreateSkyBoxDistant panoramic backdrop.
DecalCreateDecal, AlignDecalMarks projected onto scenery.
MSAA depth resolveAntiAliasMode 2Keeps depth effects aligned under 4x MSAA.
Colour overlayEntityColorOverlayDamage flashes and status tints. Development preview.
Dither FadeEntityDitherFade, EntityLODTransitionPop-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.

Unlit

builtin:unlit · Surface effect, attach with EntityShader · Sample 01_unlit.bb

Unlit switched on: night-shift wayfinding
01 / Night-shift wayfinding. A moving light sweeps the depot; the terminal graphics keep their authored colour.
Show the same scene with Unlit switched off
Unlit switched off
Switched off, the terminal screens are lit like every other surface and dim as the light moves away.

Summary

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.

How to use it

shader=LoadShader("builtin:unlit")
ShaderTexture shader,"Texture",LoadTexture("terminal.png")
EntityShader screenMesh,shader
  1. Attach the shader to the mesh that should stay flat. Put it on the screen surface rather than the whole prop, or the casing will lose its lighting as well. BrushShader lets you target one surface of a larger model.
  2. A texture already on the surface's brush is used as normal. The Texture control lets you bind one from code instead, which is handy for a plain quad.
  3. If you want the screen to spill light into the room, add the Bloom camera effect. Unlit on its own never glows beyond its own pixels.
ControlWhat it does
TextureOptional texture to show instead of the brush texture.

In the sample: there is no numeric control. Press Space while the light sweeps past.

How it works

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".

Back to the effect list

Toon

builtin:toon · Surface effect, attach with EntityShader · Sample 02_toon.bb

Toon switched on: salvage squad
02 / Salvage squad. Broad armour shapes and curved joints reveal the stepped lighting bands.
Show the same scene with Toon switched off
Toon switched off
Switched off, the same robots have ordinary smooth lighting.

Summary

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.

How to use it

shader=LoadShader("builtin:toon")
ShaderFloat shader,"Bands",4
ShaderColor shader,"ShadowColor",32,65,90
ShaderFloat shader,"RimStrength",.08
EntityShader robot,shader
  1. Attach the shader to a character or prop. Its own textures are used as normal.
  2. Start with three or four bands. Keep ambient light low: a strong fill light pushes everything into the top band and the effect flattens out.
  3. Pick a tinted dark for ShadowColor rather than pure black; it reads as illustration instead of a hole.
  4. Add ink lines with Outline on the camera if the style needs them.
ControlWhat 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.
TextureOptional texture override.

In the sample: the brackets change Bands, starting at 4 (range 2 to 10).

How it works

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.

Back to the effect list

Rim Light

builtin:rim-light · Surface effect, attach with EntityShader · Sample 03_rim_light.bb

Rim Light switched on: moonlit recovery
03 / Moonlit recovery. A cyan edge helps the dark salvage sentinel read against a night-time wreck.
Show the same scene with Rim Light switched off
Rim Light switched off
Switched off, the sentinel sinks into the dark background.

Summary

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.

How to use it

shader=LoadShader("builtin:rim-light")
ShaderColor shader,"RimColor",50,200,255
ShaderFloat shader,"RimPower",3.5
ShaderFloat shader,"Strength",1.4
EntityShader sentinel,shader
  1. Attach the shader to the model. Its own textures stay in place.
  2. Choose a RimColor that separates the subject from the background.
  3. Keep Strength around 1 for ordinary gameplay. Values of 2 or 3 deliberately turn the model into something glowing and unnatural.
  4. Raise RimPower for a thinner, tighter edge; lower it for a broad soft glow.
  5. The glow stays inside the model's silhouette. If you want light to spill past the edge, add Bloom.
ControlWhat 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.
TextureOptional texture override.

In the sample: the brackets change Strength, starting at 1.4 (range 0 to 3).

How it works

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.

Back to the effect list

Dissolve

builtin:dissolve · Surface effect, attach with EntityShader · Sample 04_dissolve.bb

Dissolve switched on: recall chamber
04 / Recall chamber. A cut-out consumes the sentinel and its shadow, leaving an orange energy frontier.
Show the same scene with Dissolve switched off
Dissolve switched off
Switched off, the sentinel and its shadow are complete.

Summary

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.

How to use it

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
  1. Attach the shader when the effect should begin, then raise Amount a little every frame. At 0 the model is intact; at 1 it has gone, and you can hide or free the entity.
  2. 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.
  3. The pattern is read through the model's UVs, so a model with good UVs dissolves cleanly. If the mesh has no texture of its own and you bind only a noise map, bind a white Texture too so the colour does not vanish.
  4. With HDR rendering and Bloom, the edge glows.
  5. Only pixels are removed. Collision and picking continue until you disable them.
ControlWhat 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.
NoiseMapOptional greyscale pattern that controls where holes appear first.
TextureOptional base texture override.

In the sample: the brackets change Amount, starting at .46 (range 0 to 1).

How it works

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.

Back to the effect list

Foliage

builtin:foliage · Surface effect, attach with EntityShader · Sample 05_foliage.bb

Foliage switched on: fern conservatory
05 / Fern conservatory. Cut-out fronds and their perforated shadows sway while the weighted roots stay fixed.
Show the same scene with the wind turned down to zero
Foliage with no wind
The same material with wind strength at zero; the fronds hang still.

Summary

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.

How to use it

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
  1. Prepare the mesh. Subdivide long leaves so they can bend, and paint vertex alpha as a flexibility mask: 1 at the roots (anchored) fading to 0 at the tips (free to move). Do this in your modelling tool, or with VertexAlpha when building meshes in code.
  2. Load the leaf texture with alpha (flag 2) so its transparent areas become holes. A flat normal map is fine for shaped leaves.
  3. Set 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.
  4. Tune the wind. 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.
ControlWhat 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).

How it works

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.

Back to the effect list

Fur

builtin:fur · Surface effect · Sample 45_fur.bb and gallery 18_Fur.bb

Animated plush bears with a short fur coat and a smooth comparison
An original articulated plush model, captured with TAA. Fur is applied to its coat surfaces; the eyes, nose and suede pads retain separate materials.
Compare with the smooth base
The same plush scene with the coat disabled
ShellCount zero retains the supporting surface and removes the outer coat.

Summary

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.

How to use it

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.

How it works

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.

Triplanar

builtin:triplanar · Surface effect, attach with EntityShader · Sample 06_triplanar.bb

Triplanar switched on: moss-cut quarry
06 / Moss-cut quarry. World-space rock strata wrap an irregular cliff; upward faces receive a moss map.
Show the same scene with Triplanar switched off
Triplanar switched off
Switched off, the cliff falls back to its ordinary material.

Summary

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.

How to use it

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
  1. Use seamless (tileable) textures for both the side and the top.
  2. Scale is the number of texture repeats per world unit, so a larger number gives smaller features.
  3. 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.
  4. Reserve it for static scenery. The mapping is fixed in world space, so a moving object slides through its own texture.
ControlWhat it does
SideTexture, TopTextureTextures 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).

How it works

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.

Back to the effect list

Parallax

builtin:parallax · Surface effect, attach with EntityShader · Sample 07_parallax.bb

Parallax switched on: sunken mosaic court
07 / Sunken mosaic court. Look obliquely across the masonry: joints recess without adding geometry.
Show the same scene with the relief turned down to zero
Parallax with no relief
The same material with height scale at zero; the floor is visibly flat.

Summary

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.

How to use it

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
  1. You need three textures: colour, normal map and height map. In the height map, white is the deepest recess and black sits at the surface. If your bricks look raised instead of the joints looking sunken, invert the height map.
  2. Keep 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.
  3. More steps give smoother relief with fewer layer artefacts, at the cost of extra texture reads. Raise MaximumSteps if you see stair-stepping at grazing angles.
  4. The relief casts no shadows and does not change collision or the mesh silhouette.
ControlWhat 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).

How it works

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.

Back to the effect list

Hologram

builtin:hologram · Surface effect, attach with EntityShader · Sample 08_hologram.bb

Hologram switched on: courier flight plan
08 / Courier flight plan. A translucent craft schematic scans above its projection dais.
Show the same scene with Hologram switched off
Hologram switched off
The projected craft is transparent, so it disappears entirely when the effect is off.

Summary

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.

How to use it

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
  1. Attach the shader to the model you want projected.
  2. Start with low Flicker and Noise and a moderate Opacity. Too much noise hides the shape you are trying to show.
  3. A dark backdrop and a separate projector base under the model sell the effect.
  4. The hologram does not write depth or cast shadows, so overlapping parts simply blend together. Simple models read best.
  5. The scan animation runs on the shader clock, so it keeps moving even when your game logic is paused.
ControlWhat 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).

How it works

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.

Back to the effect list

Wet Surface

builtin:wet-surface · Surface effect, attach with EntityShader · Sample 09_wet_surface.bb

Wet Surface switched on: after the rain
09 / After the rain. Dark cobbles, roughness changes and ripples collect in authored puddle patches.
Show the same scene with the wetness turned down to zero
Wet Surface with no wetness
The same material dry: lighter, matt and without ripples.

Summary

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.

How to use it

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
  1. Supply a base texture, a normal map and a puddle map. The puddle map is a greyscale image: bright areas become puddles.
  2. Wetness is the overall amount, from 0 (dry) to 1. Raise it over a few seconds as rain begins.
  3. 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.
  4. Place lights so that a highlight can travel across the surface as the camera or the light moves. Darkening on its own is a poor demonstration of wetness.
ControlWhat 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).

How it works

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.

Back to the effect list

Snow

builtin:snow · Surface effect, attach with EntityShader · Sample 10_snow.bb

Snow switched on: winter watch
10 / Winter watch. Snow settles on the upward-facing shoulders of a ruined mountain checkpoint.
Show the same scene with the coverage turned down to zero
Snow with no coverage
The same material with coverage at zero: bare stone.

Summary

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.

How to use it

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
  1. Attach the shader and bind the object's base texture.
  2. Coverage runs from 0 (none) to 1 (full). Animate it for a snowfall; 0 clears the overlay completely.
  3. Use SlopeSharpness and HeightBlend to keep vertical walls mostly clear and to widen or narrow the transition.
  4. Direction defaults to straight up. Tilt it for wind-blown drifts on one side of objects.
  5. Sparkle is an emissive glint; keep it low or the snow looks like glitter.
  6. Roofs, rocks and statues show the effect far better than a single flat ground plane, which simply turns white.
ControlWhat 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).

How it works

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.

Back to the effect list

Water

builtin:water · Surface effect, attach with EntityShader · Sample 11_water.bb

Water switched on: the drowned gate
11 / The drowned gate. A shallow shore, submerged stones and deep basin expose foam and depth-dependent colour.
Show the same scene with Water switched off
Water switched off
The water plane is transparent, so it disappears entirely when the effect is off.

Summary

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).

How to use it

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
  1. Build a flat, horizontal mesh at the water level and put the real ground, rocks and props below it. The ground must never sit at the same height as the surface.
  2. Bind two wave normal maps. Using the same texture twice is fine; the shader scrolls them in different directions.
  3. Set the shallow and deep colours, and DepthFade for how quickly (in scene units) the deep colour takes over.
  4. Foam appears where objects pierce the surface; FoamWidth and FoamStrength tune it. Give the basin real depth and put stones through the surface to see it.
  5. 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.
  6. Only opaque scenery is seen through the water. Clear sky behind it gives no depth colour or foam, and off-screen or transparent objects cannot be refracted.
ControlWhat 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).

How it works

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.

Back to the effect list

Glass

builtin:glass · Surface effect, attach with EntityShader · Sample 12_glass.bb

Glass switched on: glassmaker atelier
12 / Glassmaker atelier. Curved amphorae refract the patterned wall; tinted absorption builds with thickness.
Show the same scene with Glass switched off
Glass switched off
The vessels are transparent, so they disappear entirely when the effect is off.

Summary

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.

How to use it

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
  1. Attach the shader and place something with varied detail behind the glass, or the refraction has nothing to show.
  2. 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.
  3. 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.
  4. AttenuationColor colours the light passing through, and AttenuationDistance sets how quickly that colour builds up with thickness (0 disables absorption).
  5. IOR 1 removes both the bending and the surface reflection. Roughness softens the highlights; it does not blur the background.
ControlWhat 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).

How it works

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.

Back to the effect list

Force Field

builtin:force-field · Surface effect, attach with EntityShader · Sample 13_force_field.bb

Force Field switched on: quarantine gate
13 / Quarantine gate. The curved barrier intersects stonework and the floor, revealing contact and grazing edges.
Show the same scene with Force Field switched off
Force Field switched off
The barrier is transparent, so it disappears entirely when the effect is off.

Summary

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.

How to use 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
  1. Attach the shader to a shell mesh (a dome, wall or sphere) positioned so that it passes through some scenery. The contact band is the best part of the effect.
  2. Set 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.
  3. With HDR rendering and Bloom, raise Emission to make the edges glow.
  4. NoiseStrength and NoiseSpeed add a crawling energy pattern; RimPower sets how tightly the grazing edges glow.
  5. Only solid scenery produces contact bands. Sky, foreground objects and transparent things do not.
ControlWhat 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).

How it works

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.

Back to the effect list

Grayscale

builtin:grayscale · Camera effect, attach with CameraEffect · Sample 14_grayscale.bb

Grayscale switched on: last known location
14 / Last known location. Fade the colour from a busy courtyard for a flashback or defeated-player view.
Show the same scene with Grayscale switched off
Grayscale switched off
Switched off, the courtyard keeps its full colour.

Summary

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.

How to use it

effect=LoadShader("builtin:grayscale")
ShaderFloat effect,"Strength",1
CameraEffect camera,effect
  1. Attach the effect to the camera.
  2. Animate Strength between 0 and 1 for transitions rather than switching it on abruptly.
  3. It affects the whole picture. For a single red object in a grey world you need more than this effect on its own.
  4. Text and images drawn in 2D after RenderWorld keep their colours, because the HUD is composited after camera effects.
ControlWhat 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).

How it works

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.

Back to the effect list

Vignette

builtin:vignette · Camera effect, attach with CameraEffect · Sample 15_vignette.bb

Vignette switched on: relic discovery
15 / Relic discovery. A restrained dark perimeter directs attention to the central waystone.
Show the same scene with Vignette switched off
Vignette switched off
Switched off, the edges of the picture are as bright as the centre.

Summary

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.

How to use it

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
  1. Attach the effect to the camera, preferably last in the stack.
  2. 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.
  3. Strength sets how far the edges go towards Color. For damage feedback, use a red colour and pulse the strength from code.
  4. Strong vignettes hide information at the edges of the screen, such as minimaps and approaching enemies. Keep gameplay vignettes light.
ControlWhat 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).

How it works

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.

Back to the effect list

Bloom

builtin:bloom · Camera effect, attach with CameraEffect · Sample 16_bloom.bb

Bloom switched on: neon charging bay
16 / Neon charging bay. HDR lantern cores spill light into the dark bay while the courier hull stays readable.
Show the same scene with Bloom switched off
Bloom switched off
Switched off, the lantern cores are bright but their light stops at their own edges.

Summary

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.

How to use it

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
  1. Turn on HDRRendering.
  2. Make the things that should glow genuinely bright: give them a Standard material with BrushEmissive and a strength well above 1.
  3. Attach bloom to the camera, before any colour grading.
  4. Tune 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.
  5. A large radius with a high intensity quickly washes the whole scene out. If that happens, lower the intensity before touching anything else.
ControlWhat 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).

How it works

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.

Back to the effect list

LUT grading

builtin:lut-grade · Camera effect, attach with CameraEffect · Sample 17_lut_grade.bb

LUT grading switched on: amber caravan stop
17 / Amber caravan stop. A strip LUT turns a neutral pottery market into a warmer, quieter evening palette.
Show the same scene with LUT grading switched off
LUT grading switched off
Switched off, the market keeps its neutral daytime colours.

Summary

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.

How to use it

effect=LoadShader("builtin:lut-grade")
ShaderTexture effect,"LUT",LoadTexture("evening_lut.png")
ShaderFloat effect,"Strength",1
CameraEffect camera,effect
  1. Start from an identity LUT: a 256 by 16 pixel strip made of sixteen 16 by 16 squares, in which every colour maps to itself. The sample includes one to copy.
  2. Take a screenshot of your game, paste the identity strip onto it in your image editor, and apply your colour adjustments to the whole image.
  3. Crop the adjusted strip back out and save it as an uncompressed PNG. Compression artefacts in a LUT become colour banding in the game.
  4. Bind it as LUT. Strength blends between the original and the graded picture, which is useful for fading between two looks.
  5. 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.
ControlWhat it does
LUTThe 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).

How it works

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.

Back to the effect list

SSAO

builtin:ssao · Camera effect, attach with CameraEffect · Sample 18_ssao.bb

SSAO switched on: pump-room maintenance
18 / Pump-room maintenance. Compare the flange collars, clustered equipment, wall corners and feet on the service platform.
Show the same scene with SSAO switched off
SSAO switched off
Switched off, objects lose the soft shading where they meet the floor and each other.

Summary

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.

How to use it

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
  1. Attach it before fog, depth of field and grading, so it shades the scene rather than the finished picture.
  2. 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.
  3. Strength and Power set how dark the shading gets. If creases turn into black outlines, lower the strength.
  4. Press Space in the sample and watch the flange collars, the shelf against the wall and the robot's feet. Open floor should barely change.
  5. It is not a replacement for shadows. It cannot see hidden or off-screen objects, and thin silhouettes and the edges of the screen remain limitations.
ControlWhat 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).

How it works

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.

Back to the effect list

Depth Fog

builtin:depth-fog · Camera effect, attach with CameraEffect · Sample 19_depth_fog.bb

Depth Fog switched on: the long causeway
19 / The long causeway. Successive archways disappear into distance fog while the foreground stays clear.
Show the same scene with Depth Fog switched off
Depth Fog switched off
Switched off, every archway is equally sharp all the way to the horizon.

Summary

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.

How to use it

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
  1. Attach the effect and set FogColor.
  2. Give the camera background, or your skybox, the same colour. Pixels with nothing behind them are left unchanged, so a mismatched sky shows through as a hard edge.
  3. Density sets how quickly the fog thickens. Start keeps a clear distance in front of the camera.
  4. 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.
  5. Make sure CameraRange reaches far enough for the scene you are fogging.
ControlWhat 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).

How it works

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.

Back to the effect list

Depth of field

builtin:depth-of-field · Camera effect, attach with CameraEffect · Sample 20_depth_of_field.bb

Depth of field switched on: the collector table
20 / The collector table. Focus on the middle amphora; near pottery and the distant arcade fall out of focus.
Show the same scene with Depth of field switched off
Depth of field switched off
Switched off, the near pottery, the amphora and the distant arcade are all equally sharp.

Summary

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.

How to use it

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
  1. Compose the shot before tuning: something near, the subject, and a distant background.
  2. FocusDistance is measured in scene units straight ahead of the camera. To follow a character, set it each frame from EntityDistance.
  3. FocusRange is the band that stays sharp; Aperture sets how quickly blur grows outside it.
  4. Start with MaxBlur around 8, and use Quality 2 for larger radii. Setting MaxBlur to 0, or both strengths to 0, restores a sharp picture.
  5. The clear background is treated as far away, so an empty sky blurs when the focus is close.
ControlWhat 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).

How it works

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.

Back to the effect list

Outline

builtin:outline · Camera effect, attach with CameraEffect · Sample 21_outline.bb

Outline switched on: salvage manual illustration
21 / Salvage manual illustration. Depth and normal edges trace armour seams, tools and the open gateway.
Show the same scene with Outline switched off
Outline switched off
Switched off, the same scene has no ink lines.

Summary

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.

How to use it

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
  1. Attach the effect and choose a line colour.
  2. Thickness is measured in render pixels.
  3. If every small bevel and panel gets a line, raise NormalThreshold. If lines are missing between objects at similar distances, lower DepthThreshold.
  4. Strength fades the lines for a lighter touch.
  5. Lines come only from the geometry. Detail that exists only in a colour texture gets no line, and transparent surfaces generally do not provide the depth and normals the effect needs.
ControlWhat 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).

How it works

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.

Back to the effect list

Sharpen

builtin:sharpen · Camera effect, attach with CameraEffect · Sample 22_sharpen.bb

Sharpen switched on: survey-camera detail
22 / Survey-camera detail. At 70 percent render scale, inspect masonry joints and small mechanical edges.
Show the same scene with Sharpen switched off
Sharpen switched off
Switched off, the upscaled picture is slightly softer on joints and edges.

Summary

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.

How to use it

RenderScale .7
effect=LoadShader("builtin:sharpen")
ShaderFloat effect,"Strength",.7
ShaderFloat effect,"Clamp",.12
CameraEffect camera,effect
  1. Attach it last, after blur, grading and the other finishing effects are settled.
  2. Raise Strength until edges look crisp, then back off a little. Clamp limits how much any one pixel may change, which prevents halos.
  3. Check diagonal edges and bright borders as well as textured surfaces. Too much strength produces halos and makes aliasing and noise more visible.
ControlWhat 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.

How it works

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.

Back to the effect list

Lens

builtin:lens · Camera effect, attach with CameraEffect · Sample 23_lens.bb

Lens switched on: loading-bay security feed
23 / Loading-bay security feed. Grain, curved perspective, scanlines and colour fringing imitate a surveillance lens.
Show the same scene with Lens switched off
Lens switched off
Switched off, the loading bay is a clean, straight render.

Summary

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.

How to use it

effect=LoadShader("builtin:lens")
ShaderFloat effect,"Grain",.055
ShaderFloat effect,"ChromaticAberration",2
ShaderFloat effect,"Distortion",.075
ShaderFloat effect,"Scanlines",.1
CameraEffect camera,effect
  1. Attach the effect at the end of the stack.
  2. Add one ingredient at a time and keep each small. A little of everything reads as a camera; a lot of everything reads as a broken screen.
  3. Positive Distortion bulges the picture outwards; negative pinches it. Check the corners for stretching.
  4. ChromaticAberration is measured in source pixels.
  5. Leave TimeScale above zero for moving grain, or set it to zero for a fixed pattern.
  6. Only the picture changes. Aiming, picking and the camera itself are unaffected.
ControlWhat 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).

How it works

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.

Back to the effect list

Motion Blur

builtin:motion-blur · Camera effect, attach with CameraEffect · Sample 24_motion_blur.bb

Motion Blur switched on: express courier
24 / Express courier. Two couriers share geometry and move in opposite directions; each keeps its own trail.
Show the same scene with Motion Blur switched off
Motion Blur switched off
Switched off, both couriers are frozen sharp in mid-flight.

Summary

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.

How to use it

effect=LoadShader("builtin:motion-blur")
ShaderFloat effect,"ShutterAngle",270
ShaderFloat effect,"MaximumRadius",48
ShaderInt effect,"Quality",2
CameraEffect camera,effect
  1. Attach the effect. Classic materials, Standard materials and terrain already supply the motion information it needs.
  2. 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.
  3. Use CameraWeight and ObjectWeight to favour camera movement or object movement, for example to keep the player's own vehicle sharp.
  4. Judge it at the real frame rate, and test sudden camera cuts. A screenshot shows only one instant of the trail.
  5. Custom raw shaders and transparent objects provide no reliable motion, and background colour can be pulled a little way across a foreground edge. TAA is the best partner for this effect. The sample turns anti-aliasing off so the trails are easy to see.
ControlWhat 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).

How it works

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.

Back to the effect list

SSR

builtin:ssr · Camera effect, attach with CameraEffect · Sample 25_ssr.bb

SSR switched on: polished transit hall
25 / Polished transit hall. The floor catches the on-screen sentinel and lamps; misses retain the environment lighting.
Show the same scene with SSR switched off
SSR switched off
Switched off, the floor shows only its generic environment reflection.

Summary

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.

How to use it

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
  1. Reflective surfaces need Standard materials with low roughness. Rough surfaces fade the reflection out, as RoughnessFade intends.
  2. Give those materials an environment map. Where SSR finds nothing, the material's own environment lighting shows instead, so the floor never goes black.
  3. Attach the effect early in the stack, before fog. MaxDistance is how far a reflection ray travels, in scene units; EdgeFade softens reflections near the screen edges where they would otherwise cut off.
  4. TemporalWeight smooths the result across frames; 0 disables that history.
  5. Pan the camera until a reflected object leaves the screen and watch its reflection disappear. That is the limitation to design around. This implementation also does not provide accurate rough or metallic-weighted reflections.
ControlWhat 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).

How it works

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.

Back to the effect list

Volumetric Fog

builtin:volumetric-fog · Camera effect, attach with CameraEffect · Sample 26_volumetric_fog.bb

Volumetric Fog switched on: the submerged pump vault
26 / The submerged pump vault. A selected light casts shadows into the haze; other lights and ambient scattering remain independent.
Show the same scene with Volumetric Fog switched off
Volumetric Fog switched off
Switched off, the vault is clear and the light beam is invisible.

Summary

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.

How to use it

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
  1. Set up a shadow-casting light with a clear beam through something that blocks it, such as a doorway or a moving prop. Only the light the engine selects for shadows casts shadows into the fog; the other lights simply brighten it. LightShadows with a high priority makes sure the right one is chosen.
  2. Attach the effect, then set Density and Color.
  3. Use Height and HeightFalloff for fog that lies low, and Distance for how far the effect looks.
  4. Positive Anisotropy makes the haze brighter when you look towards a light, which is how real mist behaves.
  5. 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.
ControlWhat 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.

How it works

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.

Back to the effect list

Light Shafts

builtin:light-shafts · Camera effect, attach with CameraEffect · Sample 27_light_shafts.bb

Light Shafts switched on: light through the arcade
27 / Light through the arcade. A visible bright aperture supplies a radial shaft effect around the stone silhouettes.
Show the same scene with Light Shafts switched off
Light Shafts switched off
Switched off, the bright opening is just a bright opening.

Summary

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.

How to use 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
  1. Give the scene a genuinely bright, visible source: an emissive quad, a bright sky through an arch, a glowing doorway.
  2. Attach the effect and update Source every frame from the source's screen position. The values are fractions of the screen, from 0 to 1.
  3. 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.
  4. Any other bright object on screen will streak as well, so keep the composition simple.
  5. When the source leaves the screen, fade Exposure down or disable the effect with CameraEffectEnabled.
ControlWhat 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).

How it works

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.

Back to the effect list

Colour adjustment

builtin:color-adjust · Camera effect, attach with CameraEffect · Sample 28_color_adjust.bb

Colour adjustment switched on: red-alert supply yard
28 / Red-alert supply yard. Exposure, contrast and saturation give an immediate mood change without a LUT asset.
Show the same scene with Colour adjustment switched off
Colour adjustment switched off
Switched off, the supply yard has its ordinary neutral colours.

Summary

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.

How to use it

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
  1. Attach the effect near the end of the stack, after bloom.
  2. The neutral settings are 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.
  3. Animate the values from code for alerts, timers and transitions.
  4. This effect works on the picture after tone mapping. If you want to brighten a scene while keeping its HDR highlights intact, change ToneMapExposure instead.
ControlWhat 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).

How it works

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.

Back to the effect list

Soft Particle

builtin:soft-particle · Surface effect, attach with EntityShader · Development preview · Sample 38_soft_particles.bb

Soft Particle switched on: pressure relief
38 / Pressure relief. Steam crosses the pump housing, floor and grate. Pause, then compare the same particles.
Show the same scene with Soft Particle switched off
Soft Particle switched off
The steam is transparent, so it disappears entirely when the effect is off. In the running sample, Space keeps the same particles and removes only the softening.

Summary

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.

How to use it

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
  1. Set up the emitter exactly as you normally would, with a preset, colours, animation and render mode.
  2. Attach the shader to the emitter with EntityShader. It also works on a sprite made with CreateSprite.
  3. SoftDistance is the width of the contact fade in scene units; 0 disables it. NearFadeDistance fades particles that come too close to the camera.
  4. Alpha and additive blends fade their opacity; a multiply blend fades towards neutral white instead.
  5. Only solid scenery counts as an obstacle. Other smoke, glass and water do not soften the particles.
ControlWhat 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.
BaseTextureOptional 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.

How it works

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.

Back to the effect list

Highlight

EntityHighlight and builtin:highlight · Camera effect, attach with CameraEffect · Development preview · Sample 39_entity_highlight.bb

Highlight switched on: salvage counter
39 / Salvage counter. Pick a salvage prop. The amber outline belongs to the main view; the side camera marks its own target.
Show the same scene with Highlight switched off
Highlight switched off
Switched off, nothing marks the selected prop.

Summary

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.

How to use it

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
  1. Call EntityHighlight on the entity. Pass 1 for children to cover an imported hierarchy, or a camera handle to highlight in one view only.
  2. Only load 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.
  3. Width is 1 to 6 display pixels, independent of RenderScale. Choose a colour that contrasts with the scene, and keep any fill subtle.
  4. Adjacent selected objects merge into one outline. Fully transparent or refractive materials are not supported, and there is no through-wall mode.
ControlWhat 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.

How it works

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.

Back to the effect list

UV flow

builtin:uv-flow · Surface effect, attach with EntityShader · Development preview · Sample 40_uv_flow.bb

UV flow switched on: salvage transfer line
40 / Salvage transfer line. A scrolling conveyor carries recovered parts below a curved energy feed and a cooling cascade.
Show the same scene with the flow turned down to zero
UV flow with no flow
The same materials with directional flow removed; the conveyor's plain texture scrolling continues.

Summary

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.

How to use it

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
  1. Paint a flow map. Its red channel is the flow along the texture's U axis and green along V: mid-grey (127 or 128) is still, brighter values flow positively, darker values negatively. Load it with the clamp flags (16+32) unless it tiles.
  2. Bind the base texture, the flow map and optionally a normal map, then set FlowStrength above zero. The default is 0, which shows no flow at all.
  3. FlowSpeed is cycles per second; negative values reverse the flow.
  4. 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.
  5. Large strengths reveal the two blended copies of the texture. Keep the value moderate and judge it in motion.
ControlWhat 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.

How it works

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.

Back to the effect list

Heat Haze

builtin:heat-haze · Surface effect, attach with EntityShader · Development preview · Sample 41_heat_haze.bb

Heat Haze switched on: engine test bay
41 / Engine test bay. The courier exhaust bends the sign and grille behind it; the foreground safety rail stays straight.
Show the same scene with Heat Haze switched off
Heat Haze switched off
The haze quad is transparent, so it disappears entirely when the effect is off.

Summary

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.

How to use it

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
  1. Create a quad or sprite covering the region of hot air and attach the shader.
  2. 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.
  3. DistortionPixels is the largest shift, in display pixels, up to 32. Opacity, entity alpha and vertex alpha all scale the effect.
  4. Animate the distortion map with TextureScroll; the mask keeps its own transform, so it can stay still. PauseTextureScroll freezes the movement.
  5. SoftDistance fades the haze where the quad meets solid scenery; 0 disables that fade.
  6. Only the solid scene is distorted. Glass, water and other haze behind the quad are not included, and solid objects in front of it stay straight.
ControlWhat 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, MaskTextureOffset 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.

How it works

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.

Back to the effect list

Matcap

builtin:matcap · Surface effect, attach with EntityShader · Development preview · Sample 43_matcap.bb

Matcap switched on: relic inspection studio
43 / Relic inspection studio. Clay and studio-metal matcaps on the bust and carved relic. The small silver relic retains Standard environment lighting.
Show the same scene with Matcap switched off
Matcap switched off
Switched off, the exhibits return to neutral lit materials.

Summary

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.

How to use it

shader=LoadShader("builtin:matcap")
ShaderTexture shader,"MatcapTexture",LoadTexture("matcap_clay.png",1+8+16+32)
ShaderFloat shader,"Intensity",1
EntityShader bust,shader
  1. Obtain a matcap image: a lit sphere on a square canvas, with the top of the image being "up". Many free ones exist. A photograph wrapped around the model is not the same thing. Load it with the clamp flags.
  2. Attach the 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.
  3. Add NormalTexture and NormalStrength if the model needs surface detail; the normal map uses the mesh's own UVs.
  4. Rotate the object or orbit the camera to see the shading move. Fog, entity alpha, vertex alpha and shadow casting still work as usual.
ControlWhat it does
MatcapTextureThe 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.

How it works

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.

Back to the effect list

Planar Reflection

builtin:planar-reflection with CreatePlanarReflection · Surface effect and scene service · Development preview · Sample 44_planar_reflection.bb

Planar Reflection switched on: observatory reflection deck
44 / Observatory reflection deck. The moving courier is behind the camera. M selects mirror, pool or facing mirrors; V compares an opaque SSR reference.
Show the same scene with the capture switched off
Planar Reflection switched off
With the capture disabled, the mirror shows only its fallback colour.

Summary

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.

How to use it

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
  1. Make a flat mesh for the mirror and a pivot that marks its plane. The plane is the pivot's local XZ, with local +Y pointing towards the side the camera looks from. Both must be in the same world as the camera.
  2. Loading the material alone shows only the fallback. CreatePlanarReflection makes the capture and EntityPlanarReflection connects it to the mesh.
  3. 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.
  4. Set FallbackColor, and optionally a panoramic FallbackTexture, for when the capture is disabled or seen from behind.
  5. Water can use the same service: call EntityPlanarReflection on a Water mesh, then tune its Reflection and ReflectionDistortion.
  6. Control the cost with 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.
ControlWhat it does
Strength (1)Reflection weight, 0 to 1.
ColorBase colour and reflection tint.
FresnelPower (0)0 for a constant mirror; higher favours grazing angles.
FallbackColor (128,128,128), FallbackIntensity (1), FallbackTextureWhat 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.

How it works

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.

Back to the effect list

Standard

CreateStandardBrush, BrushPBR and the Brush map commands · Material · Sample 29_standard.bb

Standard material switched on: brass salvage atelier
29 / Brass salvage atelier. Metal, roughness, environment reflections and a tinted Standard glass vessel.
Show the same scene with classic materials
Classic materials
The same brushes returned to classic rendering with BrushStandard off.

Summary

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.

How to use it

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
  1. Create a Standard brush, or convert an ordinary one with BrushStandard.
  2. Set 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.
  3. Add maps as your art provides them: BrushBaseColorMap, BrushNormalMap, BrushMetallicRoughnessMap, BrushOcclusionMap and BrushEmissiveMap.
  4. Bind a 2:1 panorama with BrushEnvironmentMap. It provides the reflections and ambient light that make metal read as metal, and stays available when SSR misses.
  5. For glass, set 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.
CommandWhat it does
BrushPBR brush,metallic,roughnessThe two numbers that define the surface.
BrushEnvironmentMapReflections and ambient light from a panorama.
BrushEmissiveSelf-illumination, and the input for Bloom.
BrushTransmission, BrushVolumeGlass 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.

How it works

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.

Back to the effect list

FXAA

AntiAliasMode 1 · Image quality · Sample 30_fxaa.bb

FXAA switched on: watchtower railings
30 / Watchtower railings. Inspect the slanted brass rails, antennae and small model edges with FXAA on and off.
Show the same scene with anti-aliasing off
Anti-aliasing off
With no anti-aliasing, the slanted rails and antennae show their stair-steps.

Summary

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.

How to use it

AntiAliasMode 1
  1. FXAA is on by default; this line restores it after switching modes.
  2. Judge it on thin rails, diagonals and small model edges at native size.
  3. If the picture feels a little soft, a light touch of Sharpen restores crispness.
  4. Use mode 0 for a completely unfiltered image, for example when benchmarking.

In the sample: there is no numeric control. Space switches FXAA off and on.

How it works

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.

Back to the effect list

TAA

AntiAliasMode 3 · Image quality · Sample 31_taa.bb

TAA switched on: wind garden inspection
31 / Wind garden inspection. TAA stabilises fine moving leaves and thin antennae; move the camera to check history.
Show the same scene with anti-aliasing off
Anti-aliasing off
With no anti-aliasing, the leaves and antennae are jagged, and in motion they shimmer.

Summary

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.

How to use it

AntiAliasMode 3
  1. Switch it on and move the camera: a still screenshot cannot show temporal quality.
  2. Watch the joints and antennae of moving characters for trailing, and check newly revealed surfaces after a camera cut.
  3. Classic materials, Standard, terrain and the built-in surface effects supply the motion information TAA needs. Custom raw shaders and transparent surfaces do not, so those pixels reject the history rather than smearing.
  4. Switching between FXAA, MSAA and TAA at run time is safe; the history simply restarts.

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.

How it works

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.

Back to the effect list

Tone mapping

HDRRendering, ToneMapMode, ToneMapExposure · Image quality · Sample 32_tone_map.bb

Filmic tone mapping: furnace reliquary
32 / Furnace reliquary. Bright coloured emitters show highlight compression and exposure inside a bronze workshop.
Show the same scene with tone mapping off
Tone mapping off
With mode 0 at the same exposure, the bright lantern cores clip to flat white.

Summary

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.

How to use it

HDRRendering True
ToneMapMode 2
ToneMapExposure 0
  1. Turn on HDR rendering. Existing programs stay in the ordinary range until you do.
  2. Choose the curve. Mode 2 is the filmic curve used throughout these samples; mode 0 simply clamps. See ToneMapMode in the command reference for the full list.
  3. ToneMapExposure shifts the exposure in stops before the curve is applied: +1 doubles the brightness, -1 halves it.
  4. Tune exposure and the curve before you add display-stage colour adjustments, and judge highlights in the scene rather than from a colour swatch.
  5. This is not bloom. Tone mapping stays inside each object's silhouette; the glow beyond it comes from the bloom effect.

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.

How it works

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.

Back to the effect list

Terrain

TerrainLayer, TerrainSplatMap, TerrainNormalMap · Material · Sample 33_terrain.bb

Terrain layers switched on: moss-road expedition
33 / Moss-road expedition. Four terrain layers blend across a sculpted pass, with a courier camp and stone waymarkers.
Show the same scene with the splat map removed
Terrain without splat map
Without the splat map only the base layer shows, tiled across the whole pass.

Summary

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.

How to use it

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
  1. Create or load a terrain as usual, then assign up to four layers. The last number of TerrainLayer is how many times the texture repeats per grid unit.
  2. Paint a splat map: one image stretched over the whole terrain whose red, green, blue and alpha channels are the weights of layers 0 to 3. Layer 0 also shows wherever every weight is zero. Load it with alpha (flag 2) so the fourth layer works.
  3. Add a tiling normal map for close-up detail, with its own repeat and strength.
  4. 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.
CommandWhat it does
TerrainLayer terrain,layer,texture,scaleOne of four tiled ground textures.
TerrainSplatMap terrain,textureWhich layer shows where.
TerrainNormalMap terrain,texture,scale,strengthShared close-up bump detail.
TerrainLayerColorTint 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.

How it works

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.

Back to the effect list

Skybox

CreateSkyBox, SkyBoxIntensity · Scene backdrop · Sample 34_skybox.bb

Skybox switched on: last light at the ridge
34 / Last light at the ridge. A panoramic sky surrounds the ridge and stays distant while the camera moves.
Show the same scene with the skybox hidden
Skybox hidden
With the skybox hidden, the ridge sits against the plain camera background.

Summary

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.

How to use it

skyTexture=LoadTexture("ridge_sky.jpg",1+8+32)
sky=CreateSkyBox(skyTexture)
SkyBoxIntensity sky,1
  1. Use a seamless 2:1 equirectangular panorama, the same kind of image used for BrushEnvironmentMap.
  2. Lower SkyBoxIntensity towards 0 for evening and night, or fade it over time for a day cycle. RotateEntity on the skybox drifts the sky.
  3. Move the camera: nearby rocks should move while the horizon stays put.
  4. A skybox is only a backdrop. It does not light Standard materials or give them reflections; bind the same panorama to those brushes with BrushEnvironmentMap separately.
CommandWhat it does
CreateSkyBox(texture)Creates the sky from a panorama.
SkyBoxIntensity sky,valueDisplay brightness of the sky.
SkyBoxTextureSwaps the panorama.

In the sample: the brackets change the sky intensity, starting at 1 (range .1 to 2). Space hides and shows the skybox.

How it works

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.

Back to the effect list

Decal

CreateDecal, DecalSize, AlignDecal · Scene service · Sample 35_decal.bb

Decals switched on: reclaimed landing pad
35 / Reclaimed landing pad. Projected landing marks cross the courtyard and machinery; opacity fades all three marks.
Show the same scene with the decals hidden
Decals hidden
With the decals hidden, the courtyard and machinery are unmarked.

Summary

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.

How to use 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()
  1. Create the decal from a texture with alpha, so only the mark itself shows.
  2. 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.
  3. 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.
  4. Fade a decal out with EntityAlpha, and use EntityReceivesDecals to stop a particular prop, such as a character, from being marked.
CommandWhat it does
CreateDecal(texture)Creates a decal entity.
DecalSize decal,width,height,depthSize of the mark and reach of the projection.
AlignDecal decal,x,y,z,nx,ny,nz,rollSits the decal on a surface point.
EntityReceivesDecalsExcludes 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.

How it works

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.

Back to the effect list

MSAA depth resolve

AntiAliasMode 2 · Image quality · Sample 36_msaa_depth.bb

MSAA switched on: mist-gate edges
36 / Mist-gate edges. Four-sample depth resolve keeps fog aligned with the thin railings and curved arch edges.
Show the same scene with anti-aliasing off
Anti-aliasing off
With no anti-aliasing and the same depth fog, the rails and arch edges are jagged.

Summary

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.

How to use it

AntiAliasMode 2

fog=LoadShader("builtin:depth-fog")
ShaderFloat fog,"Density",.035
ShaderColor fog,"FogColor",140,172,186
CameraEffect camera,fog
  1. Select 4x MSAA. On hardware that does not support it, the renderer falls back to FXAA.
  2. Attach depth-based camera effects as usual. The depth resolve happens automatically.
  3. Some effects need other auxiliary buffers as well and may change which anti-aliasing path is available. Check the exact combination your game uses, and read 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.

How it works

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.

Back to the effect list

Colour overlay

EntityColorOverlay · Entity operation · Development preview · Sample 37_color_overlay.bb

Colour overlay switched on: repair-bay feedback
37 / Repair-bay feedback. Two robots share their materials. The right one flashes without replacing its paint, metal or normal maps.
Show the same scene with the overlay cleared
Colour overlay cleared
With the overlay cleared, both robots show their ordinary materials.

Summary

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.

How to use it

; 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
  1. Call EntityColorOverlay with the colour, an amount from 0 to 1 and an optional emission. Amount 0 clears the overlay.
  2. Drive the amount from your own timer. There is no built-in animation.
  3. Emission above 0 makes the flash bright enough to feed Bloom when HDR rendering is on.
  4. The command affects the entity's own surfaces. For an imported hierarchy, apply it to each mesh child. Copies made with CopyEntity start with no overlay.
  5. Classic materials, Standard and the compatible built-in effects support it. A custom shader needs the material-operations hook described in the advanced guide.
CommandWhat it does
EntityColorOverlay entity,red,green,blue,amount,emissionBlends 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.

How it works

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.

Back to the effect list

Dither Fade

EntityDitherFade, EntityDitherRange, EntityLODTransition · Entity operation · Development preview · Sample 42_dither_fade.bb

Dither Fade switched on: salvage-yard streaming lane
42 / Salvage-yard streaming lane. Real courier and pump LODs share complementary coverage; the smaller salvage props fade with camera distance.
Show the same scene with hard switching
Hard switching
With dithering off, models switch and vanish abruptly at their distance thresholds.

Summary

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.

How to use it

; 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
  1. For a manual fade, lower the coverage over time and hide or free the entity when it reaches 0.
  2. For streamed props, set a distance band once and let the renderer fade them as the camera moves. The band multiplies any manual coverage.
  3. For levels of detail, register the meshes with AddEntityLOD as usual and add a transition width. Inside the band both meshes are drawn, so keep it narrow.
  4. Apply the commands to mesh children separately in imported hierarchies.
  5. Turn on TAA to smooth the grain. Manual and distance fades work on supported skinned materials too, but automatic LOD still needs static meshes.
CommandWhat it does
EntityDitherFade entity,coverage,seedManual coverage from 1 to 0.
EntityDitherRange entity,near,farAutomatic fade over a camera-distance band.
EntityLODTransition entity,widthCrossfade 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.

How it works

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.

Back to the effect list

Combining effects

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.

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