Skip to content

re-ovo/web-naga

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WebNaga

Provides mutual conversion between different Shader language syntaxes, implemented using naga and wasm

Installation

npm i web-naga

Frontend and Backend

Frontend

  • GLSL
  • WGSL

Backend

  • WGSL
  • GLSL

Usage

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)

Contributing

Setup wasm-pack

rustup target add wasm32-unknown-unknown

cargo install wasm-pack

Build

wasm-pack build --target web

About

The shader translation library for the web based on naga

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages