Calcoph / te-shader-play

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Te Shader Play

Live-reload wgsl shaders and watch them render in real time.

Shader parameters

You can enter custom parameters in the Shader parameters window.

To use the parameters in the shaders you have to declare them like:

@group(1) @binding(3)
var<uniform> my_shader_parameter: u32;
type supported
bool πŸ”΄ (Not allowed by wgpu)
u32 🟒
i32 🟒
f16 πŸ”΄
f32 🟒
atomic<T> πŸ”΄
vecN<T> 🟒 where T is supported
matCxR<T> 🟒 where T is f32 and C and R in {2,3,4}
array<E,N> πŸ”΄
array<E> πŸ”΄
struct πŸ”΄

A time parameter is located at @group(0) binding(0), which is a u32. It represents the milliseconds elapsed since the program started.

Check the default shader (credit: kishimisu) for an example.

About


Languages

Language:Rust 96.6%Language:WGSL 3.4%