[PD] need help with gem and glsl feedback

Py Fave pyfave at gmail.com
Wed Oct 2 20:10:45 CEST 2013

Hello list ,

i'm currently trying to understand a bit more glsl ,
and am tearing my hairs

i have a scene with some  moving geometry (torus)
on this  geometry i use successfully a simple shader to plot a moving circle.

i try to make the classical feedback effect , but i need to use glsl
because i want to control precisely the adding of the image at time
and at time+1

here is the feedback shader i try to use .
uniform sampler2D tex1,tex2;
uniform float motionblurstrenght;
vec2 coord = gl_TexCoord[0].st;
void main()
    vec4 t1 = texture(tex1, coord);//new frame
    vec4 t2 = texture(tex2, coord);//acumulated frame
    gl_FragColor = vec4(t1.r);
   float r = ((1.-motionblurstrenght)*t2.r) + (t1.r);//motion blur
     gl_FragColor = vec4(r);

do you have a clean example or hints on how to implement this ?
i am currently fighting  with gemframebuffer and pix_texture
and  rendering order and texunits .
and i feel i'm missing something ..

i would like , if possible to keep this as an effect i can turn on and
off  , without modifing my current gem chains .

i think i need two gem chains ,one early and one at last in the frame
drawing chronology , but i can't make it though i tried a lot

any help appreciated .


More information about the Pd-list mailing list