Three.js effects
Three.js features the engine documents and supports directly: post-processing nodes and render helpers.
On this page
Generated from the engine's capability manifest: 16 functions and 2 classes. Each entry is the exported signature, what it is for, and a working example.
WorldEnvironment
The generated file that composes every lighting stage and prints TN_RENDER_CHAIN naming each one as applied or refused with a reason. It is the game's source, not the framework's — edit it.
class WorldEnvironmentUse it to
- turn a lighting or post-processing effect on or off
- find out why an effect you enabled is not visible
- change how the scene is lit, graded, or tonemapped
- match a reference image's lighting
Example
src/render/postprocessing.ts — edit the preset it passes to WorldEnvironmentGood to know
- Read the TN_RENDER_CHAIN line before assuming a stage ran: it names every stage as applied or dropped, with the reason it was dropped.
- A stage reported
appliedcan still be invisible if its own inputs are wrong — the chain reports whether it built, not whether you can see it. - Appearance belongs here, in generated game source. Nothing in packages/ decides how the scene looks.
bloom
Glow around bright pixels. Already wired as the bloom stage.
bloom(node, strength, radius, threshold)Use it to
- make a bright opening or a lamp glow
- bloom, glare, light spill
Example
src/render/postprocessing.ts — edit the preset it passes to WorldEnvironmentGood to know
- Strength above ~0.3 on an interior washes the mid-tones; the reference-matching band is lower than it looks.
denoise
ThreeNative equivalent for realism-effects denoise.
function denoiseUse it to
- denoise a noisy screen-space pass
Example
denoise(...)Good to know
- Use the running WebGPU renderer and keep appearance choices in template render source.
godrays
Raymarched shafts of light. Already wired as the godRays stage of the render chain; turn it on with godraysEnabled in src/render/postprocessing.ts.
godrays(textureNode, light, shadowMap, params)Use it to
- draw a visible shaft of light through a window or a hole in a roof
- god rays, sun shafts, light beams, crepuscular rays
- make sunlight visible in dusty or misty air indoors
- light a cave or a hall through an opening above
- volumetric lighting without adding cone geometry
Example
src/render/postprocessing.ts — edit the preset it passes to WorldEnvironmentGood to know
- Needs a shadow-casting DirectionalLight passed as
godraysLight, andrenderer.shadowMap.enabled = true— without the shadow map the stage refuses and the whole chain reports it dropped. godraysFlooris what separates beams from fog: it subtracts out-of-beam scatter beforegodraysIntensitymultiplies. Raising intensity with a floor near zero brightens the haze over the whole room instead of the beams.- Do not author cone geometry for beams. A hand-built additive cone draws its own silhouette and reads as a plastic tube; this stage is the supported route.
- Measured band on an interior scene: density 0.7, floor 0.08, intensity 3.0, maxDensity 0.6. Above ~0.8 density the haze stops being confined to the beams and the room fogs.
ao
Ground-truth ambient occlusion. Already wired as the ambientOcclusion stage; turn it on with gtaoEnabled.
ao(scene, camera, resolution, radius, intensity)Use it to
- darken the contact where an object meets the floor
- stop props looking like they float
- ambient occlusion, contact shadows, crevice darkening
Example
src/render/postprocessing.ts — edit the preset it passes to WorldEnvironmentGood to know
- Radius is in metres; a radius sized for a room reads as a smudge on a prop.
motionBlur
ThreeNative equivalent for realism-effects motionBlur.
function motionBlurUse it to
- blur motion using a velocity buffer
Example
motionBlur(...)Good to know
- Use the running WebGPU renderer and keep appearance choices in template render source.
recurrentDenoise
ThreeNative equivalent for realism-effects recurrentDenoise.
function recurrentDenoiseUse it to
- denoise a noisy screen-space pass
Example
recurrentDenoise(...)Good to know
- Use the running WebGPU renderer and keep appearance choices in template render source.
sharpen
ThreeNative equivalent for realism-effects sharpen.
function sharpenUse it to
- make the image sharper
Example
sharpen(...)Good to know
- Use the running WebGPU renderer and keep appearance choices in template render source.
ssaaPass
ThreeNative equivalent for realism-effects ssaaPass.
function ssaaPassUse it to
- anti-alias still and moving scenes
Example
ssaaPass(...)Good to know
- Use the running WebGPU renderer and keep appearance choices in template render source.
ssgi
ThreeNative equivalent for realism-effects ssgi.
function ssgiUse it to
- add screen-space global illumination
Example
ssgi(...)Good to know
- Use the running WebGPU renderer and keep appearance choices in template render source.
ssr
ThreeNative equivalent for realism-effects ssr.
function ssrUse it to
- add screen-space reflections
Example
ssr(...)Good to know
- Use the running WebGPU renderer and keep appearance choices in template render source.
temporalReproject
ThreeNative equivalent for realism-effects temporalReproject.
function temporalReprojectUse it to
- reproject a temporal history
Example
temporalReproject(...)Good to know
- Use the running WebGPU renderer and keep appearance choices in template render source.
traa
ThreeNative equivalent for realism-effects traa.
function traaUse it to
- temporally resolve a moving image
Example
traa(...)Good to know
- Use the running WebGPU renderer and keep appearance choices in template render source.
depth
ThreeNative equivalent for realism-effects depth.
function depthUse it to
- provide depth to screen-space effects
Example
depth(...)Good to know
- Use the running WebGPU renderer and keep appearance choices in template render source.
mrt
ThreeNative equivalent for realism-effects mrt.
function mrtUse it to
- provision velocity, normal, and depth render targets
Example
mrt(...)Good to know
- Use the running WebGPU renderer and keep appearance choices in template render source.
normalView
ThreeNative equivalent for realism-effects normalView.
function normalViewUse it to
- provide normals to screen-space effects
Example
normalView(...)Good to know
- Use the running WebGPU renderer and keep appearance choices in template render source.
velocity
ThreeNative equivalent for realism-effects velocity.
function velocityUse it to
- provide motion vectors to temporal effects
Example
velocity(...)Good to know
- Use the running WebGPU renderer and keep appearance choices in template render source.
VelocityNode
ThreeNative equivalent for realism-effects VelocityNode.
class VelocityNodeUse it to
- provide motion vectors to temporal effects
Example
VelocityNode(...)Good to know
- Use the running WebGPU renderer and keep appearance choices in template render source.