Skip to content

tomlin7/shader-editor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

shader editor (zig+webgpu)

minimal native desktop shader editor written in zig. uses wgpu-native c api directly and glfw for windowing

image

building

zig build run

once running, a colorful triangle will render. leave the window open. open shader.wgsl and start editing.

shaders.mp4
┌──────────────────────┬──────────────────────┐
│                      │                      │
│   text editor        │   shader preview     │
│   (editor.zig)       │   (viewport render)  │
│                      │                      │
│   - line numbers     │   - your wgsl shader │
│   - blinking cursor  │   - live triangle    │
│   - syntax editing   │   - uniforms: time,  │
│                      │     resolution       │
├──────────────────────┤                      │
│ error/success panel  │                      │
└──────────────────────┴──────────────────────┘
  • type in the left panel to edit WGSL
  • arrow keys to navigate
  • enter for new lines, backspace to delete
  • ctrl+s to compile — preview updates on success, red error panel on failure
  • last valid shader keeps rendering if compilation fails

if you write a syntax error, the console will print === webgpi compilation error ===, and the window will safely keep animating the old shader without crashing.

About

minimal native desktop shader editor written in zig. uses wgpu-native c api directly and glfw for windowing

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors