@absulit/points
Version:
A Generative Art library made in WebGPU
40 lines (34 loc) • 861 B
JavaScript
/**
* The defaultStructs are structs already incorporated onto the shaders you create,
* so you can call them without import.
* <br>
* Fragment, Sound, and Event structs.
* <br>
* <br>
* Fragment used in Vertex Shaders.<br>
* Sound used along with {@link Points#setAudio}<br>
* Event used along with {@link Points#addEventListener}<br>
* @module defaultStructs
*/
const defaultStructs = /*wgsl*/`
struct Fragment {
position: vec4f,
color: vec4f,
uv: vec2f,
ratio: vec2f,
uvr: vec2f,
mouse: vec2f
}
struct Sound {
data: array<f32, 2048>,
//play
//dataLength
//duration
//currentPosition
}
struct Event {
updated: u32,
data: array<f32>
}
`;
export default defaultStructs;