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.
21 lines (20 loc) • 912 B
JavaScript
import { getVertexOutputStructContent } from "./get-vertex-output-struct-content.mjs";
//#region src/core/shaders/chunks/vertex/head/get-vertex-output-struct.ts
/**
* Get the vertex shader WGSL output struct using {@link getVertexOutputStructContent}.
* @param parameters - Parameters used to generate the vertex shader WGSL output struct.
* @param parameters.geometry - {@link Geometry} used to generate the struct from its attributes.
* @param parameters.additionalVaryings - Optional additional {@link VertexShaderInputParams.additionalVaryings | varyings} to pass from the vertex shader to the fragment shader.
* @returns - String with the vertex shader WGSL output struct.
*/
const getVertexOutputStruct = ({ geometry, additionalVaryings = [] }) => {
return `
struct VSOutput {
${getVertexOutputStructContent({
geometry,
additionalVaryings
})}
};`;
};
//#endregion
export { getVertexOutputStruct };