Provides mutual conversion between different Shader language syntaxes, implemented using naga and wasm
npm i web-naga- GLSL
- WGSL
- WGSL
- GLSL
GLSL -> WGSL
const front = GlslFrontend.new();
const module = front.parse(code, ShaderStage.Vertex);
const result = module.to_wgsl()WGSL -> GLSL
const front = WgslFrontend.new();
const module = front.parse(code);
const options = GlslBackendOptions.new();
// options.stage = ShaderStage.Vertex;
// options.version = GlslVersion.embedded(330)
// options.flags = GlslWriterFlags.None
const result = module.to_glsl("main", options)rustup target add wasm32-unknown-unknown
cargo install wasm-packwasm-pack build --target web