X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=demo_prior;a=blobdiff_plain;f=src%2Fpost.c;fp=src%2Fpost.c;h=c834073f6336216b494c492d56fcd98f05f5b6c7;hp=91109b2d97770cb0a8438a95cd0355d73b4a9166;hb=2f14a35e7d557da12f24056267b911f24774aa18;hpb=5eefe7b94c8d6c6caa2c10e3835ab0831a3c42a1 diff --git a/src/post.c b/src/post.c index 91109b2..c834073 100644 --- a/src/post.c +++ b/src/post.c @@ -12,18 +12,21 @@ unsigned int post_fbo[2]; struct texture post_fbtex[2]; int post_fbtex_cur; -unsigned int post_sdr[MAX_POST_SDR]; +unsigned int sdr_vgn; +int vgn_uloc_color, vgn_uloc_offs, vgn_uloc_sharp; int post_init(void) { int i; - static const char *psdr_fname[] = {"sdr/oldfig.p.glsl"}; - for(i=0; iid, (float)tex->width / tex->height, alpha); + unsigned int tid; + float aspect; + if(tex) { + tid = tex->id; + aspect = (float)tex->width / tex->height; + } else { + tid = 0; + aspect = 1.0f; + } + overlay(tid, aspect, alpha); +} + +void vignette(float r, float g, float b, float offs, float sharp) +{ + glUseProgram(sdr_vgn); + if(vgn_uloc_color) { + glUniform3f(vgn_uloc_color, r, g, b); + } + if(vgn_uloc_offs) { + glUniform1f(vgn_uloc_offs, offs); + } + if(vgn_uloc_sharp) { + glUniform1f(vgn_uloc_sharp, sharp); + } + overlay(0, 1.0, 1.0); }