Skip to content
Back to skills

Threejs Knowledge Patch

ASecurity

three.js

  • 25 stars
  • 0 votes
  • 1 copy
  • 19 views
  • Added September 5, 2026
developmentgonodeexpressdebuggingapibackend

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 8 files and shows the line behind each finding

Scanned December 1, 2026

npx -y skills add Nevaberry/nevaberry-plugins --skill threejs-knowledge-patch --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Threejs Knowledge Patch?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Threejs Knowledge Patch
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/nevaberry-threejs-knowledge-patch-nevaberry-plugins/badge)](https://www.skillsdirectory.com/skills/nevaberry-threejs-knowledge-patch-nevaberry-plugins)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: threejs-knowledge-patch
description: three.js
version: "r187"
license: MIT
metadata:
  author: Nevaberry
---


# three.js compatibility guidance

Load this skill when updating three.js applications or working with renderer
behavior, TSL node graphs, assets, geometry, controls, and post-processing.
Use the quick reference for common migrations and the topic references for
the full conditions, backend distinctions, examples, and version attributions.

## Reference index

| Reference | Topics |
| --- | --- |
| [Migrations and deprecations](references/migrations-and-deprecations.md) | Removed APIs, renamed options, initialization, shader changes, loader and effect migrations |
| [Rendering and WebXR](references/rendering-and-webxr.md) | Output targets, GPU buffers, texture uploads, depth, blending, render bundles, XR |
| [Scene, animation, and geometry](references/scene-animation-and-geometry.md) | Transforms, materials, instances, geometry, lights, environments, baking, HTML textures |
| [TSL and node graphs](references/tsl-and-node-graphs.md) | Types, control flow, contexts, sampling, storage, compute, transpilation, debugging |
| [Assets and interchange](references/assets-and-interchange.md) | Loading, caching, JSON, glTF, USD, MaterialX, images, compressed formats, exporters |
| [Addons, post-processing, and controls](references/addons-postprocessing-and-controls.md) | Effects, reflections, antialiasing, controls, physics, Inspector, editor |

## Breaking changes and deprecations

### Renderer initialization and output

For `WebGPURenderer`, `renderAsync()` and `computeAsync()` are deprecated;
`waitForGPU()` was removed. Await initialization once, then use `render()` or `compute()`.

```js
await renderer.init();
renderer.render(scene, camera);
```

Replace `clearAsync()`, `initTextureAsync()`, and `hasFeatureAsync()` with
`clear()`, `initTexture()`, and `hasFeature()` after initialization.
`renderer.setAnimationLoop()` handles initialization before its callback runs.
Await `renderer.init()` before generating an environment map with the WebGPU
`PMREMGenerator` or calling `loader.detectSupport(renderer)` on a `KTX2Loader`.

| Earlier API | Migration |
| --- | --- |
| WebGPU `colorBufferType` constructor option | `outputBufferType` |
| `renderer.getColorBufferType()` | `renderer.getOutputBufferType()` |
| `PostProcessing` | `RenderPipeline` from `three/webgpu` |
| `WebGLCubeRenderTarget` in WebGPU cube passes | `CubeRenderTarget` |
| `KTX2Loader.detectSupportAsync()` | `detectSupport()` after WebGPU initialization |
| WebGL `reverseDepthBuffer` option | `reversedDepthBuffer` |
| `USE_REVERSEDEPTHBUF`, `USE_LOGDEPTHBUF` | `USE_REVERSED_DEPTH_BUFFER`, `USE_LOGARITHMIC_DEPTH_BUFFER` |

When reversed and logarithmic depth are both enabled, the renderers use
reversed depth and ignore logarithmic depth.
Set `renderer.shadowMap.type = PCFShadowMap` to keep soft PCF shadows:
`PCFSoftShadowMap` was deprecated for `WebGLRenderer` in r182 and removed for `WebGPURenderer` in r186.
The WebGPU `PMREMGenerator` stores results in cube render targets; update custom
environment sampling that expects the packed CubeUV atlas.

### Materials, objects, and timing

| Earlier API or behavior | Migration |
| --- | --- |
| `InstancedPointsNodeMaterial` | `PointsNodeMaterial` |
| Deprecated `MeshGouraudMaterial` | `MeshLambertMaterial` |
| `Line2NodeMaterial` option `useColor` | `vertexColors` |
| `Line2NodeMaterial.lineWidth` | Drop the removed, unused property |
| `LightProbe.fromJSON()` | `ObjectLoader.parse()` |
| Deprecated `Clock` | `Timer`; call `timer.update()` once per frame before `timer.getDelta()` |
| `Controls.connect()` without a target | Pass the DOM element receiving input |
| `CapsuleGeometry` parameter `length` | `height`; use `heightSegments` for the straight section |
| `Source` | `TextureSource` |

`Matrix3.scale()`, `.rotate()`, and `.translate()` are deprecated. To compose
a translation, use `matrix.premultiply(new Matrix3().makeTranslation(x, y))`.
Call `super.dispose()` inside custom `Object3D` disposal overrides.
`BufferGeometryUtils.toTrianglesDrawMode()` changes the input index in place;
clone the geometry when its original index is still needed.
`SimplifyModifier` is asynchronous: use `await modifier.modify(geometry, count)`.
Compare its output if the exact simplified geometry matters.

### TSL and custom shaders

| Earlier API | Migration |
| --- | --- |
| `builder.monitor` | `builder.observer` |
| `node.varying()`, `node.vertexStage()` | `node.toVarying()`, `node.toVertexStage()` |
| Affected `node.label('name')` calls | `node.setName('name')` |
| `premult(color)` | `premultiplyAlpha(color)` |
| `DFGApprox` | `DFGLUT` |
| `nodeObject()` wrappers around `Node` instances | Use the instances directly |
| `PI2` | `TWO_PI` |
| `directionToFaceDirection` | `negateOnBackSide` |
| `directionToColor()`, `colorToDirection()` | `packNormalToRGB()`, `unpackRGBToNormal()` |
| `getProjectionDepth()` | `projectionDepth()` |

Remove uses of the TSL `string`, `arrayBuffer`, and `modInt` exports.
The `scriptable` node and `ScriptableNodeResources` export were removed.
TSL no longer creates missing tangents automatically. Supply the `tangent`
attribute or call `geometry.computeTangents()` on indexed geometry with
positions, normals, and UVs.
Use `positionGeometry` inside `material.positionNode` for original vertices
before internal transforms such as skinning.

### Loading and post-processing migrations

Replace `RGBELoader` with `HDRLoader`, and migrate `.usdz` loads from deprecated
`USDZLoader` to `USDLoader`. `RGBMLoader` was removed; its assets need separate
RGBM decoding or conversion to a supported format.
Read `FileLoader.load()` and `ImageBitmapLoader.load()` results through `onLoad`;
both methods return `undefined`.
Replace `SVGLoader.createShapes(path)` with `path.toShapes()` and
`DRACOExporter.parse()` with `await exporter.parseAsync(object, options)`.
The npm package omits `examples/fonts`; serve application fonts separately.

Replace `TRAAPassNode` with `TRAANode` using the updated temporal antialiasing
example, and replace removed `AnamorphicNode` with `BloomNode` using the
migration example. The references retain those example links where provided.
Configure the removed `SSAAPassNode` properties `clearColor` and `clearAlpha`
through `renderer.setClearColor(color, alpha)`.
For `GTAOPass` external buffers, supply separate depth and normal textures;
packed depth and normals in one texture are unsupported.

## Rendering and material behavior

`renderer.setOutputRenderTarget(target)` directs the final output pass to a
target, including output color conversion and tone mapping. The renderer
disables `autoClear` during that pass; clear its destination explicitly when
it needs to start empty. `RenderPipeline` follows later changes to
`renderer.outputColorSpace` and `renderer.toneMapping`.

`WebGLRenderer` supports `outputBufferType` and `renderer.setEffects()`.
An output effect can declare `needsDepthTexture` to request scene depth.
Canvas viewport and scissor settings apply the renderer's pixel ratio;
use render-target pixel coordinates when a render target is bound.

`SpriteNodeMaterial.transparent` defaults to `true`; set `transparent: false`
for opaque sprites. Enable `material.transparent` for normal alpha blending
with opacity in `WebGPURenderer`. Set `material.premultipliedAlpha = true`
with `MultiplyBlending` or `SubtractiveBlending`.
If canvas compositing changes, use an opaque background or clear color for
opaque output, or a transparent background or clear alpha for HTML compositing.

Set `material.allowOverride = false` to retain an object's material under
`scene.overrideMaterial`; `Material.copy()` preserves this flag.
`MeshLambertMaterial` and `MeshPhongMaterial` respond to `scene.environment`.
PBR lighting and material changes can alter existing assets' appearance with
the same settings; see the material reference for the affected behavior.

## TSL graph construction and compute

Use `array()` for shader arrays and `struct()` for named, typed struct members.
Use `Const(node)` or `node.toConst()` for read-only shader values and `Var(node)`
for mutable variables. `assign()` applies `toVar()` automatically when needed.
`uniform(true)` creates a boolean uniform. Numeric operators and math functions
can promote mixed types where the operator supports promotion.

Pass a boolean node to `Loop()` for a while loop. TSL supports switch/case,
expression-based loop updates, and explicit `increment()` and `decrement()`.
In chained form, `value.step(edge)` means `step(edge, value)`.
Use `isolate()` to build an expression separately from cached conditional nodes,
and `uniformFlow()` for operations requiring uniform control flow.

Use `.load()` on a `texture()` node for integer-coordinate texel reads.
`texture3DLoad()` reads an unfiltered volume texel; `texture3DLevel()` samples
at an explicit mip level. Storage texture coordinates bypass the UV matrix.
`textureGather` reads one component from four neighbors;
`textureGatherCompare` returns four depth comparison results.

`computeKernel()` separates kernel definition from dispatch size.
Choose either `count` or `dispatchSize`: `WebGPURenderer` throws if both are given.
`atomicLoad()` reads an atomic value; read-modify-write nodes such as
`atomicAdd()` can provide their pre-update value to another expression.
Use `material.maskNode` to discard fragments where a boolean expression is false.
Set `material.shadowPositionNode` explicitly when custom positioning must
apply in the shadow pass; `material.maskShadowNode` controls shadow fragments.

## Resources, assets, and effects

Use texture `updateRanges` and instance-attribute `addUpdateRange()` for partial
updates. Both `WebGPURenderer` backends honor array texture `layerUpdates`; the WebGPU backend
also supports partial compressed-array uploads.
Call `attribute.dispose()` to release WebGPU buffer-attribute resources,
including storage and ordinary attributes. Dispose individual `CanvasTarget`
instances to release their cached resources.
Set `texture.mipmapsAutoUpdate = false` when managing mipmap updates yourself.

Loader cache keys are scoped by loader type. `Cache` skips `Blob` values;
retain blobs in application code for reuse. The `Loader` API exposes `abort()`;
cancellation depends on the loader implementation. Loaders expose request priority and
HTTP cache controls.

`GLTFLoader` supports `KHR_meshopt_compression`; register its meshopt decoder
before loading assets requiring it. `AnimationClip.userData` survives glTF
export and loading. Convert PLY `float64` or `double` attributes to
`Float32BufferAttribute` before rendering.

`SSGINode` adds screen-space indirect lighting and supports resolution scaling.
`FSR1Node` provides spatial upscaling; `TAAUNode` combines temporal antialiasing
and upsampling. `SSRNode` reflections use additive scene-pass composition,
and stochastic reflections support material `F0` and `F90` terms.
`ClusteredLighting` supports spot lights and the WebGL2 fallback backend.
The Inspector Timeline records and exports commands; its Memory tab exposes
memory information, and Settings can enable stack trace capture.

Files in this skill

  • SKILL.md10.4 KB
  • coverage.json1.6 KB
  • references/addons-postprocessing-and-controls.md4.1 KB
  • references/assets-and-interchange.md7.1 KB
  • references/migrations-and-deprecations.md10.1 KB
  • references/rendering-and-webxr.md7.3 KB
  • references/scene-animation-and-geometry.md11.1 KB
  • references/tsl-and-node-graphs.md7.2 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.