@absulit/points
Version:
A Generative Art library made in WebGPU
23 lines (16 loc) • 515 B
JavaScript
import { texture } from '../../image.js';
import { rand } from '../../random.js';
import { snoise } from './../../noise2d.js';
const frag = /*wgsl*/`
${texture}
${rand}
${snoise}
fn main(in: FragmentIn) -> vec4f {
let imageColor = texture(renderpass_feedbackTexture, renderpass_feedbackSampler, in.uvr, true);
rand_seed = in.uvr + params.time;
let noise = rand() * .5 + .5;
return (imageColor + imageColor * noise) * .5;
}
`;
export default frag;