webgpu-threejs-tsl by dgreenheck/webgpu-claude-skill
npx skills add https://github.com/dgreenheck/webgpu-claude-skill --skill webgpu-threejs-tslTSL(Three.js 着色语言)是一种基于节点的着色器抽象,允许你在 JavaScript 中编写 GPU 着色器,而不是使用 GLSL/WGSL 字符串。
import * as THREE from 'three/webgpu';
import { color, time, oscSine } from 'three/tsl';
const renderer = new THREE.WebGPURenderer();
await renderer.init();
const material = new THREE.MeshStandardNodeMaterial();
material.colorNode = color(0xff0000).mul(oscSine(time));
docs/core-concepts.md - 类型、运算符、uniform 变量、控制流docs/materials.md - 节点材质及其所有属性docs/compute-shaders.md - 使用实例化数组进行 GPU 计算docs/post-processing.md - 内置和自定义效果docs/wgsl-integration.md - 自定义 WGSL 函数广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
docs/device-loss.md - 处理 GPU 设备丢失与恢复examples/basic-setup.js - 最小化 WebGPU 项目examples/custom-material.js - 自定义着色器材质examples/particle-system.js - GPU 计算粒子系统examples/post-processing.js - 效果处理管线examples/earth-shader.js - 完整的地球与大气效果templates/webgpu-project.js - 入门项目模板templates/compute-shader.js - 计算着色器模板REFERENCE.md - 快速参考速查表// 始终使用 WebGPU 入口点
import * as THREE from 'three/webgpu';
import { /* TSL 函数 */ } from 'three/tsl';
使用 TSL 节点替换标准材质属性:
material.colorNode = texture(map); // 替代 material.map
material.roughnessNode = float(0.5); // 替代 material.roughness
material.positionNode = displaced; // 顶点位移
TSL 使用方法链进行运算:
// 替代:sin(time * 2.0 + offset) * 0.5 + 0.5
time.mul(2.0).add(offset).sin().mul(0.5).add(0.5)
使用 Fn() 定义可复用的着色器逻辑:
const fresnel = Fn(([power = 2.0]) => {
const nDotV = normalWorld.dot(viewDir).saturate();
return float(1.0).sub(nDotV).pow(power);
});
webgpu_ 开头)每周安装量
179
代码仓库
GitHub 星标数
459
首次出现
2026年1月24日
安全审计
安装于
opencode137
gemini-cli128
codex128
github-copilot116
cursor116
kimi-cli108
TSL (Three.js Shading Language) is a node-based shader abstraction that lets you write GPU shaders in JavaScript instead of GLSL/WGSL strings.
import * as THREE from 'three/webgpu';
import { color, time, oscSine } from 'three/tsl';
const renderer = new THREE.WebGPURenderer();
await renderer.init();
const material = new THREE.MeshStandardNodeMaterial();
material.colorNode = color(0xff0000).mul(oscSine(time));
docs/core-concepts.md - Types, operators, uniforms, control flowdocs/materials.md - Node materials and all propertiesdocs/compute-shaders.md - GPU compute with instanced arraysdocs/post-processing.md - Built-in and custom effectsdocs/wgsl-integration.md - Custom WGSL functionsdocs/device-loss.md - Handling GPU device loss and recoveryexamples/basic-setup.js - Minimal WebGPU projectexamples/custom-material.js - Custom shader materialexamples/particle-system.js - GPU compute particlesexamples/post-processing.js - Effect pipelineexamples/earth-shader.js - Complete Earth with atmospheretemplates/webgpu-project.js - Starter project templatetemplates/compute-shader.js - Compute shader templateREFERENCE.md - Quick reference cheatsheet// Always use the WebGPU entry point
import * as THREE from 'three/webgpu';
import { /* TSL functions */ } from 'three/tsl';
Replace standard material properties with TSL nodes:
material.colorNode = texture(map); // instead of material.map
material.roughnessNode = float(0.5); // instead of material.roughness
material.positionNode = displaced; // vertex displacement
TSL uses method chaining for operations:
// Instead of: sin(time * 2.0 + offset) * 0.5 + 0.5
time.mul(2.0).add(offset).sin().mul(0.5).add(0.5)
Use Fn() for reusable shader logic:
const fresnel = Fn(([power = 2.0]) => {
const nDotV = normalWorld.dot(viewDir).saturate();
return float(1.0).sub(nDotV).pow(power);
});
webgpu_)Weekly Installs
179
Repository
GitHub Stars
459
First Seen
Jan 24, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode137
gemini-cli128
codex128
github-copilot116
cursor116
kimi-cli108
Genkit JS 开发指南:AI 应用构建、错误排查与最佳实践
7,700 周安装
Rust元认知并行分析工具 - 三层并行认知分析解决编程问题
508 周安装
跨越鸿沟框架:颠覆性技术产品从早期采用者到主流市场的营销策略指南
550 周安装
Chrome DevTools 自动化脚本:Puppeteer 浏览器自动化与性能监控工具
523 周安装
Overlastic:支持React、Vue、Svelte的Promise模态框库,实现弹窗管理
524 周安装
Obsidian Agent Skill - 知识管理与笔记工具集成,提升AI助手工作效率
72 周安装
btca-cli:源码优先的AI研究工具,将Git、本地和npm资源转化为可搜索上下文
525 周安装