A set of noise/pseudo-random functions for use in WebGPU/TypeGPU apps.
import { randf } from '@typegpu/noise';
const time = root.createUniform(f32);
const mainFrag = tgpu
.fragmentFn({
in: { pos: builtin.position },
out: vec4f,
})((input) => {
randf.seed2(add(input.pos.xy, vec2f(time.$)));
const val = randf.sample(); // => number
const normal = randf.onUnitSphere(); // => v3f
const dir = randf.inUnitCircle(); // => v2f
});Since 2012 Software Mansion is a software agency with experience in building web and mobile apps. We are Core React Native Contributors and experts in dealing with all kinds of React Native issues. We can help you build your next dream product – Hire us.