Open
Description
import tgpu from 'typegpu';
import { perlin3d } from '@typegpu/noise';
const root = tgpu.initFromDevice({ device });
const cache = perlin3d.staticCache({ root, size: d.vec3u(10, 10, 1) });
const { code, layouts, catchall } = tgpu.superResolve({
template: `
fn main() {
let value = perlin3d.sample(vec3f(0.5, 0., 0.));
let wrappedValue = perlin3d.sample(vec3f(10.5, 0., 0.)); // the same as 'value'!
// ...
}
// ...
`,
externals: { perlin3d },
});