X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=demo_prior;a=blobdiff_plain;f=src%2Fpost.c;h=994c93e12c16f674861cf3070e731e2596896a66;hp=91109b2d97770cb0a8438a95cd0355d73b4a9166;hb=HEAD;hpb=5eefe7b94c8d6c6caa2c10e3835ab0831a3c42a1 diff --git a/src/post.c b/src/post.c index 91109b2..994c93e 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 >= 0) { + glUniform3f(vgn_uloc_color, r, g, b); + } + if(vgn_uloc_offs >= 0) { + glUniform1f(vgn_uloc_offs, offs); + } + if(vgn_uloc_sharp >= 0) { + glUniform1f(vgn_uloc_sharp, sharp); + } + overlay(0, 1.0, 1.0); }