Threejs Impl Webgpu logo

Threejs Impl Webgpu

Organization
Impertio-Studio
threejs-impl-webgpu

Use when using the Three.js WebGPU renderer, node-based materials, TSL (Three Shading Language), or compute shaders. Prevents the common mistake of not checking browser support, missing async init, or using GLSL with WebGPU. Covers WebGPURenderer, node materials, TSL, compute shaders, WebGL fallback, migration guide. Keywords: WebGPU, WebGPURenderer, TSL, Three Shading Language, node material, compute shader, WGSL, MeshStandardNodeMaterial, next-gen rendering, modern GPU, WebGPU setup.

Overview

PublisherImpertio-Studio
RepositoryThree.js-Claude-Skill-Package
Skill namethreejs-impl-webgpu
Stars
29
Forks
3
Bundled files
3
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 3 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by Impertio-Studio on GitHub. Read the source before you install it.

Installation

Install the Threejs Impl Webgpu AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/Impertio-Studio/Three.js-Claude-Skill-Package/tree/master/skills/source/threejs-impl/threejs-impl-webgpu
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Impertio-Studio/Three.js-Claude-Skill-Package.git /tmp/Three.js-Claude-Skill-Package
mkdir -p .claude/skills
cp -r /tmp/Three.js-Claude-Skill-Package/skills/source/threejs-impl/threejs-impl-webgpu .claude/skills/threejs-impl-webgpu
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Threejs Impl Webgpu in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Threejs Impl Webgpu on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Threejs Impl Webgpu is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

threejs-impl-webgpu

EXPERIMENTAL — The WebGPU renderer and TSL are under active development. API surfaces may change between Three.js releases. Pin your Three.js version.

Quick Reference

WebGPURenderer Setup

javascript
import * as THREE from 'three/webgpu';

const renderer = new THREE.WebGPURenderer({ antialias: true });
await renderer.init(); // MUST await before first render
renderer.setSize(window.innerWidth, window.innerHeight);
renderer.setAnimationLoop(animate);
document.body.appendChild(renderer.domElement);

ALWAYS call await renderer.init() before the first renderer.render() call. ALWAYS use renderer.setAnimationLoop(callback) instead of requestAnimationFrame. NEVER call renderer.render() before init() resolves — this throws a runtime error.

Browser Support

BrowserVersionStatus
Chrome113+Full support
Edge113+Full support
Safari18+Supported
FirefoxExperimentalBehind flag (dom.webgpu.enabled)

Feature Detection and Fallback

javascript
import { WebGPU } from 'three/webgpu';

if (WebGPU.isAvailable()) {
  const renderer = new THREE.WebGPURenderer({ antialias: true });
  await renderer.init();
} else {
  const renderer = new THREE.WebGLRenderer({ antialias: true });
}

ALWAYS check WebGPU.isAvailable() before creating a WebGPURenderer. ALWAYS provide a WebGLRenderer fallback for unsupported browsers.

Critical Warnings

NEVER write raw GLSL or WGSL strings — ALWAYS use TSL functions. WebGPU compiles TSL to WGSL automatically. GLSL is NOT supported by the WebGPU backend.

NEVER use ShaderMaterial with WebGPURenderer — use NodeMaterial with TSL instead.

NEVER use requestAnimationFrame with WebGPURenderer — ALWAYS use renderer.setAnimationLoop().

NEVER use EffectComposer (three/examples) with WebGPURenderer — use the PostProcessing class with TSL nodes instead.


Node Materials

Every classic Three.js material has a node-based equivalent. Classic materials auto-convert when used with WebGPURenderer, but node materials provide full TSL customization.

Material Mapping

Classic MaterialNode Material
MeshBasicMaterialMeshBasicNodeMaterial
MeshStandardMaterialMeshStandardNodeMaterial
MeshPhysicalMaterialMeshPhysicalNodeMaterial
MeshPhongMaterialMeshPhongNodeMaterial
MeshLambertMaterialMeshLambertNodeMaterial
LineBasicMaterialLineBasicNodeMaterial
LineDashedMaterialLineDashedNodeMaterial
PointsMaterialPointsNodeMaterial
SpriteMaterialSpriteNodeMaterial

ALWAYS import node materials from 'three/webgpu', not from 'three'.

NodeMaterial Input Properties

All properties accept TSL node values. All are optional and override defaults.

Common inputs (all node materials):

PropertyTSL TypePurpose
.colorNodevec4Base color
.opacityNodefloatOpacity
.normalNodevec3Normal map replacement
.emissiveNodecolorEmissive output
.positionNodevec3Vertex displacement
.fragmentNodevec4Full fragment shader replacement
.vertexNodevec4Full vertex shader replacement
.outputNodevec4Final output override
.aoNodefloatAmbient occlusion
.alphaTestNodefloatAlpha test threshold
.depthNodefloatCustom depth
.castShadowNodevec4Shadow casting override

Standard/Physical inputs:

PropertyTSL TypePurpose
.metalnessNodefloatMetalness
.roughnessNodefloatRoughness
.envNodecolorEnvironment map
.lightsNode—Lighting model override

Physical-only inputs: .clearcoatNode, .clearcoatRoughnessNode, .clearcoatNormalNode, .sheenNode, .iridescenceNode, .iridescenceIORNode, .iridescenceThicknessNode, .specularIntensityNode, .specularColorNode, .iorNode, .transmissionNode, .thicknessNode, .attenuationDistanceNode, .attenuationColorNode, .dispersionNode, .anisotropyNode.


TSL (Three Shading Language)

TSL is a JavaScript-based node graph system that compiles to GLSL (WebGL2) and WGSL (WebGPU). It replaces raw shader strings entirely.

Type System

CategoryFunctions
Scalarsfloat(), int(), uint(), bool()
Vectorsvec2(), vec3(), vec4(), ivec2(), ivec3(), ivec4(), uvec2(), uvec3(), uvec4()
Matricesmat2(), mat3(), mat4()
Colorcolor()
Conversion.toFloat(), .toVec3(), .toColor()

Variables and Uniforms

FunctionPurpose
uniform(value)GPU-side dynamic value
toVar(node)Reusable shader variable
toConst(node)Inline constant
varying(node)Vertex-to-fragment interpolation
vertexStage(node)Force computation in vertex shader
attribute(name, type)Access buffer attributes

Uniforms support callbacks: .onRenderUpdate(fn), .onFrameUpdate(fn), .onObjectUpdate(fn).

Operators

All operators are chainable on TSL nodes:

  • Arithmetic: .add(), .sub(), .mul(), .div(), .mod()
  • Comparison: .equal(), .notEqual(), .lessThan(), .greaterThan(), .lessThanEqual(), .greaterThanEqual()
  • Logical: .and(), .or(), .not(), .xor()
  • Assignment: .assign(), .addAssign(), .subAssign(), .mulAssign(), .divAssign()
  • Bitwise: .bitAnd(), .bitOr(), .bitXor(), .shiftLeft(), .shiftRight()

Geometry Nodes

CategoryNodes
PositionpositionGeometry, positionLocal, positionWorld, positionView, positionWorldDirection, positionViewDirection
NormalnormalGeometry, normalLocal, normalView, normalWorld
TangenttangentGeometry, tangentLocal, tangentView, tangentWorld
UVuv(index)
ScreenscreenUV, screenCoordinate, screenSize
ViewportviewportUV, viewportCoordinate, viewportSize

Camera and Model Nodes

  • Camera: cameraNear, cameraFar, cameraPosition, cameraProjectionMatrix, cameraViewMatrix, cameraWorldMatrix, cameraNormalMatrix
  • Model: modelViewMatrix, modelNormalMatrix, modelWorldMatrix, modelPosition, modelScale, modelDirection

Animation Nodes

NodePurpose
timeElapsed seconds since start
deltaTimeFrame delta in seconds
oscSine(timer)Sine oscillator (0-1)
oscSquare(timer)Square wave oscillator
oscTriangle(timer)Triangle wave oscillator
oscSawtooth(timer)Sawtooth oscillator

Texture Operations

FunctionPurpose
texture(tex, uv, level)Sample with interpolation
textureLoad(tex, uv, level)Sample without interpolation
textureStore(tex, uv, value)Write to storage texture
textureSize(tex, level)Get texture dimensions
cubeTexture(tex, uvw, level)Sample cube map
triplanarTexture(texX, texY, texZ, scale, position, normal)Triplanar mapping

Control Flow

ALWAYS use capital If — lowercase if is JavaScript, not TSL.

javascript
If(condition, () => {
  // true branch
}).ElseIf(otherCondition, () => {
  // else-if branch
}).Else(() => {
  // false branch
});
  • select(condition, trueVal, falseVal) — ternary operator
  • Loop(count, ({ i }) => { }) — GPU loop, supports Break(), Continue()
  • Switch(value).Case(val, fn).Default(fn) — no fallthrough
  • Discard() — discard fragment
  • Return() — early return

Function Definition

javascript
const myFn = Fn(([param1, param2]) => {
  return param1.add(param2);
});
// Call: myFn(nodeA, nodeB)

Compute Shaders

WebGPU enables general-purpose GPU compute via TSL. Compute shaders are NOT available in WebGL fallback mode.

Setup

javascript
import { compute, storage } from 'three/webgpu';

const computeNode = compute(shaderFn, count, workgroupSize);
await renderer.computeAsync(computeNode);

ALWAYS use await renderer.computeAsync() — compute dispatch is asynchronous.

Storage and Atomics

  • Storage: storage(attribute, type, count), storageTexture(texture)
  • Atomics: atomicAdd(), atomicSub(), atomicMax(), atomicMin(), atomicAnd(), atomicOr(), atomicXor(), atomicStore(), atomicLoad()
  • Barriers: workgroupBarrier(), storageBarrier(), textureBarrier()
  • Built-in IDs: workgroupId, localId, globalId, numWorkgroups, subgroupSize

WebGPU Post-Processing

NEVER use the WebGL EffectComposer with WebGPURenderer. Use the PostProcessing class instead.

javascript
import { PostProcessing } from 'three/webgpu';
import { bloom, renderOutput } from 'three/tsl';

const postProcessing = new PostProcessing(renderer);
const scenePass = renderOutput(scene, camera);
postProcessing.outputNode = bloom(scenePass);

Available Post-Processing Nodes

bloom(), dof(), fxaa(), smaa(), gaussianBlur(), ssr(), ssgi(), ao(), chromaticAberration(), film(), dotScreen(), sobel(), afterImage(), anamorphic(), denoise(), lut3D(), motionBlur(), outline(), rgbShift(), transition(), traa(), renderOutput()

Color Operations

luminance(), saturation(), vibrance(), hue(), posterize(), grayscale(), sepia()

Blend Modes

blendBurn(), blendDodge(), blendOverlay(), blendScreen(), blendColor()


WebGL to WebGPU Migration

StepAction
1Replace import * as THREE from 'three' with import * as THREE from 'three/webgpu'
2Replace new WebGLRenderer() with new WebGPURenderer() and add await renderer.init()
3Replace classic materials with NodeMaterial equivalents (or keep classic — they auto-convert)
4Replace EffectComposer with PostProcessing class and TSL post-processing nodes
5Replace raw GLSL ShaderMaterial with TSL-based NodeMaterial
6Replace requestAnimationFrame with renderer.setAnimationLoop()

ALWAYS make the entry point async when using WebGPURenderer — renderer.init() returns a Promise.


Reference Links

Official Sources

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Threejs Impl Webgpu AI skill do?

Use when using the Three.js WebGPU renderer, node-based materials, TSL (Three Shading Language), or compute shaders. Prevents the common mistake of not checking browser support, missing async init, or using GLSL with WebGPU. Covers WebGPURenderer, node materials, TSL, compute shaders, WebGL fallback, migration guide. Keywords: WebGPU, WebGPURenderer, TSL, Three Shading Language, node material, compute shader, WGSL, MeshStandardNodeMaterial, next-gen rendering, modern GPU, WebGPU setup.

Why use Threejs Impl Webgpu on TypingMind?

Because you install it once and use it with any model. Threejs Impl Webgpu is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Threejs Impl Webgpu in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/Impertio-Studio/Three.js-Claude-Skill-Package/tree/master/skills/source/threejs-impl/threejs-impl-webgpu. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Threejs Impl Webgpu?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Threejs Impl Webgpu?

As many as you like. As long as a model supports skills, you can use Threejs Impl Webgpu with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Threejs Impl Webgpu AI skill free?

Yes. It is published on GitHub by Impertio-Studio under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇