diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2020-07-31 16:54:31 -0700 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2020-07-31 16:54:31 -0700 |
commit | 94de2291e005f1c646fd779e8d32b2820e22e071 (patch) | |
tree | 988bb9fde53a73edf948dd14fec07802a2f42406 /README | |
parent | cd7e9ebd9675461f59d5f7a9c7c0a9a1a0536d12 (diff) |
*: initial implementation of pig
This is nothing to write home about, but it provides a little sandbox for
developing shader-generated textures in the spirit of shadertoy or the
demoscene tool bonzomatic.
It's more oriented towards developing shaders for use with libstage in
the small games I've been hacking on.
Diffstat (limited to 'README')
-rw-r--r-- | README | 43 |
1 files changed, 43 insertions, 0 deletions
@@ -0,0 +1,43 @@ +pig is a tool to assist developing shaders for games + +at this time it targets just gl2.1 and is fairly minimal, +it expects you to supply the vertex shader and fragment shader +paths on argv as such: + +``` + ./pig path/to/vertex-shader path/to/fragment-shader +``` + +If the files don't exist or are otherwise unusable, pig will just +skip running the shader but continue drawing a checkered bg with +the variables changing as usual. + +The set of uniforms pig wires up to the shaders are currently: + +``` + uniform float alpha; + uniform float time; + uniform float T; + uniform vec3 color; + uniform float seed; + uniform float rand; +``` + +alpha: is always 1.f currently, this comes in by virtue of libstage integration. + when your shader is used as a shader-node w/libstage for instance, this + value would reflect stage_t.alpha, set via stage_set_alpha() or at stage_t + create time via stage_conf_t.alpha. + +time: time since program start in seconds.fraction + +T: 0.f - 1.f, cycled at 1HZ, intended for driving animation/effects. The + time uniform can be considered absolute time, whereas this would be + relative to the shader's start, with a duration assumed of 1 second. + In the future there will probably be flags or something to set the + duration and range. + +color: a random color, randomized every cycle of T + +seed: a random seed, randomized every cycle of T + +rand: 0.f - 1.f, a random number, randomized every run of the shader |