惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Cloudbric
Cloudbric
D
Docker
F
Fortinet All Blogs
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Recent Announcements
Recent Announcements
月光博客
月光博客
B
Blog RSS Feed
Help Net Security
Help Net Security
L
LINUX DO - 最新话题
Recorded Future
Recorded Future
Stack Overflow Blog
Stack Overflow Blog
Webroot Blog
Webroot Blog
Y
Y Combinator Blog
N
News and Events Feed by Topic
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
I
InfoQ
Microsoft Azure Blog
Microsoft Azure Blog
Microsoft Security Blog
Microsoft Security Blog
J
Java Code Geeks
美团技术团队
P
Privacy & Cybersecurity Law Blog
H
Help Net Security
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
酷 壳 – CoolShell
酷 壳 – CoolShell
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
博客园 - 聂微东
Scott Helme
Scott Helme
博客园 - 【当耐特】
Apple Machine Learning Research
Apple Machine Learning Research
The Hacker News
The Hacker News
腾讯CDC
H
Hackread – Cybersecurity News, Data Breaches, AI and More
G
GRAHAM CLULEY
S
SegmentFault 最新的问题
爱范儿
爱范儿
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
C
CXSECURITY Database RSS Feed - CXSecurity.com
D
DataBreaches.Net
博客园_首页
V
Vulnerabilities – Threatpost
PCI Perspectives
PCI Perspectives
S
Security @ Cisco Blogs
GbyAI
GbyAI
Schneier on Security
Schneier on Security
The Last Watchdog
The Last Watchdog
The Register - Security
The Register - Security
WordPress大学
WordPress大学
T
Tor Project blog
A
About on SuperTechFans
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org

博客园 - xgqfrms

xgqfrms, cnblogs, blogs xgqfrms, cnblogs, blogs xgqfrms, cnblogs, blogs xgqfrms, cnblogs, blogs xgqfrms, cnblogs, blogs xgqfrms, cnblogs, blogs xgqfrms, cnblogs, blogs xgqfrms, cnblogs, blogs xgqfrms, cnblogs, blogs xgqfrms, cnblogs, blogs xgqfrms, cnblogs, blogs Remotion Video Maker All In One git worktree All In One Tesla 的车机使用什么技术来渲染汽车模型的? 宜家 VEVELSTAD 维维斯托床架 All In One macOS sysmond bug All In One Three.js All In One The COF of LCD Monitor All In One Dell 显示器 S2419HM 灰屏 &花屏 All In One AI Harness Engineering All In One 电脑外接显示器天梯榜 All In One How to change the speed display unit of GSP from mph to km/h using GoPro Labs All In One WHCA 白宫记者协会 All In One Pascal Editor All In One 主流犬种图解指南 All In One 泡沫喷雾 & 辣椒喷雾 All In One 如何给身份证照片添加水印 All In One GoPro MISSION 1 PRO price All In One 杭州历史天气数据 All In One Pandoc All In One GoPro MISSION 1 SERIES All In One GoPro telemetry 中的 GPS5 与 GPS9 是什么 All In One xgqfrms, cnblogs, blogs xgqfrms, cnblogs, blogs xgqfrms, cnblogs, blogs xgqfrms, cnblogs, blogs xgqfrms, cnblogs, blogs xgqfrms, cnblogs, blogs OpenCode All In One OpenClaw 设置 cron 定时任务 All In One free MongoDB Cloud API All In One 如何在 Raspberry Pi 安装 OpenClaw All In One free cloud LLM models API All In One Claude Code Free Video Tutorials All In One 如何解决 OpenClaw 升级后导致 feishu plugin 无法使用的问题 All In One Claude Code skills & plugins All In One LLM Benchmark All In One How to fix use the FileZilla FTP upload file error All In One
xgqfrms, cnblogs, blogs
xgqfrms · 2026-06-17 · via 博客园 - xgqfrms

Three.js Shading Language All In One

TSL / Three.js 着色语言

image

TSL

在 Three.js 中,TSL 是 Three.js Shading Language(Three.js 着色语言)的缩写。它是一种基于节点(Node-based)的高级抽象语言,专门用于在 JavaScript/TypeScript 中编写自定义着色器(Shaders)。

TSL 的核心优势与特性

  1. 统一跨平台输出:
    TSL 是渲染器无关的。你编写的同一套 TSL 代码,会在运行时被自动编译并转译成目标图形 API 所需的代码:
  • 在 WebGL 环境下转译为 GLSL
  • 在 WebGPU 环境下转译为 WGSL
  1. 无需脱机编写 Shader:
    传统的自定义着色器需要将 GLSL 字符串硬编码在 JS 文件中,缺乏代码提示和高亮。
    TSL 让你可以直接在 JS/TypeScript 中书写着色逻辑,享受类型检查自动补全(IntelliSense)等完整的 IDE 支持。
  2. 强大的模块化与组合性:
    它采用节点系统,可以像搭建积木一样,将数学运算、颜色混合、纹理采样等功能模块组合起来
import { meshStandardMaterial, texture, time, vec2 } from 'three/TSL';

// 使用 TSL 节点来计算材质的颜色和缩放
const baseTexture = texture( myTexture );
const animatedTexture = baseTexture.uv.add( vec2( time, 0 ) ); // 让纹理坐标随时间移动

const material = meshStandardMaterial({
    color: animatedTexture // 将节点直接赋值给颜色属性
});


Three.js TSL 教程与示例 - 深入学习着色器语言

https://www.goodtsl.com/zh-CN

https://www.goodtsl.com/en/learnTSL/r3f-quickstart

基于 Node 的用于 Three.js 着色器的编辑器

https://www.tsl-graph.xyz/

demos

OpenGL Shading Language

GLSL / OpenGL 着色语言

https://github.com/KhronosGroup/glsl

GLSL 着色器

https://developer.mozilla.org/en-US/docs/Games/Techniques/3D_on_the_web/GLSL_Shaders

OpenGL ES 2.0 => WebGL

OpenGL ES 3.0 => WebGL 2

https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API

npm package.json exports

https://docs.npmjs.com/cli/v11/configuring-npm/package-json#exports

https://chatgpt.com/c/6a3168a8-41b0-83ea-85cd-4eb9fa99f54f

refs



©xgqfrms 2012-2021

www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!

原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!