https://github.com/re-ovo/web-naga
The shader translation library for the web
https://github.com/re-ovo/web-naga
glsl wasm wasm-bindgen wgsl
Last synced: 3 months ago
JSON representation
The shader translation library for the web
- Host: GitHub
- URL: https://github.com/re-ovo/web-naga
- Owner: re-ovo
- License: mit
- Created: 2024-12-05T15:28:19.000Z (10 months ago)
- Default Branch: master
- Last Pushed: 2025-07-10T08:54:40.000Z (3 months ago)
- Last Synced: 2025-07-19T12:05:17.656Z (3 months ago)
- Topics: glsl, wasm, wasm-bindgen, wgsl
- Language: Rust
- Homepage:
- Size: 87.9 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE_MIT
Awesome Lists containing this project
README
# WebNaga
Provides mutual conversion between different Shader language syntaxes, implemented using naga and wasm
## Frontend and Backend
### Frontend
- GLSL
- WGSL## Backend
- WGSL
- GLSL## Usage
GLSL -> WGSL
```javascript
const front = GlslFrontend.new();
const module = front.parse(code, ShaderStage.Vertex);
const result = module.to_wgsl()
```WGSL -> GLSL
```javascript
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)
```