git-svn-id: svn://db.shs.com.ru/libs@72 a8b55f48-bf90-11e4-a774-851b48703e85

This commit is contained in:
2015-12-14 14:21:04 +00:00
parent 43354bca77
commit 0ae2fbfa6f
4 changed files with 51 additions and 8 deletions

View File

@@ -4,11 +4,15 @@ uniform sampler2D t0, ts, tg1;
uniform float radius = 2;
uniform vec2 dt;
vec4 st;
vec4 getTexel(vec2 tc, vec4 ptc, float mul) {
vec4 tv = texture(t0, tc);
if (radius == 1)
vec4 tv = texture(t0, tc), ts = texture(ts, tc);
if (radius == 1) {
tv = vec4(tv.w);
return vec4(min(ptc.r, tv.r), max(ptc.g, tv.g), ptc.b + tv.b * mul, 0);
ts = tv;
}
return vec4(min(ptc.r, ts.r), max(ptc.g, ts.g), ptc.b + /*mix(tv.b, st.b, clamp(abs(st.w - tv.w), 0, 1))*/tv.b * mul, 0);
}
void main(void) {
@@ -19,6 +23,7 @@ void main(void) {
vec4 scol = texture(t0, tc);
if (radius == 1)
scol = vec4(scol.w);
st = scol;
scol.b *= 3.;
scol = getTexel(tc + dt * vec2( o, 0 ), scol, 2);
scol = getTexel(tc + dt * vec2( 0, o ), scol, 2);