Skip to content

Commit 4a33c8a

Browse files
authored
fix: Add typegpu/color dependency to stackblitz integration, update 3d fish example (#1133)
1 parent 26d09bc commit 4a33c8a

File tree

4 files changed

+13
-11
lines changed

4 files changed

+13
-11
lines changed

apps/typegpu-docs/src/components/stackblitz/openInStackBlitz.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import StackBlitzSDK from '@stackblitz/sdk';
22
import { parse } from '@std/yaml';
33
import { type } from 'arktype';
4-
import typegpuoNoisePackageJson from '../../../../../packages/typegpu-noise/package.json';
4+
import typegpuColorPackageJson from '../../../../../packages/typegpu-color/package.json';
5+
import typegpuNoisePackageJson from '../../../../../packages/typegpu-noise/package.json';
56
import typegpuPackageJson from '../../../../../packages/typegpu/package.json';
67
import unpluginPackageJson from '../../../../../packages/unplugin-typegpu/package.json';
78
import pnpmWorkspace from '../../../../../pnpm-workspace.yaml?raw';
@@ -89,7 +90,8 @@ ${example.htmlCode}
8990
"wgpu-matrix": "${typegpuDocsPackageJson.dependencies['wgpu-matrix']}",
9091
"@loaders.gl/core": "${typegpuDocsPackageJson.dependencies['@loaders.gl/core']}",
9192
"@loaders.gl/obj": "${typegpuDocsPackageJson.dependencies['@loaders.gl/obj']}",
92-
"@typegpu/noise": "${typegpuoNoisePackageJson.version}"
93+
"@typegpu/noise": "${typegpuNoisePackageJson.version}",
94+
"@typegpu/color": "${typegpuColorPackageJson.version}"
9395
}
9496
}`,
9597
'vite.config.js': `\

apps/typegpu-docs/src/content/examples/rendering/3d-fish/render.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ export const vertexShader = tgpu['~unstable']
2424
let wavedPosition = input.modelPosition;
2525
let wavedNormal = input.modelNormal;
2626
if (currentModelData.applySinWave === 1) {
27-
const wavedResults = applySinWave(
28-
input.instanceIndex,
29-
layout.$.currentTime,
30-
input.modelPosition,
31-
input.modelNormal,
32-
);
27+
const wavedResults = applySinWave({
28+
index: input.instanceIndex,
29+
time: layout.$.currentTime,
30+
position: input.modelPosition,
31+
normal: input.modelNormal,
32+
});
3333
wavedPosition = wavedResults.position;
3434
wavedNormal = wavedResults.normal;
3535
}

apps/typegpu-docs/src/content/examples/rendering/3d-fish/tgsl-helpers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ const ApplySinWaveReturnSchema = d.struct({
2424
});
2525

2626
export const applySinWave = tgpu['~unstable'].fn(
27-
[d.u32, d.u32, d.vec3f, d.vec3f],
27+
{ index: d.u32, time: d.u32, position: d.vec3f, normal: d.vec3f },
2828
ApplySinWaveReturnSchema,
29-
)((index, time, position, normal) => {
29+
)(({ index, time, position, normal }) => {
3030
const a = 60.1;
3131
const b = 0.8;
3232
const c = 10.1;

packages/typegpu-color/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@typegpu/color",
33
"type": "module",
4-
"version": "0.1.0-alpha.1",
4+
"version": "0.0.1",
55
"description": "A set of color helper functions for use in WebGPU/TypeGPU apps.",
66
"exports": {
77
".": "./src/index.ts",

0 commit comments

Comments
 (0)