Hmm, strange i had only warning but no error. I change 0 to 0.0 (to use float instead int in 'if ((color.g - colorToDiscard.g) <= 0.0)') and now i have no warning (i join the new .frag) : all works fine here. I think, the problem could come from the GPU (and so the version of GLSL supported ? I am not an expert in GLSL, so i can't answer correctly to this question :). Here i have a NVidia 9700M GTS (with the NVidia driver 180.44). ++
Jack Le jeudi 17 septembre 2009 à 12:43 +0200, Max a écrit : > hi jack, > > you are very welcome. most of the patches are heavily inspired by what > floats through the mailinglist or the help patches. > > i didn't have time to look into it but i am getting > > error: [glsl_fragment]: shader not loaded > linking: link 5.60519e-45 2.8026e-45 > linking: link 5.60519e-45 7.00649e-45 > [glsl_program]: Info_log: > [glsl_program]: ERROR: One or more attached shaders not successfully > compiled > > [glsl_program]: Link failed! > > with the shaders you've attached. are you shure they work on your > system? > > > Am 17.09.2009 um 01:39 schrieb Jack: > > > Hello Max, > > Thanx to share those useful patchs. > > Just one point, i have a problem with the color keying patch using > > GLSL, > > it doesn't work here (someone else ?). So i decided to write a > > new .frag > > (is it good ?) and create a new patch. > > By hoping it helps. > > ++ > > > > Jack > > > > > > Le mercredi 16 septembre 2009 à 16:09 +0200, Max a écrit : > >> ;o) > >> > >> you may want to look into those patches: > >> http://damm-net.org/wiki/index.php?title=Bewegungsmelder > >> > >> > >> Am 12.09.2009 um 16:48 schrieb bra...@subnet.at: > >> > >>> Very nice, thank you > >>> > >>> do you mind if I use that patch for future projects? > >>> > >>> ;-) > >>> der.brandt > >>> > >>> > >>>> bra...@subnet.at wrote: > >>>>> Hi list > >>>>> > >>>>> anybody having an idea of building a bluebox in pd/gem? > >>>> > >>>> very simple, see attached patch. > >>>> > >>>> > >>>> fmdasdr > >>>> IOhannes > >>>> > >>>> you can also have a look at [pix_chroma_key] > >>>> > >>> > >>> > >>> > >>> _______________________________________________ > >>> 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 > > <colorKeyingGLSL.zip> >
//Jack/RYBN 2009 #extension GL_ARB_texture_rectangle : enable uniform sampler2DRect MyTex; uniform vec3 colorToDiscard; uniform float seuil; float rouge, vert, bleu; void main (void) { vec4 color = texture2DRect(MyTex, gl_TexCoord[0].st); if (abs(color.r - colorToDiscard.r) >= seuil) { rouge = 1.0; } else { if ((color.r - colorToDiscard.r) <= 0.0) { rouge = (color.r - colorToDiscard.r)/seuil; } else { rouge = (colorToDiscard.r - color.r)/seuil; } } if (abs(color.g - colorToDiscard.g) >= seuil) { vert = 1.0; } else { if ((color.g - colorToDiscard.g) <= 0.0) { vert = (color.g - colorToDiscard.g)/seuil; } else { vert = (colorToDiscard.g - color.g)/seuil; } } if (abs(color.b - colorToDiscard.b) >= seuil) { bleu = 1.0; } else { if ((color.b - colorToDiscard.b) <= 0.0) { bleu = (color.b - colorToDiscard.b)/seuil; } else { bleu = (colorToDiscard.b - color.b)/seuil; } } color.a = (rouge+vert+bleu) / 3.0; gl_FragColor = color; }
_______________________________________________ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list