[GEM-dev] glsl question

erich eb at randomseed.org
Thu Apr 29 19:56:41 CEST 2010


hi jack,

sorry i should have been a bit more precise.

the shader works without errors and the patch u sent me is the same like
mine.

my question refers to that it seems to me that the displacement is 
not dependent on color but on brightness.

best

erich

On Thu, 2010-04-29 at 17:46 +0200, jack at rybn.org wrote:
> Hello Erich,
> 
> No problem here on MacOSX.5.8 with pd-ext 0.41.4 and GEM 0.91.3 'tigital'.
> My graphic card here : ATI Radeon HD 2600 Pro
> What is your graphic card ?
> Do you have errors in Pd console ?
> 
> [glsl_program]: uvar#0: "MyTex": [glsl_program]: unknown (0x8B5E)
> [glsl_program]: uvar#1: "cr": [glsl_program]: GL_FLOAT
> [glsl_program]: uvar#2: "cg": [glsl_program]: GL_FLOAT
> [glsl_program]: uvar#3: "cb": [glsl_program]: GL_FLOAT
> [glsl_program]: uvar#4: "gl_ModelViewProjectionMatrix": [glsl_program]:
> GL_FLOAT_MAT4_ARB
> 
> Here my patch where you need to change the messages cr, cg, cb.
> I use your vertex shader and the fragment shader with 'gl_FragColor =  C;'
> ++
> 
> Jack
> 
> 
> 
> > hello,
> >
> > i changed the fetching.vert shader so that i would be able to
> > access rgb individually for shifting the vertices,
> > but the result does not suggest that.
> >
> > is
> >   vec4 color = texture2D(MyTex, gl_MultiTexCoord0.st)
> > not a vector with RGBA of a single vertex ?
> >
> > best
> >
> > erich
> >
> >
> > here the shader:
> >
> > uniform float cr, cg, cb;
> > uniform sampler2D MyTex;
> > varying vec4 C;
> > void main()
> > {
> > 	vec4 v = vec4(gl_Vertex);
> > 	vec4 color = texture2D(MyTex, gl_MultiTexCoord0.st);
> > 	v.z = color.r*cr + color.g*cg +color.b*cb;
> > //	v.x += (color.b-0.5)/2.;
> > //	v.y += (color.g-0.5)/2.;
> >
> > 	C=color;
> > 	gl_Position = gl_ModelViewProjectionMatrix * v;
> >
> > }
> >
> >
> > _______________________________________________
> > GEM-dev mailing list
> > GEM-dev at iem.at
> > http://lists.puredata.info/listinfo/gem-dev
> >
> _______________________________________________
> GEM-dev mailing list
> GEM-dev at iem.at
> http://lists.puredata.info/listinfo/gem-dev






More information about the GEM-dev mailing list