alphastrata / shadplay

Real-time wgsl visualisation tooling for educating oneself in the art of shader programming
MIT License
381 stars 11 forks source link

[FEAT] More advanced Uniform control #79

Open alphastrata opened 11 months ago

alphastrata commented 11 months ago

whatchu want? The nature of controlling uniforms is difficult, as we MUST know what they are before compiling, to solve this perhaps we can just slap in say, 5 or 10 of EVERY type we can pass to a uniform, then let a user control those via a small node-esk GUI at runtime.

Imagine the system much like how UnrealEngine's blueprint system lets you create Blueprints, you select a data-type (int/float/array etc) then you label it with some String (that we could just have be anything on the backend).

Toggling an editor? key a user could then update this value, which we'd capture to update the resource and pass it down to the shader.

NOTE: the bad thing about this is that it'd bloat our default shader code quite considerably :(, I don't see a good way around this as the import xyzs must be compiled in from the app's source (not assets), and they, as a result of that will not be hot-reloaded when changed.