Re: [PD] RE : Re: need help with gem and glsl feedback
Yes it helps a lot. There are colored lines appearing in background, setting the looped gemframebuffer perspec fixes it, I will try now to found out how to turn background's black pixels to transparent. Colet Patrice - Mail original - > De: "Jack" > À: pd-list@iem.at > Envoyé: Jeudi 3 Octobre 2013 12:43:36 > Objet: Re: [PD] RE : Re: need help with gem and glsl feedback > > > > Le 03/10/2013 11:23, Patrice Colet a écrit : > > > Hello, > > I'm trying to find out how to get a backbuffer for attached shader > found in the web ( http://glsl.heroku.com/e#8849.0 ), it seem I > couldn't get alpha channel in gemframebuffer's recursion, any idea? > > I just added a line at the begining and an other one at the end of > fractalFeedback.frag to change the alpha for the feedback. > I also change the texunit ID backbuffer to 0 in the patch. > You can change alpha feedback with the number box i added in the > patch. > Hope it helps. > ++ > > Jack > > > > > ___ > Pd-list@iem.at mailing list > UNSUBSCRIBE and account-management -> > http://lists.puredata.info/listinfo/pd-list > ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Re: [PD] RE : Re: need help with gem and glsl feedback
Le 06/10/2013 22:13, Py Fave a écrit : > Hello , i just opened your last patch and am looking at it . > weanwhile i reply to your points > > 2013/10/6 Jack : >> Hello, >> >> Le 05/10/2013 22:51, Py Fave a écrit : >> >> in fact my problem is not solved . >> it seems like the feedback effect happens everywhere but on the >> surface drawn by the shader . >> >> According to the patch, the feedback is applied on a [square 4] (where there >> is also the [torus 2]). >> Then, [gemframebuffer] 'snap' the whole 'inside' [square 4]. And your torus >> is inside this snapshot (as texels and not vertices). >> > yes ,and then there is some feedback on the texels of the square . > but in my patch if i rotate the torus i get some feedback but not on the > shaded part (only the silhouette of the torus . i don't know why . > i would like everything to go in the feedback loop . > > in fact i try to have trails that show "geodesics" on a surface > later i plan to replace my torus with other models . > > > >> i use a torus , in perspective wich has a shader applied . >> >> i tried the following workaround(archive is joined ) , but still no luck . >> the file to open has a OPEN in name . >> >> It seems there is no circle4.geom, [receive13] and [nshader0] >> objects/abstractions in your .zip. > sorry i forgot . > > receive13 only is missing . > it's part of ext13 library (and is in pd-extended iirc) > http://puredata.info/downloads/ext13 > > [receive13 nothing ]could be replaced by receive nShader1 > or all the shader abstraction can be replaced by the classical shader network > with fragment shader = circle4.frag and vertex shader = circle4.vert. > no .geom was used > > >> i would like the dots to have the feedback , >> or dots + geometry alltogether. >> >> I can't see dot in your patch (or gem window), maybe they come from geometry >> shader (which is missing) ? >> > i didn't use geometry shader . just fragment . > glsl program complains in the abstraction but no harm here i think > >> i tried pix_snap2tex ( using gems.feedback from pdmtl abstractions) too >> but no luck because we can't choose the mixing function . >> and i would like only white to make trails . >> and i don't know how to keep the supporting geometry from appearing . >> the torus should be full black with a white trail only . >> >> A simple possibility is to use 2 torus, a black 'on' a white. And use the >> white for the trail ? >> >> An other way : >> >> white torus as texture >> |__> in the feedback __> output feedback as texture >> |__> convert white in black texel __> output black torus as texture >> >> Then mix (multiply) black torus with white feedback to get a black torus >> with white trails. >> ++ >> >> Jack >> > i'll send a modified patch a bit later . > > Thank you so much i see some good things from the last patch you sent . > > it is not what i want to do but opens other directions > and perhaps i was focusing on one method but there seems to be alternatives . > > i'll update this thread tomorrow . > i have to keep some life away from computer :-) > > Thanks for your help > > Py > > ___ > Pd-list@iem.at mailing list > UNSUBSCRIBE and account-management -> > http://lists.puredata.info/listinfo/pd-list Hello Pierre-Yves, This patch should work for your purpose. If it doesn't work, you have, maybe, a problem with your configuration. ++ Jack // Cyrille Henry 2007 void main() { gl_TexCoord[0] = gl_MultiTexCoord0; gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } uniform float time, alpha_back; uniform vec2 mouse; uniform vec2 resolution; uniform sampler2D backbuffer; #define PI2 6.2831853070 // definition for a scale, rotate, and color transform // color transform is multiply (darken) only struct Transform { vec4 color; vec2 center; float scale; float rotation; }; vec2 applyTransform(const Transform t, vec2 v) { v -= t.center; float c = cos(t.rotation); float s = sin(t.rotation); return (vec2( (v.x*c - v.y*s), (v.y*c + v.x*s)) * t.scale + t.center); } #define SCALE 5.0 // model will be scaled such that the rectangle (-SCALE/2, -SCALE/2), (SCALE/2, SCALE/2) // will be centered and fit the window with square aspect ratio. float scale = SCALE / min(resolution.y,resolution.x); vec2 mapModelToTexture(const vec2 v) { return (v/(resolution*scale) + 0.5); } vec2 mapTextureToModel(const vec2 v) { return (v - 0.5 * resolution) * scale; } // apply transform, return backbuffer sample vec4 getBackbufferTransform(const Transform t, vec2 v) { return t.color * texture2D(backbuffer, mapModelToTexture(applyTransform(t, v))); } vec4 whiten(const vec4 color, float f) { return (1.-f)*color + vec4(f); } void main( void ) { // transform fragment coords to model coords vec2 v = mapTextureToModel(gl_FragCoord.x
Re: [PD] RE : Re: need help with gem and glsl feedback
Test with this one. You should get the motion blur on the torus (here from your webcam). Ifnot, there is a broblem somewhere else... Le 06/10/2013 22:13, Py Fave a écrit : > Hello , i just opened your last patch and am looking at it . > weanwhile i reply to your points > > 2013/10/6 Jack : >> Hello, >> >> Le 05/10/2013 22:51, Py Fave a écrit : >> >> in fact my problem is not solved . >> it seems like the feedback effect happens everywhere but on the >> surface drawn by the shader . >> >> According to the patch, the feedback is applied on a [square 4] (where there >> is also the [torus 2]). >> Then, [gemframebuffer] 'snap' the whole 'inside' [square 4]. And your torus >> is inside this snapshot (as texels and not vertices). >> > yes ,and then there is some feedback on the texels of the square . > but in my patch if i rotate the torus i get some feedback but not on the > shaded part (only the silhouette of the torus . i don't know why . > i would like everything to go in the feedback loop . It should be OK if you put the shader for the torus on the Gem chain with [gemhead 5] and then let the feedback chains safe like in the patch attached. Tell me if there is a problem now. ++ Jack > > in fact i try to have trails that show "geodesics" on a surface > later i plan to replace my torus with other models . > > > >> i use a torus , in perspective wich has a shader applied . >> >> i tried the following workaround(archive is joined ) , but still no luck . >> the file to open has a OPEN in name . >> >> It seems there is no circle4.geom, [receive13] and [nshader0] >> objects/abstractions in your .zip. > sorry i forgot . > > receive13 only is missing . > it's part of ext13 library (and is in pd-extended iirc) > http://puredata.info/downloads/ext13 > > [receive13 nothing ]could be replaced by receive nShader1 > or all the shader abstraction can be replaced by the classical shader network > with fragment shader = circle4.frag and vertex shader = circle4.vert. > no .geom was used > > >> i would like the dots to have the feedback , >> or dots + geometry alltogether. >> >> I can't see dot in your patch (or gem window), maybe they come from geometry >> shader (which is missing) ? >> > i didn't use geometry shader . just fragment . > glsl program complains in the abstraction but no harm here i think > >> i tried pix_snap2tex ( using gems.feedback from pdmtl abstractions) too >> but no luck because we can't choose the mixing function . >> and i would like only white to make trails . >> and i don't know how to keep the supporting geometry from appearing . >> the torus should be full black with a white trail only . >> >> A simple possibility is to use 2 torus, a black 'on' a white. And use the >> white for the trail ? >> >> An other way : >> >> white torus as texture >> |__> in the feedback __> output feedback as texture >> |__> convert white in black texel __> output black torus as texture >> >> Then mix (multiply) black torus with white feedback to get a black torus >> with white trails. >> ++ >> >> Jack >> > i'll send a modified patch a bit later . > > Thank you so much i see some good things from the last patch you sent . > > it is not what i want to do but opens other directions > and perhaps i was focusing on one method but there seems to be alternatives . > > i'll update this thread tomorrow . > i have to keep some life away from computer :-) > > Thanks for your help > > Py > > ___ > Pd-list@iem.at mailing list > UNSUBSCRIBE and account-management -> > http://lists.puredata.info/listinfo/pd-list test.pd Description: application/puredata // Jack/RYBN 2013 #extension GL_ARB_texture_rectangle : enable uniform sampler2DRect MyTex1, MyTex2; void main() { vec2 tex_coord = gl_FragCoord.st; vec4 color = texture2DRect(MyTex1, tex_coord); vec4 color0 = texture2DRect(MyTex2, tex_coord); color *= 0.01; color0 *= 0.99; gl_FragColor = color+color0; } ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Re: [PD] RE : Re: need help with gem and glsl feedback
Hello , i just opened your last patch and am looking at it . weanwhile i reply to your points 2013/10/6 Jack : > Hello, > > Le 05/10/2013 22:51, Py Fave a écrit : > > in fact my problem is not solved . > it seems like the feedback effect happens everywhere but on the > surface drawn by the shader . > > According to the patch, the feedback is applied on a [square 4] (where there > is also the [torus 2]). > Then, [gemframebuffer] 'snap' the whole 'inside' [square 4]. And your torus > is inside this snapshot (as texels and not vertices). > yes ,and then there is some feedback on the texels of the square . but in my patch if i rotate the torus i get some feedback but not on the shaded part (only the silhouette of the torus . i don't know why . i would like everything to go in the feedback loop . in fact i try to have trails that show "geodesics" on a surface later i plan to replace my torus with other models . > > i use a torus , in perspective wich has a shader applied . > > i tried the following workaround(archive is joined ) , but still no luck . > the file to open has a OPEN in name . > > It seems there is no circle4.geom, [receive13] and [nshader0] > objects/abstractions in your .zip. sorry i forgot . receive13 only is missing . it's part of ext13 library (and is in pd-extended iirc) http://puredata.info/downloads/ext13 [receive13 nothing ]could be replaced by receive nShader1 or all the shader abstraction can be replaced by the classical shader network with fragment shader = circle4.frag and vertex shader = circle4.vert. no .geom was used > > i would like the dots to have the feedback , > or dots + geometry alltogether. > > I can't see dot in your patch (or gem window), maybe they come from geometry > shader (which is missing) ? > i didn't use geometry shader . just fragment . glsl program complains in the abstraction but no harm here i think > > i tried pix_snap2tex ( using gems.feedback from pdmtl abstractions) too > but no luck because we can't choose the mixing function . > and i would like only white to make trails . > and i don't know how to keep the supporting geometry from appearing . > the torus should be full black with a white trail only . > > A simple possibility is to use 2 torus, a black 'on' a white. And use the > white for the trail ? > > An other way : > > white torus as texture > |__> in the feedback __> output feedback as texture > |__> convert white in black texel __> output black torus as texture > > Then mix (multiply) black torus with white feedback to get a black torus > with white trails. > ++ > > Jack > i'll send a modified patch a bit later . Thank you so much i see some good things from the last patch you sent . it is not what i want to do but opens other directions and perhaps i was focusing on one method but there seems to be alternatives . i'll update this thread tomorrow . i have to keep some life away from computer :-) Thanks for your help Py ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Re: [PD] RE : Re: need help with gem and glsl feedback
Le 06/10/2013 14:41, Jack a écrit : > Hello, > > Le 05/10/2013 22:51, Py Fave a écrit : >> in fact my problem is not solved . >> it seems like the feedback effect happens everywhere but on the >> surface drawn by the shader . > According to the patch, the feedback is applied on a [square 4] (where > there is also the [torus 2]). > Then, [gemframebuffer] 'snap' the whole 'inside' [square 4]. And your > torus is inside this snapshot (as texels and not vertices). >> i use a torus , in perspective wich has a shader applied . >> >> i tried the following workaround(archive is joined ) , but still no luck . >> the file to open has a OPEN in name . > It seems there is no circle4.geom, [receive13] and [nshader0] > objects/abstractions in your .zip. >> i would like the dots to have the feedback , >> or dots + geometry alltogether. > I can't see dot in your patch (or gem window), maybe they come from > geometry shader (which is missing) ? >> i tried pix_snap2tex ( using gems.feedback from pdmtl abstractions) too >> but no luck because we can't choose the mixing function . >> and i would like only white to make trails . >> and i don't know how to keep the supporting geometry from appearing . >> the torus should be full black with a white trail only . > A simple possibility is to use 2 torus, a black 'on' a white. And use > the white for the trail ? Attached is an example of that method. Hope it will help you... ++ Jack > > An other way : > > white torus as texture > |__> in the feedback __> output feedback as texture > |__> convert white in black texel __> output black torus as texture > > Then mix (multiply) black torus with white feedback to get a black > torus with white trails. > ++ > > Jack > > > >> btw i'm on windows not my choice. >> i have to share the screen with other programs wich are windows only >> >> any help welcome once more . >> >> Thanks >> >> Pierre-Yves >> >> >> ___ >> Pd-list@iem.at mailing list >> UNSUBSCRIBE and account-management -> >> http://lists.puredata.info/listinfo/pd-list > > > ___ > Pd-list@iem.at mailing list > UNSUBSCRIBE and account-management -> > http://lists.puredata.info/listinfo/pd-list // Jack/RYBN 2013 #extension GL_ARB_texture_rectangle : enable uniform sampler2DRect MyTex1, MyTex2; void main() { vec2 tex_coord = gl_FragCoord.st; vec4 color = texture2DRect(MyTex1, tex_coord); vec4 color0 = texture2DRect(MyTex2, tex_coord); gl_FragColor = color+color0; gl_FragColor.a = 0.9; } test.pd Description: application/puredata ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Re: [PD] RE : Re: need help with gem and glsl feedback
Hello, Le 05/10/2013 22:51, Py Fave a écrit : > in fact my problem is not solved . > it seems like the feedback effect happens everywhere but on the > surface drawn by the shader . According to the patch, the feedback is applied on a [square 4] (where there is also the [torus 2]). Then, [gemframebuffer] 'snap' the whole 'inside' [square 4]. And your torus is inside this snapshot (as texels and not vertices). > > i use a torus , in perspective wich has a shader applied . > > i tried the following workaround(archive is joined ) , but still no luck . > the file to open has a OPEN in name . It seems there is no circle4.geom, [receive13] and [nshader0] objects/abstractions in your .zip. > > i would like the dots to have the feedback , > or dots + geometry alltogether. I can't see dot in your patch (or gem window), maybe they come from geometry shader (which is missing) ? > > i tried pix_snap2tex ( using gems.feedback from pdmtl abstractions) too > but no luck because we can't choose the mixing function . > and i would like only white to make trails . > and i don't know how to keep the supporting geometry from appearing . > the torus should be full black with a white trail only . A simple possibility is to use 2 torus, a black 'on' a white. And use the white for the trail ? An other way : white torus as texture |__> in the feedback __> output feedback as texture |__> convert white in black texel __> output black torus as texture Then mix (multiply) black torus with white feedback to get a black torus with white trails. ++ Jack > > btw i'm on windows not my choice. > i have to share the screen with other programs wich are windows only > > any help welcome once more . > > Thanks > > Pierre-Yves > > > ___ > Pd-list@iem.at mailing list > UNSUBSCRIBE and account-management -> > http://lists.puredata.info/listinfo/pd-list ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Re: [PD] RE : Re: need help with gem and glsl feedback
Patrice, add [alpha 1 ] to the last chain to use alpha in your / jack's patch then you can use color on background Thanks Jack and Cyrille, my patch is better now Bonne soirée to a french thread i have one more question is it better nettiquette to reply only on the list or list + individual mail ? ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Re: [PD] RE : Re: need help with gem and glsl feedback
Le 03/10/2013 11:23, Patrice Colet a écrit : > Hello, > > I'm trying to find out how to get a backbuffer for attached shader found in > the web (http://glsl.heroku.com/e#8849.0), it seem I couldn't get alpha > channel in gemframebuffer's recursion, any idea? > > Colet Patrice > > > > ___ > Pd-list@iem.at mailing list > UNSUBSCRIBE and account-management -> > http://lists.puredata.info/listinfo/pd-list Hello Patrice, I just added a line at the begining and an other one at the end of fractalFeedback.frag to change the alpha for the feedback. I also change the texunit ID backbuffer to 0 in the patch. You can change alpha feedback with the number box i added in the patch. Hope it helps. ++ Jack feedback.pd Description: application/puredata uniform float time, alpha_back; uniform vec2 mouse; uniform vec2 resolution; uniform sampler2D backbuffer; #define PI2 6.2831853070 // definition for a scale, rotate, and color transform // color transform is multiply (darken) only struct Transform { vec4 color; vec2 center; float scale; float rotation; }; vec2 applyTransform(const Transform t, vec2 v) { v -= t.center; float c = cos(t.rotation); float s = sin(t.rotation); return (vec2( (v.x*c - v.y*s), (v.y*c + v.x*s)) * t.scale + t.center); } #define SCALE 5.0 // model will be scaled such that the rectangle (-SCALE/2, -SCALE/2), (SCALE/2, SCALE/2) // will be centered and fit the window with square aspect ratio. float scale = SCALE / min(resolution.y,resolution.x); vec2 mapModelToTexture(const vec2 v) { return (v/(resolution*scale) + 0.5); } vec2 mapTextureToModel(const vec2 v) { return (v - 0.5 * resolution) * scale; } // apply transform, return backbuffer sample vec4 getBackbufferTransform(const Transform t, vec2 v) { return t.color * texture2D(backbuffer, mapModelToTexture(applyTransform(t, v))); } vec4 whiten(const vec4 color, float f) { return (1.-f)*color + vec4(f); } void main( void ) { // transform fragment coords to model coords vec2 v = mapTextureToModel(gl_FragCoord.xy); // draw orbs const float innerRadius = 0.01; float outerRadius = .24 + .03 * (sin(17.*time) + sin(11.*time)); vec2 p1 = (vec2(sin(time), cos(time))); vec2 p2 = (vec2(sin(time*1.1), cos(time*1.1))); vec2 p3 = (vec2(sin(time*1.3), cos(time*1.3))); float d1 = length(v -p1); float d2 = length(v -p2); float d3 = length(v -p3); const float aa = 0.95; const float bb = 0.65; const float cc = 0.05; const vec4 color1 = vec4(aa, bb, cc, 2.0); const vec4 color2 = vec4(cc, bb, aa, 2.0); const vec4 color3 = vec4(aa, cc, bb, 2.0); vec4 drawing = vec4(0.,0.,0.,0.); drawing += smoothstep(outerRadius, innerRadius, d1) * color1; drawing += smoothstep(outerRadius, innerRadius, d2) * color2; drawing += smoothstep(outerRadius, innerRadius, d3) * color3; // draw ring/disc float rr = length(v); drawing += vec4(1.) * smoothstep(1.1, 1., rr) * smoothstep(0.9, 0.5+0.5*sin(0.1*time), rr); // apply feedback transforms to backbuffer // define transform structs float r = time*.27; Transform t1 = Transform( whiten(vec4(aa, bb, cc, 1.0), 0.7), vec2(-.7, 0.), 1.5, -r*3.); Transform t2 = Transform( whiten(vec4(cc, bb, aa, 1.0), 0.7), vec2(0.7, 0.), 1.5, r*2.); // composite feedback with drawing vec4 fc = max( getBackbufferTransform(t1, v), getBackbufferTransform(t2, v)); gl_FragColor = (1.-drawing[3])*fc -vec4(.01) + drawing[3]*drawing; gl_FragColor.a = alpha_back; } // Cyrille Henry 2007 void main() { gl_TexCoord[0] = gl_MultiTexCoord0; gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
[PD] RE : Re: need help with gem and glsl feedback
Hello, I'm trying to find out how to get a backbuffer for attached shader found in the web (http://glsl.heroku.com/e#8849.0), it seem I couldn't get alpha channel in gemframebuffer's recursion, any idea? Colet Patrice // Cyrille Henry 2007 void main() { gl_TexCoord[0] = gl_MultiTexCoord0; gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } #N canvas 923 209 901 669 10; #X obj 76 566 glsl_program; #X obj 149 419 pack 0 0; #X obj 170 399 t b f; #X obj 166 354 change; #X obj 148 259 change; #X msg 149 445 link \$1 \$2; #X floatatom 170 380 2 0 0 0 ID - -; #X floatatom 148 282 2 0 0 0 ID - -; #X obj 167 466 print linking; #X obj 213 222 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 76 240 glsl_vertex; #X obj 76 334 glsl_fragment; #X text 231 219 <- load shader; #N canvas 87 154 247 179 Gem.init 0; #X obj 118 46 loadbang; #X msg 118 81 reset; #X obj 118 113 outlet; #X connect 0 0 1 0; #X connect 1 0 2 0; #X restore 551 12 pd Gem.init; #N canvas 340 107 682 322 gemwin 0; #X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 -262144 -1 -1 1 1; #X obj 102 161 r \$0-gemstart; #X obj 102 182 select 1 0; #X msg 102 214 create \, 1; #X msg 177 215 destroy; #X obj 102 239 t a; #X obj 318 54 inlet; #X obj 318 255 gemwin; #X obj 318 100 t a a; #X obj 318 287 outlet; #X obj 350 128 route create destroy; #X obj 350 150 t b; #X msg 350 172 1; #X obj 390 150 t b; #X msg 390 172 0; #X obj 350 195 t f; #X msg 350 219 set \$1; #X text 118 122 rendering; #X connect 1 0 2 0; #X connect 2 0 3 0; #X connect 2 1 4 0; #X connect 3 0 5 0; #X connect 4 0 5 0; #X connect 5 0 8 0; #X connect 6 0 8 0; #X connect 7 0 9 0; #X connect 8 0 7 0; #X connect 8 1 10 0; #X connect 10 0 11 0; #X connect 10 1 13 0; #X connect 11 0 12 0; #X connect 12 0 15 0; #X connect 13 0 14 0; #X connect 14 0 15 0; #X connect 15 0 16 0; #X connect 16 0 0 0; #X coords 0 -1 1 1 85 40 1 100 100; #X restore 533 33 pd gemwin; #X msg 31 357 print; #X msg 32 279 print; #X msg 39 547 print; #X obj 76 168 alpha; #X obj 74 143 t a b; #X obj 188 162 change; #X msg 188 142 1; #X obj 76 589 pix_texture; #X msg 87 219 open texture.vert; #X obj 437 355 f; #X obj 465 354 + 1; #X obj 433 310 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1 1; #X msg 501 331 0; #X obj 336 496 b; #X obj 437 375 / 1000; #X obj 435 333 metro 1; #X msg 379 397 1; #X msg 437 417 time \$1; #X msg 336 518 resolution 512 512; #X msg 86 308 open fractalFeedback.frag; #X obj 75 73 gemframebuffer; #X obj 592 417 pix_texture; #X obj 75 122 translateXYZ 0 0 -4; #X obj 76 613 square 4; #X obj 585 510 square 4; #X obj 134 158 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 1; #X msg 300 32 format RGB32 \, dimen 512 512; #X obj 584 300 gemframebuffer; #X obj 75 28 gemhead 30; #X obj 749 371 pix_texture; #X obj 749 288 gemhead 55; #X obj 749 393 square 4; #X obj 492 465 loadbang; #X obj 299 9 loadbang; #X obj 590 233 gemhead 25; #X msg 506 539 texunit 1 \, rectangle 0; #X msg 295 559 backbuffer 1; #X obj 587 340 translateXYZ 0 0 -4; #X connect 0 0 22 0; #X connect 0 1 28 0; #X connect 1 0 5 0; #X connect 2 0 1 0; #X connect 2 1 1 1; #X connect 3 0 6 0; #X connect 4 0 7 0; #X connect 5 0 0 0; #X connect 5 0 8 0; #X connect 6 0 2 0; #X connect 7 0 1 0; #X connect 9 0 23 0; #X connect 9 0 34 0; #X connect 10 0 11 0; #X connect 10 1 4 0; #X connect 11 0 0 0; #X connect 11 1 3 0; #X connect 13 0 14 0; #X connect 15 0 11 0; #X connect 16 0 10 0; #X connect 17 0 0 0; #X connect 18 0 10 0; #X connect 19 0 18 0; #X connect 19 1 21 0; #X connect 20 0 9 0; #X connect 21 0 20 0; #X connect 22 0 38 0; #X connect 23 0 10 0; #X connect 24 0 25 0; #X connect 24 0 29 0; #X connect 25 0 24 1; #X connect 26 0 30 0; #X connect 27 0 24 1; #X connect 28 0 33 0; #X connect 28 0 31 0; #X connect 28 0 51 0; #X connect 29 0 32 0; #X connect 30 0 24 0; #X connect 31 0 26 0; #X connect 32 0 0 0; #X connect 33 0 0 0; #X connect 34 0 11 0; #X connect 35 0 37 0; #X connect 35 1 36 1; #X connect 36 0 39 0; #X connect 37 0 19 0; #X connect 40 0 18 1; #X connect 41 0 35 0; #X connect 41 0 42 0; #X connect 42 0 52 0; #X connect 42 1 44 1; #X connect 43 0 35 0; #X connect 44 0 46 0; #X connect 45 0 44 0; #X connect 47 0 50 0; #X connect 48 0 41 0; #X connect 49 0 42 0; #X connect 50 0 36 0; #X connect 51 0 0 0; #X connect 52 0 36 0; fractalFeedback Description: Binary data ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
[PD] RE : Re: need help with gem and glsl feedback
Use, format RGB32 instead of RGB for your framebufers. ++ JackPy Fave a écrit :first thanks both for your help. i was tired yesterday evening. jack , i have a problem with your patch. i had already similar problems before, that's why i wanted to use some shader in the feedback chain . it works ok BUT with very long feedback ( 0.999 alpha ) values i get a ghost image, the point never diseappears( because perhaps of a bad approximation in opengl ) . ie : color 1 1 1 0.995 leaves traces is that a problem with my graphics card ? i don't think so . i join a clumsy correction test , with makes things flicker a bit too much . do you have a better workaround? 2013/10/2 Jack : > 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@iem.at mailing list >> UNSUBSCRIBE and account-management -> >> http://lists.puredata.info/listinfo/pd-list > > This example could help, see attached. > ++ > > Jack > > > > ___ > Pd-list@iem.at mailing list > UNSUBSCRIBE and account-management -> > http://lists.puredata.info/listinfo/pd-list > ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list