Trên GitHub, verekia/tslfx đã đạt 114 sao, ngôn ngữ TypeScript. ✨ TSLFX • Early-stage collection of VFX, utils, and SDFs for Three.js Shading Language (TSL)
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
Early-stage collection of VFX shaders, utils, and SDFs for Three.js Shading Language (TSL).
The effects work with the WebGPU renderer and its WebGL backend fallback. To set up your project with WebGPURenderer, check out this repo. The examples use React Three Fiber but the shaders can be used with vanilla Three.js or any other wrapper.
Getting started
Vanilla Three.js
import { MeshBasicNodeMaterial } from 'three/webgpu'
import { impact } from 'tslfx'
const { uniforms, nodes } = impact()
const material = new MeshBasicNodeMaterial()
material.colorNode = nodes.colorNode
const animate = (delta: number) => {
// Update uniforms in your animation loop
uniforms.time.value += delta
}
React Three Fiber v9 RC
Somewhere top-level in your project, extend MeshBasicNodeMaterial and declare its type:
import { extend, type ThreeElement } from '@react-three/fiber'
import { MeshBasicNodeMaterial } from 'three/webgpu'
extend({ MeshBasicNodeMaterial })
declare module '@react-three/fiber' {
interface ThreeElements {
meshBasicNodeMaterial: ThreeElement<typeof MeshBasicNodeMaterial>
}
}
[!TIP]
I like to put these in an extend.ts file that I import in my main entry file (_app.tsx in Next.js for example).
You can then use meshBasicNodeMaterial in your scene:
[!CAUTION]
You should memoize any TSL logic to not re-create nodes on every render.
Primitives and compositions
Primitives are basic single effects. You can combine them together to create more complex effects, which I am calling "compositions" in this library. There is no API to combine them yet, but check out the code of the examples to see how it works.
SDFs
Some Signed Distance Functions (SDFs) ported from Inigo Quilez's website are included in the library:
The Timing example shows how to combine multiple effects triggered at different times over a given duration, with delays and durations per effect.
All the effects have a normalized time uniform and a duration of 1, and their timing is relative to the whole animation, making it easier to tweak them all at once and create slow-motion or speed-up effects.
Utils
pipe
TSL functions that take 2 nodes as arguments can be piped together into a single expression without introducing extra variables or reassignments:
import { blendAlpha, pipe } from 'tslfx'
// Simple layering of 3 effects on top of each other
const colorNode = pipe(blendAlpha, effectA.colorNode, effectB.colorNode, effectC.colorNode)
pipe is really just a more readable .reduce() of the arguments, nothing fancy.
blendAlpha
blendAlpha blends two colors together using the alpha channel of the second color.
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/verekia/tslfx là nguồn chính thức.
verekia/tslfx có bao nhiêu sao?
verekia/tslfx có 114 sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/verekia/tslfx. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
verekia/tslfx có phải mã nguồn mở không?
Có — verekia/tslfx phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/verekia/tslfx.
verekia/tslfx còn đang phát triển không?
Commit gần nhất trên verekia/tslfx là 7 ngày trước (theo timestamp GitHub). Repo có 3 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
verekia/tslfx dùng license gì?
verekia/tslfx phát hành theo license MIT. Nên mở file LICENSE trên GitHub để xác nhận — license metadata đôi khi lệch với thực tế dự án.
verekia/tslfx là gì?
verekia/tslfx (verekia/tslfx) là dự án TypeScript trên GitHub. Theo mô tả gốc: ✨ TSLFX • Early-stage collection of VFX, utils, and SDFs for Three.js Shading Language (TSL)
verekia/tslfx viết bằng ngôn ngữ gì?
verekia/tslfx chủ yếu viết bằng TypeScript. Trường "language" của GitHub dựa trên phần lớn byte ở nhánh mặc định.
Đọc đầy đủ README ở tab phía trên.
Vẫn đang phân vân về tslfx?
Một cú bấm sẽ gửi câu hỏi kèm trang này cho AI — xem AI nói gì về tslfx.