Skip to content

Releases: software-mansion/TypeGPU

v0.9.0

22 Dec 20:50

Choose a tag to compare

typegpu 0.9.0, tinyest 0.2.0, tinyest-for-wgsl 0.2.0, @typegpu/* 0.9.0

TypeGPU 0.9.0 brings improvements to compile-time capabilities of JS-shaders, as well as an exciting new integration with Three.js, where any TSL node in a material can be granularly replaced with a TypeGPU function.

🪄 New examples

🚀 Features

📖 Docs / DX

🗿 Bug fixes / Stability

  • fix: Indexing constants with runtime indices should properly adjust by @iwoplaza in #1922
  • fix: Disallow references in arrays by @aleksanderkatan in #1990
  • fix: Fix errors and types around textures by @reczkok in #1950
  • fix: Accessor of static value has unknown type by @lursz in #1964
  • fix: Giving local declarations unique names if they clash with global declarations, and vice-versa + 'strict' the default naming scheme in pipelines by @iwoplaza in #2000
  • chore: Remove 'createDualImpl' by @iwoplaza in #1961
  • test(unplugin-typegpu): Add tests for 'use gpu' marked object method by @cieplypolar in #1894
  • chore: Remove does from entrypoints by @aleksanderkatan in #1997

🧪 Experimental / WIP

Full Changelog: v0.8.2...v0.9.0

v0.8.2

06 Nov 12:50
b754154

Choose a tag to compare

What's Changed

Full Changelog: v0.8.1...v0.8.2

v0.8.1

04 Nov 17:10
4757576

Choose a tag to compare

🗿 Fixes/Stability

📖 Docs/DX

  • fix(docs): Use a more widely supported image source in Jelly Slider number atlas by @reczkok in #1878
  • docs: Soft shadows & bounce lighting in the "Jelly Slider" example by @iwoplaza in #1881

Full Changelog: v0.8.0...v0.8.1

v0.8.0

30 Oct 13:33
5d59c43

Choose a tag to compare

We're excited to release TypeGPU 0.8! Here are the main highlights:

  • console.log on the GPU, a familiar way to debug code execution brought to shaders
  • Simpler and more flexible TypeGPU shader functions (just ‘use gpu’ at the beginning of a function)
  • Overhauled texture APIs (e.g. automatic mip-maps)

You can now install new versions of these packages:

  • typegpu v0.8.0
  • @typegpu/color v0.8.0
  • @typegpu/noise v0.8.0
  • @typegpu/sdf v0.8.0
  • unplugin-typegpu v0.8.0

Migration guide

If you have any uses of the 'kernel'; directive placed at beginning of some functions, you can change it to the 'use gpu'; directive. It functions the same, just with a clearer name.

🚀 Features

🗿 Bug fixes / Stability

📖 Docs/DX

Full Changelog: v0.7.1...v0.8.0

typegpu v0.7.1, @typegpu/color v0.7.0, @typegpu/noise v0.7.0, @typegpu/sdf v0.7.0

18 Aug 12:55

Choose a tag to compare

  • bump: typegpu 0.7.1, @typegpu/color 0.7.0, @typegpu/noise 0.7.0, @typegpu/sdf 0.7.0 by @iwoplaza in #1596

🚀 Features

🗿 Fixes / Stability

📖 Docs / DX

Full Changelog: v0.7.0...v0.7.1

typegpu v0.7.0, unplugin-typegpu v0.2.2

04 Aug 16:47
7ee45d3

Choose a tag to compare

TypeGPU 0.7.0 is full of quality-of-life features that we're excited for you to try out!

Default constructors for schemas

Ever had to construct an initial (zero'ed out) value that matches your custom schema? It's just become extremely simple! You can now call any schema, and in return, you'll receive a zero-initialized value.

const Boid = d.struct({
  pos: d.vec3f,
  vel: d.vec3f,
});

const BoidArray = d.arrayOf(Boid, 4);

const boids = BoidArray(); // ✨
console.log(boids.length); // prints 4
console.log(boids[0].pos.x); // prints 0

🧪 Fluent interface (or infix operators*)

Up until 0.7, adding two vectors together in TGSL was only possible with the std.add function, but now, vectors and matrices have operator methods on them! This way, you can chain operations in a way that's more readable.

// before 0.7.0
std.add(std.mul(v1, 2), v2);
// 0.7.0
v1.mul(2).add(v2);

🧪 Simulating GPU behavior

An experimental API for simulating GPU-behavior on the CPU has been introduced, called "tgpu.simulate". It's useful for unit-testing your shaders, precomputing parts of your pipeline, etc.

import { perlin2d } from '@typegpu/noise';

const { result } = tgpu.simulate(() => {
  // Executed on the CPU, behaves like it's on the GPU
  return perlin2d.sample(d.vec2f(1.1, 2.2));
});

New Online Tool: "Shader Translator"

Curious what optimizations are performed on your shader code before it gets executed? How does TGSL look like when compiled into WGSL? @reczkok has been hard at work on a new tool just for that! Check it out here: https://typegpu.com/translator

image

Changelog

🚀 Features

🗿 Bug fixes / Stability

  • fix: Proper type for .value and .$ in TypeGPU variables by @iwoplaza in #1482
  • fix: Export TgpuQuerySet by @reczkok in #1552
  • fix: Add support for packed vertex formats in compiled writer and improve the writer selection logic by @reczkok in #1560
  • fix: Rework how schemas propagate usage validity by @iwoplaza in #1547
  • fix(unplugin-typegpu): Create proper AST for TypeGPU metadata by @reczkok in #1498
  • fix(unplugin-typegpu): TypeGPU functions using TGSL dependencies declaration order by @aleksanderkatan in #1522
  • fix(unplugin-typegpu): Plugin should parse files with TS syntax support by @iwoplaza in #1516
  • chore: Clarifying purpose of execution modes by @iwoplaza in #1468

📖 Docs / DX

🧪 Experimental APIs

New Contributors

Full Changelog: v0.6.0...v0.7.0

v0.6.0

10 Jul 12:05
cf4b1f7

Choose a tag to compare

🚀 Features

🗿 Bug fixes / Stability

📖 Docs / DX

🧪 Unstable features

Full Changelog: v0.5.9...v0.6.0

v0.5.9

18 Jun 11:49
b4fdc5f

Choose a tag to compare

  • bump: typegpu 0.5.9, typegpu-noise 0.0.9, unplugin-typegpu 0.1.3 by @iwoplaza in #1380

🚀 Features

🗿 Fixes/Stability improvements

📖 Docs/DX

🧪 Experimental APIs

New Contributors

Full Changelog: v0.5.8...v0.5.9

v0.5.8

27 May 16:37
9a75abe

Choose a tag to compare

🚀 Features

🗿 Stability/Fixes

📖 Docs/DX

🧪 Experimental APIs

Full Changelog: v0.5.7...v0.5.8

v0.5.7

14 May 15:11
f54f66c

Choose a tag to compare

What's Changed

🚀 Features

  • feat(typegpu): std.sign by @iwoplaza in #1205
  • feat(typegpu): std.textureLoad, std.textureStore, std.textureDimensions, std.textureSampleLevel by @reczkok in #1181
  • feat(typegpu): std.sqrt, std.div by @reczkok in #1189
  • feat: Allow for...of statement to work with vectors and matrices by @mhawryluk in #1226
  • feat(typegpu/color): Add Oklab color space by @deluksic in #1194
  • feat(typegpu/color): Use accessor for OKLab alpha by @iwoplaza in #1228
  • feat: More partial InferPartial, publicize InferGPU & InferPartial by @iwoplaza in #1215

🗿 Stability/Internals

  • refactor: Using $internal symbol for storing internals in plain sight by @iwoplaza in #1182
  • fix: std.select type signature should accept scalar values by @iwoplaza in #1203
  • refactor: Reuse sign and sqrt in @typegpu/noise by @deluksic in #1212
  • feat: Store labels of objects on globalThis by @aleksanderkatan in #1221

📖 Docs/DX

🧪 Unstable APIs

  • feat: Texture std expansion and generator adjustments by @reczkok in #1189
  • fix: Handle single-line statements in TGSL if/for/while by @mhawryluk in #1224
  • impr: Throw error when trying to define tgpu.derived during resolution by @mhawryluk in #1223
  • impr: Add automatic type conversions when possible by @reczkok in #1136
  • fix: Revert object args fn API in examples (+cleanup), fix boolean literals assigned to variable declarations in TGSL by @iwoplaza in #1229
  • feat(unplugin-typegpu): Support TS as and satisfies in TGSL by @mhawryluk in #1240

Full Changelog: v0.5.6...v0.5.7