gpu-curtains
Version:
gpu-curtains is a 3D WebGPU rendering engine. It can be used as a standalone 3D engine, but also includes extra classes focused on mapping 3d objects to DOM elements; It allows users to synchronize values such as position, sizing, or scale between them.
14 lines (11 loc) • 314 B
JavaScript
const getPositionHelpers = (
/* wgsl */
`
fn getWorldPosition(position: vec3f) -> vec4f {
return matrices.model * vec4f(position, 1.0);
}
fn getOutputPosition(position: vec3f) -> vec4f {
return camera.projection * camera.view * matrices.model * vec4f(position, 1.0);
}`
);
export { getPositionHelpers };