Skip to content

zeozeozeo/odin-wesl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

odin-wesl

Odin bindings for the wesl-rs compiler (based on wesl-c).

Usage examples (ported from wesl-c)

Usage

This is best used with the vendor:wgpu package. WESL allows you to to do cool stuff like imports in WGSL shaders:

import package::colors::chartreuse;    // 1. modularize shaders in separate files
import random_wgsl::pcg_2u_3f;         // 2. use shader libraries from npm/cargo

fn random_color(uv: vec2u) -> vec3f {
    var color = pcg_2u_3f(uv);

    @if(DEBUG) color = chartreuse;     // 3. set conditions at runtime or build time

    return color;
}

About

Odin bindings for the wesl-rs compiler (based on wesl-c).

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors