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

This commit is contained in:
2015-11-26 21:42:43 +00:00
parent 4cbcbb5174
commit 59eb135a60
14 changed files with 419 additions and 42861 deletions

View File

@@ -0,0 +1,24 @@
#version 150
uniform sampler2D t0, ts;
uniform vec2 dt;
uniform float factor;
uniform int steps = 16;
void main(void) {
vec2 cdt = dt / steps;
vec2 ct = qgl_FragTexture.xy;
vec3 speed = texture(ts, ct).rgb*1024;
int hsteps = steps / 2;
ct -= speed.xy * cdt * hsteps;
vec3 scol = vec3(0);//texture(t0, ct).rgb;
float sum = 0.;
for (int i = 0; i < steps; ++i) {
ct += speed.xy * cdt;
float mul = 1. - abs(i - hsteps) * 2. / steps;
scol += texture(t0, ct).rgb * mul;
sum += mul;
}
scol /= sum;
qgl_FragData[0].rgb = scol;
}