/shader-editor

WGSL shader editor for wgpu

Primary LanguageRustMIT LicenseMIT

Shader editor

A minimal WebGPU application which can run your WGSL shaders. Built with iced, providing the ability to add some UI on top of the rendered image.

Motivation

The main goal is to provide a quick way to develop shaders with a fast iteration loop. Inspired by tools like shadertoy.

Usage

Use cargo run to start

Editor:

  • press Update shader or Ctrl+R to reload shader

File watcher:

  • edit shader.wgsl file, it will be reloaded on changes

Preview

preview

Roadmap

  • Watch shader file and do hot reload on changes
  • Menu dialog to open shader files
  • Multiline text editor for shaders
  • Syntax highlight
  • Show error position inside editor

Details

The implementation is based on the following examples:

Using notify for file watching.