[PD] need help with gem and glsl feedback

Jack jack at rybn.org
Wed Oct 2 22:37:10 CEST 2013


Le 02/10/2013 20:10, Py Fave a écrit :
> 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.
>
> Then
> 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 .
>
> Pierre-Yves
>
> _______________________________________________
> Pd-list at iem.at mailing list
> UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list

This example could help, see attached.
++

Jack


-------------- next part --------------
A non-text attachment was scrubbed...
Name: feedback_and_glsl.pd
Type: application/puredata
Size: 1386 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20131002/7e7b6200/attachment.bin>


More information about the Pd-list mailing list