Hello
i am looking for an example patch, or how to for multitexturing. Im
trying to port some GLSL shaders that implement mixers over to GEM.
How do I get gl_TextureMatrix[0] and [1], etc so to speak onto a rect?
thanks, forgive me if this is obvious, but I looked around and did
not see any example code.
v a d e //
www.vade.info abstrakt.vade.info
I use a [pix_image] and a [pix_texture]
In the glsl examples that we got earlier, this branch came after the [glsl_propgram]
This patch lets you create a gem window and load an image onto a square:
#N canvas 594 525 584 536 10; #N canvas 811 737 462 312 gemwin 0; #X obj 117 128 gemwin; #X obj 215 76 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 ; #X msg 140 52 create; #X msg 133 23 ambient 0.2 0.2 0.9; #X msg 125 -2 lighting $1; #X obj 125 -24 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1; #X msg 148 79 destroy; #X msg 21 69 fullscreen $1; #X obj 33 40 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 ; #X obj 286 26 select 1; #X obj 286 2 inlet; #X obj 125 -45 inlet; #X obj 137 206 pix_write; #X msg 183 131 file /Users/beau/test.tif; #X msg 42 129 bang; #X obj 123 163 gemhead 21; #X connect 1 0 0 0; #X connect 2 0 0 0; #X connect 3 0 0 0; #X connect 4 0 0 0; #X connect 5 0 4 0; #X connect 6 0 0 0; #X connect 7 0 0 0; #X connect 8 0 7 0; #X connect 9 0 2 0; #X connect 9 0 1 0; #X connect 9 1 1 0; #X connect 9 1 6 0; #X connect 10 0 9 0; #X connect 11 0 5 0; #X connect 13 0 12 0; #X connect 14 0 12 0; #X connect 15 0 12 0; #X restore 59 -38 pd gemwin; #X obj 59 -63 tgl 15 0 empty empty lighting 0 -6 0 8 -262144 -1 -1 0 1; #X obj 117 -64 tgl 15 0 empty empty Render 0 -6 0 8 -262144 -1 -1 0 1; #X obj 190 -61 gemhead 10; #X obj 275 207 translateXYZ; #X obj 323 299 scaleXYZ; #X obj 326 327 square; #X obj 258 100 pix_texture; #X obj 232 55 pix_image; #X floatatom 298 125 5 0 0 0 - - -; #X obj 292 160 * 0.1; #X floatatom 350 123 5 0 0 0 - - -; #X obj 345 158 * 0.1; #X floatatom 398 135 5 0 0 0 - - -; #X obj 397 158 * 0.1; #X obj 320 230 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 10 -262144 -1 -1 0 256; #X obj 386 230 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 10 -262144 -1 -1 0 256; #X obj 319 251 * 0.1; #X obj 386 250 * 0.1; #X obj 451 228 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 10 -262144 -1 -1 0 256; #X obj 451 250 * 0.1; #X obj 313 -49 openpanel; #X msg 294 -7 open $1; #X obj 328 -84 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X connect 1 0 0 0; #X connect 2 0 0 1; #X connect 3 0 8 0; #X connect 4 0 5 0; #X connect 5 0 6 0; #X connect 7 0 4 0; #X connect 8 0 7 0; #X connect 9 0 10 0; #X connect 10 0 4 1; #X connect 11 0 12 0; #X connect 12 0 4 2; #X connect 13 0 14 0; #X connect 14 0 4 3; #X connect 15 0 17 0; #X connect 16 0 18 0; #X connect 17 0 5 1; #X connect 18 0 5 2; #X connect 19 0 20 0; #X connect 20 0 5 3; #X connect 21 0 22 0; #X connect 22 0 8 0; #X connect 23 0 21 0;
Erm... thats nice and well, but I need to get *more than one texture
onto a rect* , or into a GLSL program so I can crossfade/mix in the
GLSL shader itself.
So I need more than one pix_texture on one rect. I know how to do
basic single texturing - I *can* read the docs :)
On Jun 29, 2007, at 3:50 PM, Cypod wrote:
v a d e //
www.vade.info abstrakt.vade.info
How about adding a second head on there and throwing a [pix_mix] in between:
#N canvas 597 522 588 540 10; #N canvas 811 737 462 312 gemwin 0; #X obj 117 128 gemwin; #X obj 215 76 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1 1 ; #X msg 140 52 create; #X msg 133 23 ambient 0.2 0.2 0.9; #X msg 125 -2 lighting $1; #X obj 125 -24 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1; #X msg 148 79 destroy; #X msg 21 69 fullscreen $1; #X obj 33 40 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 ; #X obj 286 26 select 1; #X obj 286 2 inlet; #X obj 125 -45 inlet; #X obj 137 206 pix_write; #X msg 183 131 file /Users/beau/test.tif; #X msg 42 129 bang; #X obj 123 163 gemhead 21; #X connect 1 0 0 0; #X connect 2 0 0 0; #X connect 3 0 0 0; #X connect 4 0 0 0; #X connect 5 0 4 0; #X connect 6 0 0 0; #X connect 7 0 0 0; #X connect 8 0 7 0; #X connect 9 0 2 0; #X connect 9 0 1 0; #X connect 9 1 1 0; #X connect 9 1 6 0; #X connect 10 0 9 0; #X connect 11 0 5 0; #X connect 13 0 12 0; #X connect 14 0 12 0; #X connect 15 0 12 0; #X restore 59 -38 pd gemwin; #X obj 59 -63 tgl 15 0 empty empty lighting 0 -6 0 8 -262144 -1 -1 0 1; #X obj 117 -64 tgl 15 0 empty empty Render 0 -6 0 8 -262144 -1 -1 1 1; #X obj 190 -61 gemhead 10; #X obj 275 207 translateXYZ; #X obj 323 299 scaleXYZ; #X obj 194 166 pix_texture; #X obj 221 48 pix_image; #X floatatom 298 125 5 0 0 0 - - -; #X obj 292 160 * 0.1; #X floatatom 350 123 5 0 0 0 - - -; #X obj 345 158 * 0.1; #X floatatom 398 135 5 0 0 0 - - -; #X obj 397 158 * 0.1; #X obj 320 230 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 10 -262144 -1 -1 0 256; #X obj 386 230 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 10 -262144 -1 -1 0 256; #X obj 319 251 * 0.1; #X obj 386 250 * 0.1; #X obj 451 228 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 10 -262144 -1 -1 0 256; #X obj 451 250 * 0.1; #X obj 313 -49 openpanel; #X msg 294 -7 open $1; #X obj 328 -84 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 408 36 pix_image; #X obj 512 -47 openpanel; #X msg 493 -5 open $1; #X obj 527 -82 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 420 -62 gemhead 12; #X text 41 -4 Set to 3 for effect; #X obj 415 -86 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1 1; #X obj 197 -89 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1 1; #X obj 195 -2 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 10 -262144 -1 -1 0.5 256; #X obj 347 11 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 10 -262144 -1 -1 0 256; #X obj 219 87 pix_mix; #X obj 326 326 square 3; #X obj 346 79 hsl 128 15 0 1 0 0 empty empty empty -2 -6 0 8 -262144 -1 -1 6400 1; #X connect 1 0 0 0; #X connect 2 0 0 1; #X connect 3 0 7 0; #X connect 4 0 5 0; #X connect 5 0 34 0; #X connect 6 0 4 0; #X connect 7 0 33 0; #X connect 8 0 9 0; #X connect 9 0 4 1; #X connect 10 0 11 0; #X connect 11 0 4 2; #X connect 12 0 13 0; #X connect 13 0 4 3; #X connect 14 0 16 0; #X connect 15 0 17 0; #X connect 16 0 5 1; #X connect 17 0 5 2; #X connect 18 0 19 0; #X connect 19 0 5 3; #X connect 20 0 21 0; #X connect 21 0 7 0; #X connect 22 0 20 0; #X connect 23 0 33 1; #X connect 24 0 25 0; #X connect 25 0 23 0; #X connect 26 0 24 0; #X connect 27 0 23 0; #X connect 29 0 27 0; #X connect 30 0 3 0; #X connect 33 0 6 0; #X connect 35 0 33 2;
The previous posts example:
#N canvas 597 522 588 540 10; #N canvas 811 737 462 312 gemwin 0; #X obj 117 128 gemwin; #X obj 215 76 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1 1 ; #X msg 140 52 create; #X msg 133 23 ambient 0.2 0.2 0.9; #X msg 125 -2 lighting $1; #X obj 125 -24 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1; #X msg 148 79 destroy; #X msg 21 69 fullscreen $1; #X obj 33 40 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 ; #X obj 286 26 select 1; #X obj 286 2 inlet; #X obj 125 -45 inlet; #X obj 137 206 pix_write; #X msg 183 131 file /Users/beau/test.tif; #X msg 42 129 bang; #X obj 123 163 gemhead 21; #X connect 1 0 0 0; #X connect 2 0 0 0; #X connect 3 0 0 0; #X connect 4 0 0 0; #X connect 5 0 4 0; #X connect 6 0 0 0; #X connect 7 0 0 0; #X connect 8 0 7 0; #X connect 9 0 2 0; #X connect 9 0 1 0; #X connect 9 1 1 0; #X connect 9 1 6 0; #X connect 10 0 9 0; #X connect 11 0 5 0; #X connect 13 0 12 0; #X connect 14 0 12 0; #X connect 15 0 12 0; #X restore 59 -38 pd gemwin; #X obj 59 -63 tgl 15 0 empty empty lighting 0 -6 0 8 -262144 -1 -1 0 1; #X obj 117 -64 tgl 15 0 empty empty Render 0 -6 0 8 -262144 -1 -1 1 1; #X obj 190 -61 gemhead 10; #X obj 275 207 translateXYZ; #X obj 323 299 scaleXYZ; #X obj 194 166 pix_texture; #X obj 221 48 pix_image; #X floatatom 298 125 5 0 0 0 - - -; #X obj 292 160 * 0.1; #X floatatom 350 123 5 0 0 0 - - -; #X obj 345 158 * 0.1; #X floatatom 398 135 5 0 0 0 - - -; #X obj 397 158 * 0.1; #X obj 320 230 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 10 -262144 -1 -1 0 256; #X obj 386 230 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 10 -262144 -1 -1 0 256; #X obj 319 251 * 0.1; #X obj 386 250 * 0.1; #X obj 451 228 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 10 -262144 -1 -1 0 256; #X obj 451 250 * 0.1; #X obj 313 -49 openpanel; #X msg 294 -7 open $1; #X obj 328 -84 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 408 36 pix_image; #X obj 512 -47 openpanel; #X msg 493 -5 open $1; #X obj 527 -82 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 420 -62 gemhead 12; #X text 41 -4 Set to 3 for effect; #X obj 415 -86 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1 1; #X obj 197 -89 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1 1; #X obj 195 -2 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 10 -262144 -1 -1 0.5 256; #X obj 347 11 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 10 -262144 -1 -1 0 256; #X obj 219 87 pix_mix; #X obj 326 326 square 3; #X obj 346 79 hsl 128 15 0 1 0 0 empty empty empty -2 -6 0 8 -262144 -1 -1 6400 1; #X connect 1 0 0 0; #X connect 2 0 0 1; #X connect 3 0 7 0; #X connect 4 0 5 0; #X connect 5 0 34 0; #X connect 6 0 4 0; #X connect 7 0 33 0; #X connect 8 0 9 0; #X connect 9 0 4 1; #X connect 10 0 11 0; #X connect 11 0 4 2; #X connect 12 0 13 0; #X connect 13 0 4 3; #X connect 14 0 16 0; #X connect 15 0 17 0; #X connect 16 0 5 1; #X connect 17 0 5 2; #X connect 18 0 19 0; #X connect 19 0 5 3; #X connect 20 0 21 0; #X connect 21 0 7 0; #X connect 22 0 20 0; #X connect 23 0 33 1; #X connect 24 0 25 0; #X connect 25 0 23 0; #X connect 26 0 24 0; #X connect 27 0 23 0; #X connect 29 0 27 0; #X connect 30 0 3 0; #X connect 33 0 6 0; #X connect 35 0 33 2;
youre clearly not listening to me. I want to run my own mixing
algorithms within a GLSL shader which needs to reference 2 or more
textures.
pix_mix is not what I need.
v a d e //
www.vade.info abstrakt.vade.info
I hope you figure it out man, cause I would really like to know how its done
On 6/29/07, vade doktorp@mac.com wrote:
youre clearly not listening to me. I want to run my own mixing algorithms within a GLSL shader which needs to reference 2 or more textures.
pix_mix is not what I need.
v a d e //
www.vade.info abstrakt.vade.info
hello,
this has been discuss in the past on gem-dev mailing list.
http://lists.puredata.info/pipermail/gem-dev/2005-09/001273.html http://lists.puredata.info/pipermail/gem-dev/2005-12/001497.html http://lists.puredata.info/pipermail/gem-dev/2006-08/002197.html http://lists.puredata.info/pipermail/gem-dev/2006-09/002202.html http://lists.puredata.info/pipermail/gem-dev/2007-05/002665.html
well, i'm still not able to use multiple texture with gem and it's very frustrating.
cyrille
vade a écrit :
Hello
i am looking for an example patch, or how to for multitexturing. Im trying to port some GLSL shaders that implement mixers over to GEM. How do I get gl_TextureMatrix[0] and [1], etc so to speak onto a rect?
thanks, forgive me if this is obvious, but I looked around and did not see any example code.
v a d e //
www.vade.info abstrakt.vade.info
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Anton
You want to set the texture unit that pix_texture uses correct? pix_texture should take a 'texunit $1' (or texUnit) message to do this. Multitexturing was one of Jamie's projects which remains unfinished...
Send me a shader to work with if you can't get it working.
On 6/29/07, vade doktorp@mac.com wrote:
Hello
i am looking for an example patch, or how to for multitexturing. Im trying to port some GLSL shaders that implement mixers over to GEM. How do I get gl_TextureMatrix[0] and [1], etc so to speak onto a rect?
thanks, forgive me if this is obvious, but I looked around and did not see any example code.
*v a d e //*
*www.vade.info* *abstrakt.vade.info*
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
now my secret identity is known. my vigilante days are numbered!
:)
Here is a sample fragment shader that implements one of the blend
modes (overlay) for A/B mixing. If you can show me how to get this
working in a patch that has two texture inputs for one rect object at
the end of a gemhead render chain, that would really be awesome, and
I could wrap it easily in an abstraction.
Thanks for taking the time to look at it. Yeah, I know, weird Jitter
texcoord template, deal with it :)
---- fragment shader uniform vec4 amount;
// define our rectangular texture samplers uniform sampler2DRect tex0; uniform sampler2DRect tex1;
// define our varying texture coordinates varying vec2 texcoord0; varying vec2 texcoord1;
vec4 one = vec4(1.0); vec4 two = vec4(2.0); vec4 lumcoeff = vec4(0.2125,0.7154,0.0721,0.0);
vec4 overlay(vec4 myInput, vec4 previousmix, vec4 amount) { float luminance = dot(previousmix,lumcoeff); float mixamount = clamp((luminance - 0.45) * 10., 0., 1.);
vec4 branch1 = two * previousmix * myInput;
vec4 branch2 = one - (two * (one - previousmix) * (one - myInput));
vec4 result = mix(branch1, branch2, vec4(mixamount) );
vec4 mixresult = mix(previousmix, result, amount);
return mixresult;
}
void main(void) { vec4 input0 = texture2DRect(tex0, texcoord0); vec4 input1 = texture2DRect(tex1, texcoord1);
vec4 mix1 = overlay(input1, input0, amount* two );
vec4 mix2 = overlay(input0, input1, (1.0 - amount) * two );
vec4 result = mix(vec4(mix1.rgb,1.),vec4(mix2.rgb,1), amount);
gl_FragColor = result;
}
---- vert shader
varying vec2 texcoord0; varying vec2 texcoord1;
void main() { // perform standard transform on vertex gl_Position = ftransform();
// transform texcoords
texcoord0 = vec2(gl_TextureMatrix[0] * gl_MultiTexCoord0);
texcoord1 = vec2(gl_TextureMatrix[1] * gl_MultiTexCoord1);
}
On Jul 1, 2007, at 11:47 AM, chris clepper wrote:
Anton
You want to set the texture unit that pix_texture uses correct?
pix_texture should take a 'texunit $1' (or texUnit) message to do
this. Multitexturing was one of Jamie's projects which remains
unfinished...Send me a shader to work with if you can't get it working.
On 6/29/07, vade doktorp@mac.com wrote: Hello
i am looking for an example patch, or how to for multitexturing. Im
trying to port some GLSL shaders that implement mixers over to GEM.
How do I get gl_TextureMatrix[0] and [1], etc so to speak onto a rect?thanks, forgive me if this is obvious, but I looked around and did
not see any example code.v a d e //
www.vade.info abstrakt.vade.info
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/ listinfo/pd-list
v a d e //
www.vade.info abstrakt.vade.info
This thread is getting nice and infotacious.
~Kyle
On 7/1/07, vade doktorp@mac.com wrote:
now my secret identity is known. my vigilante days are numbered!
:)
Here is a sample fragment shader that implements one of the blend modes (overlay) for A/B mixing. If you can show me how to get this working in a patch that has two texture inputs for one rect object at the end of a gemhead render chain, that would really be awesome, and I could wrap it easily in an abstraction.
Thanks for taking the time to look at it. Yeah, I know, weird Jitter texcoord template, deal with it :)
---- fragment shader uniform vec4 amount;
// define our rectangular texture samplers uniform sampler2DRect tex0; uniform sampler2DRect tex1;
// define our varying texture coordinates varying vec2 texcoord0; varying vec2 texcoord1;
vec4 one = vec4(1.0); vec4 two = vec4(2.0); vec4 lumcoeff = vec4(0.2125,0.7154,0.0721,0.0);
vec4 overlay(vec4 myInput, vec4 previousmix, vec4 amount) { float luminance = dot(previousmix,lumcoeff); float mixamount = clamp((luminance - 0.45) * 10., 0., 1.);
vec4 branch1 = two * previousmix * myInput; vec4 branch2 = one - (two * (one - previousmix) * (one - myInput));
vec4 result = mix(branch1, branch2, vec4(mixamount) ); vec4 mixresult = mix(previousmix, result, amount);
return mixresult; }
void main(void) { vec4 input0 = texture2DRect(tex0, texcoord0); vec4 input1 = texture2DRect(tex1, texcoord1);
vec4 mix1 = overlay(input1, input0, amount* two ); vec4 mix2 = overlay(input0, input1, (1.0 - amount) * two );
vec4 result = mix(vec4(mix1.rgb,1.),vec4(mix2.rgb,1), amount);
gl_FragColor = result; } ---- vert shader
varying vec2 texcoord0; varying vec2 texcoord1;
void main() { // perform standard transform on vertex gl_Position = ftransform();
// transform texcoords texcoord0 = vec2(gl_TextureMatrix[0] * gl_MultiTexCoord0); texcoord1 = vec2(gl_TextureMatrix[1] * gl_MultiTexCoord1);
}
On Jul 1, 2007, at 11:47 AM, chris clepper wrote:
Anton
You want to set the texture unit that pix_texture uses correct? pix_texture should take a 'texunit $1' (or texUnit) message to do this. Multitexturing was one of Jamie's projects which remains unfinished...
Send me a shader to work with if you can't get it working.
On 6/29/07, vade doktorp@mac.com wrote:
Hello
i am looking for an example patch, or how to for multitexturing. Im trying
to port some GLSL shaders that implement mixers over to GEM. How do I get gl_TextureMatrix[0] and [1], etc so to speak onto a rect?
thanks, forgive me if this is obvious, but I looked around and did not see
any example code.
v a d e //
www.vade.info abstrakt.vade.info
PD-list@iem.at mailing list UNSUBSCRIBE and account-management ->
http://lists.puredata.info/listinfo/pd-list
v a d e //
www.vade.info abstrakt.vade.info
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Well, ive released the beta for Jitter. You guys are free to port
whatever you want, but Ive heard nothing on the multitexturing side
of things for PD. Im a bit saddened by that, but, whatever.
http://001.vade.info has the jxs files, help files, shaders and
example content.
Hopefully this can get sorted out soon enough.
v a d e //
www.vade.info abstrakt.vade.info
Did you try my suggestion to send a 'texunit $1' message to pix_texture? It sets the texture unit for the shader to read from.
On 7/5/07, vade doktorp@mac.com wrote:
Well, ive released the beta for Jitter. You guys are free to port whatever you want, but Ive heard nothing on the multitexturing side of things for PD. Im a bit saddened by that, but, whatever.
http://001.vade.info has the jxs files, help files, shaders and example content.
Hopefully this can get sorted out soon enough.
v a d e //
www.vade.info abstrakt.vade.info
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
chris clepper a écrit :
Did you try my suggestion to send a 'texunit $1' message to pix_texture? It sets the texture unit for the shader to read from.
do you mean having 2 pix_texture one after the other in order to load 2 diferent pix?
i tried this patch (to be used with vade shader), with no succes.
cyrille
On 7/5/07, vade doktorp@mac.com wrote:
Well, ive released the beta for Jitter. You guys are free to port whatever you want, but Ive heard nothing on the multitexturing side of things for PD. Im a bit saddened by that, but, whatever.
http://001.vade.info has the jxs files, help files, shaders and example content.
Hopefully this can get sorted out soon enough.
v a d e //
www.vade.info abstrakt.vade.info
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
#N canvas 47 25 932 764 10; #X obj 30 29 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 0; #N canvas 0 22 462 312 gemwin 0; #X obj 132 136 gemwin; #X obj 67 89 outlet; #X obj 67 10 inlet; #X obj 67 41 route create; #X msg 67 70 set destroy; #X msg 142 68 set create; #X msg 132 112 create , 1; #X msg 198 112 destroy; #X obj 306 45 inlet; #X connect 2 0 3 0; #X connect 3 0 4 0; #X connect 3 0 6 0; #X connect 3 1 5 0; #X connect 3 1 7 0; #X connect 4 0 1 0; #X connect 5 0 1 0; #X connect 6 0 0 0; #X connect 7 0 0 0; #X connect 8 0 0 0; #X restore 35 68 pd gemwin; #X msg 35 49 destroy; #X text 31 28 Create window:; #X floatatom 285 205 5 0 0 0 - - -; #X obj 398 148 openpanel; #X msg 397 169 open $1; #X obj 398 129 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 195 109 gemhead 1; #X obj 195 256 rectangle 1 1; #X obj 396 267 rectangle 1 1; #X obj 674 118 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1; #X msg 55 442 mode $1; #X obj 56 421 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1 1 ; #X obj 674 137 gemhead 50; #X obj 415 107 gemhead 20; #X obj 104 48 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 ; #X obj 55 462 s mode; #X obj 612 587 r mode; #X text 37 402 mode 0 doesn't!; #X obj 147 208 r mode; #X obj 339 219 r mode; #X text 164 7 these are just conveniences to open similar sized movies ; #X text 37 388 mode 1 works (default); #X obj 396 192 pix_image; #X obj 195 190 pix_image; #X obj 210 147 openpanel; #X msg 209 168 open $1; #X obj 210 128 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X msg 629 220 print; #X obj 747 451 pack 0 0; #X msg 631 332 print; #X obj 768 431 t b f; #X obj 764 386 change; #X obj 746 261 change; #X msg 747 477 link $1 $2; #X msg 634 497 print; #X floatatom 768 412 2 0 0 0 ID - -; #X floatatom 746 284 2 0 0 0 ID - -; #X obj 765 498 print linking; #X obj 674 242 glsl_vertex; #X obj 674 366 glsl_fragment; #X obj 787 180 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1; #X floatatom 498 209 5 0 0 0 - - -; #X msg 434 82 open img1.jpg; #X msg 225 77 open img2.jpg; #X obj 676 698 square 1; #X obj 676 673 translateXYZ 0 -1.5 0; #X floatatom 755 560 5 0 0 0 - - -; #X obj 676 536 glsl_program; #X msg 267 343 texUnit 1 $1; #X msg 468 343 texUnit 0 $1; #X obj 195 234 translateXYZ -3 0 0; #X obj 396 241 translateXYZ 3 0 0; #X obj 676 588 pix_texture; #X msg 496 428 texunit 0; #X msg 504 450 texunit 1; #X msg 513 474 texunit 2; #X obj 396 218 pix_texture; #X obj 196 210 pix_texture; #X obj 677 626 pix_texture; #X msg 491 533 texunit 0; #X msg 499 555 texunit 1; #X msg 508 579 texunit 2; #X msg 688 220 open vade.vert; #X msg 684 336 open vade.frag; #X obj 390 424 loadbang; #X floatatom 838 309 5 0 0 0 - - -; #X msg 832 344 amount $1; #X connect 1 0 2 0; #X connect 2 0 1 0; #X connect 5 0 6 0; #X connect 6 0 24 0; #X connect 7 0 5 0; #X connect 8 0 25 0; #X connect 11 0 14 0; #X connect 12 0 17 0; #X connect 13 0 12 0; #X connect 14 0 40 0; #X connect 15 0 24 0; #X connect 16 0 1 1; #X connect 18 0 54 0; #X connect 20 0 59 0; #X connect 21 0 58 0; #X connect 24 0 58 0; #X connect 25 0 59 0; #X connect 26 0 27 0; #X connect 27 0 25 0; #X connect 28 0 26 0; #X connect 29 0 40 0; #X connect 30 0 35 0; #X connect 31 0 41 0; #X connect 32 0 30 0; #X connect 32 1 30 1; #X connect 33 0 37 0; #X connect 34 0 38 0; #X connect 35 0 39 0; #X connect 35 0 49 0; #X connect 36 0 49 0; #X connect 37 0 32 0; #X connect 38 0 30 0; #X connect 40 0 41 0; #X connect 40 1 34 0; #X connect 41 0 49 0; #X connect 41 1 33 0; #X connect 42 0 64 0; #X connect 42 0 65 0; #X connect 44 0 24 0; #X connect 45 0 25 0; #X connect 47 0 46 0; #X connect 49 0 54 0; #X connect 49 1 48 0; #X connect 52 0 9 0; #X connect 53 0 10 0; #X connect 54 0 60 0; #X connect 55 0 54 0; #X connect 56 0 54 0; #X connect 57 0 54 0; #X connect 58 0 53 0; #X connect 58 1 51 0; #X connect 58 1 43 0; #X connect 58 1 54 1; #X connect 59 0 52 0; #X connect 59 1 4 0; #X connect 59 1 50 0; #X connect 59 1 60 1; #X connect 60 0 47 0; #X connect 61 0 60 0; #X connect 62 0 60 0; #X connect 63 0 60 0; #X connect 64 0 40 0; #X connect 65 0 41 0; #X connect 66 0 55 0; #X connect 66 0 62 0; #X connect 67 0 68 0; #X connect 68 0 49 0;
The reason mode 1 works and mode 2 doesnt is because mode 1 uses
rectangular textures, since video is typically not power of 2 sized,
my samplers are created for rect textures.
However, using the patch cyrille:
loading the shader works
manipulating the amount uniform variable produces a visible result.
however, it is not as intended.
switching texunit 0 to 1 does switch the textures, but does seem to
apply a secondary texture. whichever is 0 shows. and seems to mix
only between the zeroth texture unit. not 0 and 1.
Thanks.
On Jul 5, 2007, at 6:04 PM, cyrille henry wrote:
chris clepper a écrit :
Did you try my suggestion to send a 'texunit $1' message to pix_texture? It sets the texture unit for the shader to read from.
do you mean having 2 pix_texture one after the other in order to
load 2 diferent pix?i tried this patch (to be used with vade shader), with no succes.
cyrille
On 7/5/07, vade doktorp@mac.com wrote:
Well, ive released the beta for Jitter. You guys are free to port
whatever you want, but Ive heard nothing on the multitexturing side of
things for PD. Im a bit saddened by that, but, whatever.http://001.vade.info has the jxs files, help files, shaders and
example content.Hopefully this can get sorted out soon enough.
v a d e //
www.vade.info abstrakt.vade.info
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
#N canvas 47 25 932 764 10; #X obj 30 29 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 0; #N canvas 0 22 462 312 gemwin 0; #X obj 132 136 gemwin; #X obj 67 89 outlet; #X obj 67 10 inlet; #X obj 67 41 route create; #X msg 67 70 set destroy; #X msg 142 68 set create; #X msg 132 112 create , 1; #X msg 198 112 destroy; #X obj 306 45 inlet; #X connect 2 0 3 0; #X connect 3 0 4 0; #X connect 3 0 6 0; #X connect 3 1 5 0; #X connect 3 1 7 0; #X connect 4 0 1 0; #X connect 5 0 1 0; #X connect 6 0 0 0; #X connect 7 0 0 0; #X connect 8 0 0 0; #X restore 35 68 pd gemwin; #X msg 35 49 destroy; #X text 31 28 Create window:; #X floatatom 285 205 5 0 0 0 - - -; #X obj 398 148 openpanel; #X msg 397 169 open $1; #X obj 398 129 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 195 109 gemhead 1; #X obj 195 256 rectangle 1 1; #X obj 396 267 rectangle 1 1; #X obj 674 118 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1; #X msg 55 442 mode $1; #X obj 56 421 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1 1 ; #X obj 674 137 gemhead 50; #X obj 415 107 gemhead 20; #X obj 104 48 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 ; #X obj 55 462 s mode; #X obj 612 587 r mode; #X text 37 402 mode 0 doesn't!; #X obj 147 208 r mode; #X obj 339 219 r mode; #X text 164 7 these are just conveniences to open similar sized movies ; #X text 37 388 mode 1 works (default); #X obj 396 192 pix_image; #X obj 195 190 pix_image; #X obj 210 147 openpanel; #X msg 209 168 open $1; #X obj 210 128 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X msg 629 220 print; #X obj 747 451 pack 0 0; #X msg 631 332 print; #X obj 768 431 t b f; #X obj 764 386 change; #X obj 746 261 change; #X msg 747 477 link $1 $2; #X msg 634 497 print; #X floatatom 768 412 2 0 0 0 ID - -; #X floatatom 746 284 2 0 0 0 ID - -; #X obj 765 498 print linking; #X obj 674 242 glsl_vertex; #X obj 674 366 glsl_fragment; #X obj 787 180 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1; #X floatatom 498 209 5 0 0 0 - - -; #X msg 434 82 open img1.jpg; #X msg 225 77 open img2.jpg; #X obj 676 698 square 1; #X obj 676 673 translateXYZ 0 -1.5 0; #X floatatom 755 560 5 0 0 0 - - -; #X obj 676 536 glsl_program; #X msg 267 343 texUnit 1 $1; #X msg 468 343 texUnit 0 $1; #X obj 195 234 translateXYZ -3 0 0; #X obj 396 241 translateXYZ 3 0 0; #X obj 676 588 pix_texture; #X msg 496 428 texunit 0; #X msg 504 450 texunit 1; #X msg 513 474 texunit 2; #X obj 396 218 pix_texture; #X obj 196 210 pix_texture; #X obj 677 626 pix_texture; #X msg 491 533 texunit 0; #X msg 499 555 texunit 1; #X msg 508 579 texunit 2; #X msg 688 220 open vade.vert; #X msg 684 336 open vade.frag; #X obj 390 424 loadbang; #X floatatom 838 309 5 0 0 0 - - -; #X msg 832 344 amount $1; #X connect 1 0 2 0; #X connect 2 0 1 0; #X connect 5 0 6 0; #X connect 6 0 24 0; #X connect 7 0 5 0; #X connect 8 0 25 0; #X connect 11 0 14 0; #X connect 12 0 17 0; #X connect 13 0 12 0; #X connect 14 0 40 0; #X connect 15 0 24 0; #X connect 16 0 1 1; #X connect 18 0 54 0; #X connect 20 0 59 0; #X connect 21 0 58 0; #X connect 24 0 58 0; #X connect 25 0 59 0; #X connect 26 0 27 0; #X connect 27 0 25 0; #X connect 28 0 26 0; #X connect 29 0 40 0; #X connect 30 0 35 0; #X connect 31 0 41 0; #X connect 32 0 30 0; #X connect 32 1 30 1; #X connect 33 0 37 0; #X connect 34 0 38 0; #X connect 35 0 39 0; #X connect 35 0 49 0; #X connect 36 0 49 0; #X connect 37 0 32 0; #X connect 38 0 30 0; #X connect 40 0 41 0; #X connect 40 1 34 0; #X connect 41 0 49 0; #X connect 41 1 33 0; #X connect 42 0 64 0; #X connect 42 0 65 0; #X connect 44 0 24 0; #X connect 45 0 25 0; #X connect 47 0 46 0; #X connect 49 0 54 0; #X connect 49 1 48 0; #X connect 52 0 9 0; #X connect 53 0 10 0; #X connect 54 0 60 0; #X connect 55 0 54 0; #X connect 56 0 54 0; #X connect 57 0 54 0; #X connect 58 0 53 0; #X connect 58 1 51 0; #X connect 58 1 43 0; #X connect 58 1 54 1; #X connect 59 0 52 0; #X connect 59 1 4 0; #X connect 59 1 50 0; #X connect 59 1 60 1; #X connect 60 0 47 0; #X connect 61 0 60 0; #X connect 62 0 60 0; #X connect 63 0 60 0; #X connect 64 0 40 0; #X connect 65 0 41 0; #X connect 66 0 55 0; #X connect 66 0 62 0; #X connect 67 0 68 0; #X connect 68 0 49 0; _______________________________________________ PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/ listinfo/pd-list
v a d e //
www.vade.info abstrakt.vade.info
sorry. let me clarify. long work day does not make me clear.
switching texunit switches the textures. however, mixing only occurs
between unit 0 and unit 0. Not between unit 0 and 1.
this is with Cyrille's patch.
Thanks.
On Jul 5, 2007, at 6:42 PM, vade wrote:
The reason mode 1 works and mode 2 doesnt is because mode 1 uses
rectangular textures, since video is typically not power of 2
sized, my samplers are created for rect textures.However, using the patch cyrille:
loading the shader works manipulating the amount uniform variable produces a visible result.
however, it is not as intended.switching texunit 0 to 1 does switch the textures, but does seem to
apply a secondary texture. whichever is 0 shows. and seems to mix
only between the zeroth texture unit. not 0 and 1.Thanks.
On Jul 5, 2007, at 6:04 PM, cyrille henry wrote:
chris clepper a écrit :
Did you try my suggestion to send a 'texunit $1' message to pix_texture? It sets the texture unit for the shader to read from.
do you mean having 2 pix_texture one after the other in order to
load 2 diferent pix?i tried this patch (to be used with vade shader), with no succes.
cyrille
On 7/5/07, vade doktorp@mac.com wrote:
Well, ive released the beta for Jitter. You guys are free to
port whatever you want, but Ive heard nothing on the multitexturing side of
things for PD. Im a bit saddened by that, but, whatever.http://001.vade.info has the jxs files, help files, shaders and
example content.Hopefully this can get sorted out soon enough.
v a d e //
www.vade.info abstrakt.vade.info
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
#N canvas 47 25 932 764 10; #X obj 30 29 cnv 15 100 60 empty empty empty 20 12 0 14 -195568
-66577 0; #N canvas 0 22 462 312 gemwin 0; #X obj 132 136 gemwin; #X obj 67 89 outlet; #X obj 67 10 inlet; #X obj 67 41 route create; #X msg 67 70 set destroy; #X msg 142 68 set create; #X msg 132 112 create , 1; #X msg 198 112 destroy; #X obj 306 45 inlet; #X connect 2 0 3 0; #X connect 3 0 4 0; #X connect 3 0 6 0; #X connect 3 1 5 0; #X connect 3 1 7 0; #X connect 4 0 1 0; #X connect 5 0 1 0; #X connect 6 0 0 0; #X connect 7 0 0 0; #X connect 8 0 0 0; #X restore 35 68 pd gemwin; #X msg 35 49 destroy; #X text 31 28 Create window:; #X floatatom 285 205 5 0 0 0 - - -; #X obj 398 148 openpanel; #X msg 397 169 open $1; #X obj 398 129 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 195 109 gemhead 1; #X obj 195 256 rectangle 1 1; #X obj 396 267 rectangle 1 1; #X obj 674 118 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1; #X msg 55 442 mode $1; #X obj 56 421 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1 1 ; #X obj 674 137 gemhead 50; #X obj 415 107 gemhead 20; #X obj 104 48 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 ; #X obj 55 462 s mode; #X obj 612 587 r mode; #X text 37 402 mode 0 doesn't!; #X obj 147 208 r mode; #X obj 339 219 r mode; #X text 164 7 these are just conveniences to open similar sized
movies ; #X text 37 388 mode 1 works (default); #X obj 396 192 pix_image; #X obj 195 190 pix_image; #X obj 210 147 openpanel; #X msg 209 168 open $1; #X obj 210 128 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X msg 629 220 print; #X obj 747 451 pack 0 0; #X msg 631 332 print; #X obj 768 431 t b f; #X obj 764 386 change; #X obj 746 261 change; #X msg 747 477 link $1 $2; #X msg 634 497 print; #X floatatom 768 412 2 0 0 0 ID - -; #X floatatom 746 284 2 0 0 0 ID - -; #X obj 765 498 print linking; #X obj 674 242 glsl_vertex; #X obj 674 366 glsl_fragment; #X obj 787 180 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1; #X floatatom 498 209 5 0 0 0 - - -; #X msg 434 82 open img1.jpg; #X msg 225 77 open img2.jpg; #X obj 676 698 square 1; #X obj 676 673 translateXYZ 0 -1.5 0; #X floatatom 755 560 5 0 0 0 - - -; #X obj 676 536 glsl_program; #X msg 267 343 texUnit 1 $1; #X msg 468 343 texUnit 0 $1; #X obj 195 234 translateXYZ -3 0 0; #X obj 396 241 translateXYZ 3 0 0; #X obj 676 588 pix_texture; #X msg 496 428 texunit 0; #X msg 504 450 texunit 1; #X msg 513 474 texunit 2; #X obj 396 218 pix_texture; #X obj 196 210 pix_texture; #X obj 677 626 pix_texture; #X msg 491 533 texunit 0; #X msg 499 555 texunit 1; #X msg 508 579 texunit 2; #X msg 688 220 open vade.vert; #X msg 684 336 open vade.frag; #X obj 390 424 loadbang; #X floatatom 838 309 5 0 0 0 - - -; #X msg 832 344 amount $1; #X connect 1 0 2 0; #X connect 2 0 1 0; #X connect 5 0 6 0; #X connect 6 0 24 0; #X connect 7 0 5 0; #X connect 8 0 25 0; #X connect 11 0 14 0; #X connect 12 0 17 0; #X connect 13 0 12 0; #X connect 14 0 40 0; #X connect 15 0 24 0; #X connect 16 0 1 1; #X connect 18 0 54 0; #X connect 20 0 59 0; #X connect 21 0 58 0; #X connect 24 0 58 0; #X connect 25 0 59 0; #X connect 26 0 27 0; #X connect 27 0 25 0; #X connect 28 0 26 0; #X connect 29 0 40 0; #X connect 30 0 35 0; #X connect 31 0 41 0; #X connect 32 0 30 0; #X connect 32 1 30 1; #X connect 33 0 37 0; #X connect 34 0 38 0; #X connect 35 0 39 0; #X connect 35 0 49 0; #X connect 36 0 49 0; #X connect 37 0 32 0; #X connect 38 0 30 0; #X connect 40 0 41 0; #X connect 40 1 34 0; #X connect 41 0 49 0; #X connect 41 1 33 0; #X connect 42 0 64 0; #X connect 42 0 65 0; #X connect 44 0 24 0; #X connect 45 0 25 0; #X connect 47 0 46 0; #X connect 49 0 54 0; #X connect 49 1 48 0; #X connect 52 0 9 0; #X connect 53 0 10 0; #X connect 54 0 60 0; #X connect 55 0 54 0; #X connect 56 0 54 0; #X connect 57 0 54 0; #X connect 58 0 53 0; #X connect 58 1 51 0; #X connect 58 1 43 0; #X connect 58 1 54 1; #X connect 59 0 52 0; #X connect 59 1 4 0; #X connect 59 1 50 0; #X connect 59 1 60 1; #X connect 60 0 47 0; #X connect 61 0 60 0; #X connect 62 0 60 0; #X connect 63 0 60 0; #X connect 64 0 40 0; #X connect 65 0 41 0; #X connect 66 0 55 0; #X connect 66 0 62 0; #X connect 67 0 68 0; #X connect 68 0 49 0; _______________________________________________ PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/ listinfo/pd-listv a d e //
www.vade.info abstrakt.vade.info
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/ listinfo/pd-list
v a d e //
www.vade.info abstrakt.vade.info
I managed to take a look at GLSL and multi-texturing for a few minutes. Here's what I found:
shaders I tried with multiple textures 4) Shader builder works exactly as expected using ARB_fragment
This is with a G5 and Nvidia GPU. I won't get back to this until Monday, but I suspect that some setup calls need to be updated or changed to match what the drivers want in order to access multiple textures.
For what it's worth, I only use ARB_fragment shaders in my own work. They seem to work better and more efficiently. I can post some shaders next week if anyone is interested.
On 7/5/07, vade doktorp@mac.com wrote:
sorry. let me clarify. long work day does not make me clear. switching texunit switches the textures. however, mixing only occurs between unit 0 and unit 0. Not between unit 0 and 1.
this is with Cyrille's patch.
Thanks.
Chris, thanks very much for looking into this. Im very curious why
the GLSL shaders work in Jitter, and even more so why they do not
work in Apples shader builder. Thats very interesting... as the code
im using is pretty straightforward (although I agree slightly ackward
in specifics)
If it would be in any way helpful, would you want me to ask specific
questions to the Jitter devs regarding their implementation and any
work arounds ? Id be more than happy to act as an interface, im sure
they would be happy to help if they can. Apologies if that is an
awkward request, im just trying to expedite a solution.
Thanks again for taking the time to check this out.
On Jul 5, 2007, at 10:11 PM, chris clepper wrote:
I managed to take a look at GLSL and multi-texturing for a few
minutes. Here's what I found:
- ARB_fragment works exactly as expected with multiple texture
units in GEM 2) GLSL does not work with the same GL setup commands in GEM 3) Apple's ShaderBuilder does not work with Anton's shader nor any
example shaders I tried with multiple textures 4) Shader builder works exactly as expected using ARB_fragmentThis is with a G5 and Nvidia GPU. I won't get back to this until
Monday, but I suspect that some setup calls need to be updated or
changed to match what the drivers want in order to access multiple
textures.For what it's worth, I only use ARB_fragment shaders in my own
work. They seem to work better and more efficiently. I can post
some shaders next week if anyone is interested.On 7/5/07, vade doktorp@mac.com wrote: sorry. let me clarify. long work day does not make me clear.
switching texunit switches the textures. however, mixing only
occurs between unit 0 and unit 0. Not between unit 0 and 1.this is with Cyrille's patch.
Thanks.
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/ listinfo/pd-list
v a d e //
www.vade.info abstrakt.vade.info
Yes, please do ask the Jitter devs about this. There does not seem to be too much overlap between Gem and Jitter (at least from what is visible on Pd-list), so your 'lubrication' for their interaction would be appreciated.
~Kyle
On 7/6/07, vade doktorp@mac.com wrote:
Chris, thanks very much for looking into this. Im very curious why the GLSL shaders work in Jitter, and even more so why they do not work in Apples shader builder. Thats very interesting... as the code im using is pretty straightforward (although I agree slightly ackward in specifics)
If it would be in any way helpful, would you want me to ask specific questions to the Jitter devs regarding their implementation and any work arounds ? Id be more than happy to act as an interface, im sure they would be happy to help if they can. Apologies if that is an awkward request, im just trying to expedite a solution.
Thanks again for taking the time to check this out.
On Jul 5, 2007, at 10:11 PM, chris clepper wrote:
I managed to take a look at GLSL and multi-texturing for a few minutes. Here's what I found:
- ARB_fragment works exactly as expected with multiple texture units in GEM
- GLSL does not work with the same GL setup commands in GEM
- Apple's ShaderBuilder does not work with Anton's shader nor any example
shaders I tried with multiple textures 4) Shader builder works exactly as expected using ARB_fragment
This is with a G5 and Nvidia GPU. I won't get back to this until Monday, but I suspect that some setup calls need to be updated or changed to match what the drivers want in order to access multiple textures.
For what it's worth, I only use ARB_fragment shaders in my own work. They seem to work better and more efficiently. I can post some shaders next week if anyone is interested.
On 7/5/07, vade doktorp@mac.com wrote:
sorry. let me clarify. long work day does not make me clear.
switching texunit switches the textures. however, mixing only occurs
between unit 0 and unit 0. Not between unit 0 and 1.
this is with Cyrille's patch.
Thanks.
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
v a d e //
www.vade.info abstrakt.vade.info
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Er. Im not sure I like the term 'lubrication' for this particular
type of transaction. :)
Although I am used to getting fucked by graphics environments. *cough*.
Im still curious what Chris has to say however.
On Jul 6, 2007, at 6:07 PM, Kyle Klipowicz wrote:
Yes, please do ask the Jitter devs about this. There does not seem to be too much overlap between Gem and Jitter (at least from what is visible on Pd-list), so your 'lubrication' for their interaction would be appreciated.
~Kyle
v a d e //
www.vade.info abstrakt.vade.info
I would be curious to know what Josh/c74 have to say. This is probably a very minor issue that requires a little research and testing to fix.
On 7/6/07, vade doktorp@mac.com wrote:
Chris, thanks very much for looking into this. Im very curious why the GLSL shaders work in Jitter, and even more so why they do not work in Apples shader builder. Thats very interesting... as the code im using is pretty straightforward (although I agree slightly ackward in specifics) If it would be in any way helpful, would you want me to ask specific questions to the Jitter devs regarding their implementation and any work arounds ? Id be more than happy to act as an interface, im sure they would be happy to help if they can. Apologies if that is an awkward request, im just trying to expedite a solution.
Thanks again for taking the time to check this out.
On Jul 5, 2007, at 10:11 PM, chris clepper wrote:
I managed to take a look at GLSL and multi-texturing for a few minutes. Here's what I found:
- ARB_fragment works exactly as expected with multiple texture units in
GEM 2) GLSL does not work with the same GL setup commands in GEM 3) Apple's ShaderBuilder does not work with Anton's shader nor any example shaders I tried with multiple textures 4) Shader builder works exactly as expected using ARB_fragment
This is with a G5 and Nvidia GPU. I won't get back to this until Monday, but I suspect that some setup calls need to be updated or changed to match what the drivers want in order to access multiple textures.
For what it's worth, I only use ARB_fragment shaders in my own work. They seem to work better and more efficiently. I can post some shaders next week if anyone is interested.
On 7/5/07, vade doktorp@mac.com wrote:
sorry. let me clarify. long work day does not make me clear. switching texunit switches the textures. however, mixing only occurs between unit 0 and unit 0. Not between unit 0 and 1.
this is with Cyrille's patch.
Thanks.
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
*v a d e //*
*www.vade.info* *abstrakt.vade.info*
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
hello,
chris clepper a écrit :
I managed to take a look at GLSL and multi-texturing for a few minutes. Here's what I found:
- ARB_fragment works exactly as expected with multiple texture units in
GEM 2) GLSL does not work with the same GL setup commands in GEM 3) Apple's ShaderBuilder does not work with Anton's shader nor any example shaders I tried with multiple textures 4) Shader builder works exactly as expected using ARB_fragment
This is with a G5 and Nvidia GPU. I won't get back to this until Monday, but I suspect that some setup calls need to be updated or changed to match what the drivers want in order to access multiple textures.
For what it's worth, I only use ARB_fragment shaders in my own work. They seem to work better and more efficiently. I can post some shaders next week if anyone is interested.
yes, i am interested!
thanks a lot Cyrille
On 7/5/07, vade doktorp@mac.com wrote:
sorry. let me clarify. long work day does not make me clear. switching texunit switches the textures. however, mixing only occurs between unit 0 and unit 0. Not between unit 0 and 1.
this is with Cyrille's patch.
Thanks.
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
I have attached a very simple patch and shader for adding two textures together.
The shader needs to be loaded after window creation and rendering starts to work correctly. The shader has some basic comments about what the commands do. You can replace the ADD with MUL to get a different effect to get started.
hello,
thanks a lot for this exemple. it work great.
do you know a good online or printed resource for learning ARB fragments?
thanks Cyrille
chris clepper a écrit :
I have attached a very simple patch and shader for adding two textures together.
The shader needs to be loaded after window creation and rendering starts to work correctly. The shader has some basic comments about what the commands do. You can replace the ADD with MUL to get a different effect to get started.
!!ARBfp1.0
#basic multi-texture shader #adds two textures together
#Declarations TEMP tmp, tmp1; TEMP curr;
#grab the texture coords ATTRIB tex = fragment.texcoord[0]; ATTRIB tex1 = fragment.texcoord[0];
#set output OUTPUT out = result.color;
#pick which texture unit to get the pixels from #texture[x] selects the texunit TEX tmp, tex, texture[0], RECT; TEX tmp1, tex1, texture[1], RECT;
#simple addition of the pixels ADD out, tmp, tmp1;
END
http://oss.sgi.com/projects/ogl-sample/registry/ARB/fragment_program.txt
Section 3.11.5 has all of the instructions.
On 7/12/07, cyrille henry cyrille.henry@la-kitchen.fr wrote:
hello,
thanks a lot for this exemple. it work great.
do you know a good online or printed resource for learning ARB fragments?
thanks Cyrille
hello, this is not the best documentation ever, but i'll investigate.
cyrille
chris clepper a écrit :
http://oss.sgi.com/projects/ogl-sample/registry/ARB/fragment_program.txt
Section 3.11.5 has all of the instructions.
On 7/12/07, cyrille henry cyrille.henry@la-kitchen.fr wrote:
hello,
thanks a lot for this exemple. it work great.
do you know a good online or printed resource for learning ARB fragments?
thanks Cyrille
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
It is the ARB tech spec which is not a How-to guide. It does give you the arguments for the instructions.
I have figured out what the GLSL multitexture problem is and have it working here. If I have a few hours today I can work on making it usable, but it will probably be next week before it is done.
On 7/12/07, cyrille henry cyrille.henry@la-kitchen.fr wrote:
hello, this is not the best documentation ever, but i'll investigate.
cyrille
chris clepper a écrit :
http://oss.sgi.com/projects/ogl-sample/registry/ARB/fragment_program.txt
Section 3.11.5 has all of the instructions.
chris clepper a écrit :
It is the ARB tech spec which is not a How-to guide. It does give you the arguments for the instructions.
yes, i saw that.
I have figured out what the GLSL multitexture problem is and have it working here. If I have a few hours today I can work on making it usable, but it will probably be next week before it is done.
wow, nice thanks a lot.
cyrille
On 7/12/07, cyrille henry cyrille.henry@la-kitchen.fr wrote:
hello, this is not the best documentation ever, but i'll investigate.
cyrille
chris clepper a écrit :
http://oss.sgi.com/projects/ogl-sample/registry/ARB/fragment_program.txt
Section 3.11.5 has all of the instructions.
I have multitexturing working with GLSL. While I upload the changes to CVS I can explain how it works.
GLSL shaders cannot directly talk to hardware like ARB ones can. The application side code has to tell the shader which hardware texture unit to use. Obviously when I compile GEM there is no way in hell to know what the shader variables are going to be named, so another method to tell the shader which unit to use needs to be in place.
One solution is to hardcode the names of the sampler variables, but that is kind of a hack. The one I put in place uses a message to the glsl_program object with the name of the sampler and the texture unit to use.
How to use:
you told the shader to use with a [texunit $1( message
This change should be in CVS soon. I will post an example patch in a bit.
On 7/12/07, cyrille henry cyrille.henry@la-kitchen.fr wrote:
I have figured out what the GLSL multitexture problem is and have it working here. If I have a few hours today I can work on making it usable, but it will probably be next week before it is done.
wow, nice thanks a lot.
CVS is updated. Hopefully this won't break anyone's compiles.
The attached files are a test patch and the shaders. I will be out of town for a few days and not able to work on this again until next week.
On 7/12/07, chris clepper cgclepper@gmail.com wrote:
I have multitexturing working with GLSL. While I upload the changes to CVS I can explain how it works.
GLSL shaders cannot directly talk to hardware like ARB ones can. The application side code has to tell the shader which hardware texture unit to use. Obviously when I compile GEM there is no way in hell to know what the shader variables are going to be named, so another method to tell the shader which unit to use needs to be in place.
One solution is to hardcode the names of the sampler variables, but that is kind of a hack. The one I put in place uses a message to the glsl_program object with the name of the sampler and the texture unit to use.
How to use:
- create gemwin and turn on rendering
- load shader
- send a [mySamplerName $1( message to glsl_program
- load two movies or images
- set one of the pix_texture units to upload to the same texture unit
you told the shader to use with a [texunit $1( message
This change should be in CVS soon. I will post an example patch in a bit.
it works here. thanks a lot.
cyrille
chris clepper a écrit :
CVS is updated. Hopefully this won't break anyone's compiles.
The attached files are a test patch and the shaders. I will be out of town for a few days and not able to work on this again until next week.
On 7/12/07, chris clepper cgclepper@gmail.com wrote:
I have multitexturing working with GLSL. While I upload the changes to CVS I can explain how it works.
GLSL shaders cannot directly talk to hardware like ARB ones can. The application side code has to tell the shader which hardware texture unit to use. Obviously when I compile GEM there is no way in hell to know what the shader variables are going to be named, so another method to tell the shader which unit to use needs to be in place.
One solution is to hardcode the names of the sampler variables, but that is kind of a hack. The one I put in place uses a message to the glsl_program object with the name of the sampler and the texture unit to use.
How to use:
- create gemwin and turn on rendering
- load shader
- send a [mySamplerName $1( message to glsl_program
- load two movies or images
- set one of the pix_texture units to upload to the same texture unit
you told the shader to use with a [texunit $1( message
This change should be in CVS soon. I will post an example patch in a bit.
Great! Which platform and hardware are you testing on? I should have mentioned that I've only tested on OSX/Nvidia here.
On 7/12/07, cyrille henry cyrille.henry@la-kitchen.fr wrote:
it works here. thanks a lot.
cyrille
chris clepper a écrit :
CVS is updated. Hopefully this won't break anyone's compiles.
The attached files are a test patch and the shaders. I will be out of town for a few days and not able to work on this again until next week.
On 7/12/07, chris clepper cgclepper@gmail.com wrote:
I have multitexturing working with GLSL. While I upload the changes to CVS I can explain how it works.
GLSL shaders cannot directly talk to hardware like ARB ones can. The application side code has to tell the shader which hardware texture unit to use. Obviously when I compile GEM there is no way in hell to know what the shader variables are going to be named, so another method to tell the shader which unit to use needs to be in place.
One solution is to hardcode the names of the sampler variables, but that is kind of a hack. The one I put in place uses a message to the glsl_program object with the name of the sampler and the texture unit to use.
How to use:
- create gemwin and turn on rendering
- load shader
- send a [mySamplerName $1( message to glsl_program
- load two movies or images
- set one of the pix_texture units to upload to the same texture unit
you told the shader to use with a [texunit $1( message
This change should be in CVS soon. I will post an example patch in a bit.
Come tomorrow, you'll have a list of builds from the build farm...
.hc
On Jul 12, 2007, at 3:35 PM, chris clepper wrote:
Great! Which platform and hardware are you testing on? I should have mentioned that I've only tested on OSX/Nvidia here.
On 7/12/07, cyrille henry cyrille.henry@la-kitchen.fr wrote:
it works here. thanks a lot.
cyrille
chris clepper a écrit :
CVS is updated. Hopefully this won't break anyone's compiles.
The attached files are a test patch and the shaders. I will be
out of town for a few days and not able to work on this again until next week.On 7/12/07, chris clepper cgclepper@gmail.com wrote:
I have multitexturing working with GLSL. While I upload the
changes to CVS I can explain how it works.GLSL shaders cannot directly talk to hardware like ARB ones
can. The application side code has to tell the shader which hardware texture unit to use. Obviously when I compile GEM there is no way in
hell to know what the shader variables are going to be named, so another method to tell the shader which unit to use needs to be in place.One solution is to hardcode the names of the sampler variables, but that is kind of a hack. The one I put in place uses a message
to the glsl_program object with the name of the sampler and the texture
unit to use.How to use:
- create gemwin and turn on rendering
- load shader
- send a [mySamplerName $1( message to glsl_program
- load two movies or images
- set one of the pix_texture units to upload to the same
texture unit you told the shader to use with a [texunit $1( message
This change should be in CVS soon. I will post an example patch
in a bit.
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/ listinfo/pd-list
Using ReBirth is like trying to play an 808 with a long stick. - David Zicarelli
This is great news. Im super busy trying to finish up some things for
another project, but come mid august I should have time to port the
shaders im working on to PD, and now that Hans is back in NYC I can
get him to help ;)
Thanks Chris for taking the time to look into this. I havent had a
chance to ask the C74 guys anything, but at this point I guess I dont
need to.
Much appreciated!
On Jul 12, 2007, at 11:01 PM, Hans-Christoph Steiner wrote:
Come tomorrow, you'll have a list of builds from the build farm...
.hc
On Jul 12, 2007, at 3:35 PM, chris clepper wrote:
Great! Which platform and hardware are you testing on? I should
have mentioned that I've only tested on OSX/Nvidia here.On 7/12/07, cyrille henry cyrille.henry@la-kitchen.fr wrote:
it works here. thanks a lot.
cyrille
chris clepper a écrit :
CVS is updated. Hopefully this won't break anyone's compiles.
The attached files are a test patch and the shaders. I will be out of town for a few days and not able to work on this again until next week.
On 7/12/07, chris clepper cgclepper@gmail.com wrote:
I have multitexturing working with GLSL. While I upload the changes to CVS I can explain how it works.
GLSL shaders cannot directly talk to hardware like ARB ones can. The application side code has to tell the shader which hardware
texture unit to use. Obviously when I compile GEM there is no way in hell to know what the shader variables are going to be named, so another method to tell the shader which unit to use needs to be in place.One solution is to hardcode the names of the sampler variables,
but that is kind of a hack. The one I put in place uses a message to the glsl_program object with the name of the sampler and the texture unit to use.How to use:
- create gemwin and turn on rendering
- load shader
- send a [mySamplerName $1( message to glsl_program
- load two movies or images
- set one of the pix_texture units to upload to the same
texture unit you told the shader to use with a [texunit $1( message
This change should be in CVS soon. I will post an example patch in a bit.
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/ listinfo/pd-list
--
Using ReBirth is like trying to play an 808 with a long stick. - David Zicarelli
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/ listinfo/pd-list
v a d e //
www.vade.info abstrakt.vade.info
Feel free to post or send any shaders. I made a simple 'bleach bypass' one yesterday. ;)
On 7/12/07, vade doktorp@mac.com wrote:
This is great news. Im super busy trying to finish up some things for another project, but come mid august I should have time to port the shaders im working on to PD, and now that Hans is back in NYC I can get him to help ;) Thanks Chris for taking the time to look into this. I havent had a chance to ask the C74 guys anything, but at this point I guess I dont need to.
Much appreciated!
On Jul 12, 2007, at 11:01 PM, Hans-Christoph Steiner wrote:
Come tomorrow, you'll have a list of builds from the build farm...
.hc
On Jul 12, 2007, at 3:35 PM, chris clepper wrote:
Great! Which platform and hardware are you testing on? I should have mentioned that I've only tested on OSX/Nvidia here.
On 7/12/07, cyrille henry cyrille.henry@la-kitchen.fr wrote:
it works here. thanks a lot.
cyrille
chris clepper a écrit :
CVS is updated. Hopefully this won't break anyone's compiles.
The attached files are a test patch and the shaders. I will be out of town for a few days and not able to work on this again until next week.
On 7/12/07, chris clepper cgclepper@gmail.com wrote:
I have multitexturing working with GLSL. While I upload the changes to CVS I can explain how it works.
GLSL shaders cannot directly talk to hardware like ARB ones can. The application side code has to tell the shader which hardware texture unit to use. Obviously when I compile GEM there is no way in hell to know what the shader variables are going to be named, so another method to tell the shader which unit to use needs to be in place.
One solution is to hardcode the names of the sampler variables, but that is kind of a hack. The one I put in place uses a message to the glsl_program object with the name of the sampler and the texture unit to use.
How to use:
- create gemwin and turn on rendering
- load shader
- send a [mySamplerName $1( message to glsl_program
- load two movies or images
- set one of the pix_texture units to upload to the same
texture unit you told the shader to use with a [texunit $1( message
This change should be in CVS soon. I will post an example patch in a bit.
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/ listinfo/pd-list
Using ReBirth is like trying to play an 808 with a long stick. - David Zicarelli
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
*v a d e //*
*www.vade.info* *abstrakt.vade.info*
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
chris clepper a écrit :
Great! Which platform and hardware are you testing on? I should have mentioned that I've only tested on OSX/Nvidia here.
as usual, i test only on ubuntu linux (feisty) + nvidia
cyrille
On 7/12/07, cyrille henry cyrille.henry@la-kitchen.fr wrote:
it works here. thanks a lot.
cyrille
chris clepper a écrit :
CVS is updated. Hopefully this won't break anyone's compiles.
The attached files are a test patch and the shaders. I will be out of town for a few days and not able to work on this again until next week.
On 7/12/07, chris clepper cgclepper@gmail.com wrote:
I have multitexturing working with GLSL. While I upload the changes to CVS I can explain how it works.
GLSL shaders cannot directly talk to hardware like ARB ones can. The application side code has to tell the shader which hardware texture unit to use. Obviously when I compile GEM there is no way in hell to know what the shader variables are going to be named, so another method to tell the shader which unit to use needs to be in place.
One solution is to hardcode the names of the sampler variables, but that is kind of a hack. The one I put in place uses a message to the glsl_program object with the name of the sampler and the texture unit to use.
How to use:
- create gemwin and turn on rendering
- load shader
- send a [mySamplerName $1( message to glsl_program
- load two movies or images
- set one of the pix_texture units to upload to the same texture unit
you told the shader to use with a [texunit $1( message
This change should be in CVS soon. I will post an example patch in a bit.
Gloups ! Nothing happen, it doesn't work here (only the last exemple with glsl) ! Version du système : Mac OS X 10.4.10 (8R218) Modèle de jeu de puces : GeForce FX Go5200
Jack
Great! Which platform and hardware are you testing on? I should have mentioned that I've only tested on OSX/Nvidia here.
On 7/12/07, cyrille henry cyrille.henry@la-kitchen.fr wrote:
it works here. thanks a lot.
cyrille
chris clepper a écrit :
CVS is updated. Hopefully this won't break anyone's compiles.
The attached files are a test patch and the shaders. I will be out of town for a few days and not able to work on this again until next week.
On 7/12/07, chris clepper cgclepper@gmail.com wrote:
I have multitexturing working with GLSL. While I upload the changes to CVS I can explain how it works.
GLSL shaders cannot directly talk to hardware like ARB ones can. The application side code has to tell the shader which hardware texture unit to use. Obviously when I compile GEM there is no way in hell to know what the shader variables are going to be named, so another method to tell the shader which unit to use needs to be in place.
One solution is to hardcode the names of the sampler variables, but that is kind of a hack. The one I put in place uses a message to the glsl_program object with the name of the sampler and the texture unit to use.
How to use:
- create gemwin and turn on rendering
- load shader
- send a [mySamplerName $1( message to glsl_program
- load two movies or images
- set one of the pix_texture units to upload to the same texture
unit
you told the shader to use with a [texunit $1( message
This change should be in CVS soon. I will post an example patch in a bit.
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
hello, i noticed that only the 1st texture can be change. this is due to a typo line 170 in glsl_program.cpp.
this line :
glUniform1i(m_loc[1], (GLint)m_param[i][0]);
should be change to this :
glUniform1i(m_loc[i], (GLint)m_param[i][0]);
now, it work ok here.
cyrille
chris clepper a écrit :
CVS is updated. Hopefully this won't break anyone's compiles.
The attached files are a test patch and the shaders. I will be out of town for a few days and not able to work on this again until next week.
On 7/12/07, chris clepper cgclepper@gmail.com wrote:
I have multitexturing working with GLSL. While I upload the changes to CVS I can explain how it works.
GLSL shaders cannot directly talk to hardware like ARB ones can. The application side code has to tell the shader which hardware texture unit to use. Obviously when I compile GEM there is no way in hell to know what the shader variables are going to be named, so another method to tell the shader which unit to use needs to be in place.
One solution is to hardcode the names of the sampler variables, but that is kind of a hack. The one I put in place uses a message to the glsl_program object with the name of the sampler and the texture unit to use.
How to use:
- create gemwin and turn on rendering
- load shader
- send a [mySamplerName $1( message to glsl_program
- load two movies or images
- set one of the pix_texture units to upload to the same texture unit
you told the shader to use with a [texunit $1( message
This change should be in CVS soon. I will post an example patch in a bit.
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Should be fixed in CVS now. Thanks for catching that.
On 7/13/07, cyrille henry cyrille.henry@la-kitchen.fr wrote:
hello, i noticed that only the 1st texture can be change. this is due to a typo line 170 in glsl_program.cpp.
this line : glUniform1i(m_loc[1], (GLint)m_param[i][0]);
should be change to this :
glUniform1i(m_loc[i], (GLint)m_param[i][0]);
now, it work ok here.
cyrille
chris clepper a écrit :
CVS is updated. Hopefully this won't break anyone's compiles.
The attached files are a test patch and the shaders. I will be out of town for a few days and not able to work on this again until next week.
On 7/12/07, chris clepper cgclepper@gmail.com wrote:
I have multitexturing working with GLSL. While I upload the changes to CVS I can explain how it works.
GLSL shaders cannot directly talk to hardware like ARB ones can. The application side code has to tell the shader which hardware texture unit to use. Obviously when I compile GEM there is no way in hell to know what the shader variables are going to be named, so another method to tell the shader which unit to use needs to be in place.
One solution is to hardcode the names of the sampler variables, but that is kind of a hack. The one I put in place uses a message to the glsl_program object with the name of the sampler and the texture unit to use.
How to use:
- create gemwin and turn on rendering
- load shader
- send a [mySamplerName $1( message to glsl_program
- load two movies or images
- set one of the pix_texture units to upload to the same texture unit
you told the shader to use with a [texunit $1( message
This change should be in CVS soon. I will post an example patch in a bit.
PD-list@iem.at mailing list UNSUBSCRIBE and account-management ->
This is great! I'd love to see more stuff like this coming up on the list...
~Kyle
On 7/11/07, chris clepper cgclepper@gmail.com wrote:
I have attached a very simple patch and shader for adding two textures together.
The shader needs to be loaded after window creation and rendering starts to work correctly. The shader has some basic comments about what the commands do. You can replace the ADD with MUL to get a different effect to get started.
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
That's nice, a little odd to see a pix_texture not attached to a
shape, but I suppose it makes sense. It would be nice to see these
shader examples in the "Gem/examples" section, maybe something like
"10.shaders".
.hc
On Jul 11, 2007, at 1:03 PM, chris clepper wrote:
I have attached a very simple patch and shader for adding two
textures together.The shader needs to be loaded after window creation and rendering starts to work correctly. The shader has some basic comments about what the commands do. You can replace the ADD with MUL to get a different effect to get started. <add_frag.txt> <2shader_test.pd> _______________________________________________ PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/ listinfo/pd-list
"...information-sharing is a powerful positive good, and... it is an
ethical duty of hackers to share their expertise by writing open-
source code and facilitating access to information and to computing
resources wherever possible." - Eric Raymond
vade a écrit :
The reason mode 1 works and mode 2 doesnt is because mode 1 uses rectangular textures, since video is typically not power of 2 sized, my samplers are created for rect textures.
oups, this where comments that came from the old patch i was using... (pix_mutitexture work only with mode 1 (but not mode 0))
sorry, i should have removed them.
cyrille
However, using the patch cyrille:
loading the shader works manipulating the amount uniform variable produces a visible result. however, it is not as intended.
switching texunit 0 to 1 does switch the textures, but does seem to apply a secondary texture. whichever is 0 shows. and seems to mix only between the zeroth texture unit. not 0 and 1.
Thanks.
On Jul 5, 2007, at 6:04 PM, cyrille henry wrote:
chris clepper a écrit :
Did you try my suggestion to send a 'texunit $1' message to pix_texture? It sets the texture unit for the shader to read from.
do you mean having 2 pix_texture one after the other in order to load 2 diferent pix?
i tried this patch (to be used with vade shader), with no succes.
cyrille
On 7/5/07, vade doktorp@mac.com wrote:
Well, ive released the beta for Jitter. You guys are free to port whatever you want, but Ive heard nothing on the multitexturing side of things for PD. Im a bit saddened by that, but, whatever.
http://001.vade.info has the jxs files, help files, shaders and example content.
Hopefully this can get sorted out soon enough.
v a d e //
www.vade.info abstrakt.vade.info
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
#N canvas 47 25 932 764 10; #X obj 30 29 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 0; #N canvas 0 22 462 312 gemwin 0; #X obj 132 136 gemwin; #X obj 67 89 outlet; #X obj 67 10 inlet; #X obj 67 41 route create; #X msg 67 70 set destroy; #X msg 142 68 set create; #X msg 132 112 create , 1; #X msg 198 112 destroy; #X obj 306 45 inlet; #X connect 2 0 3 0; #X connect 3 0 4 0; #X connect 3 0 6 0; #X connect 3 1 5 0; #X connect 3 1 7 0; #X connect 4 0 1 0; #X connect 5 0 1 0; #X connect 6 0 0 0; #X connect 7 0 0 0; #X connect 8 0 0 0; #X restore 35 68 pd gemwin; #X msg 35 49 destroy; #X text 31 28 Create window:; #X floatatom 285 205 5 0 0 0 - - -; #X obj 398 148 openpanel; #X msg 397 169 open $1; #X obj 398 129 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 195 109 gemhead 1; #X obj 195 256 rectangle 1 1; #X obj 396 267 rectangle 1 1; #X obj 674 118 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1; #X msg 55 442 mode $1; #X obj 56 421 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1 1 ; #X obj 674 137 gemhead 50; #X obj 415 107 gemhead 20; #X obj 104 48 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 ; #X obj 55 462 s mode; #X obj 612 587 r mode; #X text 37 402 mode 0 doesn't!; #X obj 147 208 r mode; #X obj 339 219 r mode; #X text 164 7 these are just conveniences to open similar sized movies ; #X text 37 388 mode 1 works (default); #X obj 396 192 pix_image; #X obj 195 190 pix_image; #X obj 210 147 openpanel; #X msg 209 168 open $1; #X obj 210 128 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X msg 629 220 print; #X obj 747 451 pack 0 0; #X msg 631 332 print; #X obj 768 431 t b f; #X obj 764 386 change; #X obj 746 261 change; #X msg 747 477 link $1 $2; #X msg 634 497 print; #X floatatom 768 412 2 0 0 0 ID - -; #X floatatom 746 284 2 0 0 0 ID - -; #X obj 765 498 print linking; #X obj 674 242 glsl_vertex; #X obj 674 366 glsl_fragment; #X obj 787 180 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1; #X floatatom 498 209 5 0 0 0 - - -; #X msg 434 82 open img1.jpg; #X msg 225 77 open img2.jpg; #X obj 676 698 square 1; #X obj 676 673 translateXYZ 0 -1.5 0; #X floatatom 755 560 5 0 0 0 - - -; #X obj 676 536 glsl_program; #X msg 267 343 texUnit 1 $1; #X msg 468 343 texUnit 0 $1; #X obj 195 234 translateXYZ -3 0 0; #X obj 396 241 translateXYZ 3 0 0; #X obj 676 588 pix_texture; #X msg 496 428 texunit 0; #X msg 504 450 texunit 1; #X msg 513 474 texunit 2; #X obj 396 218 pix_texture; #X obj 196 210 pix_texture; #X obj 677 626 pix_texture; #X msg 491 533 texunit 0; #X msg 499 555 texunit 1; #X msg 508 579 texunit 2; #X msg 688 220 open vade.vert; #X msg 684 336 open vade.frag; #X obj 390 424 loadbang; #X floatatom 838 309 5 0 0 0 - - -; #X msg 832 344 amount $1; #X connect 1 0 2 0; #X connect 2 0 1 0; #X connect 5 0 6 0; #X connect 6 0 24 0; #X connect 7 0 5 0; #X connect 8 0 25 0; #X connect 11 0 14 0; #X connect 12 0 17 0; #X connect 13 0 12 0; #X connect 14 0 40 0; #X connect 15 0 24 0; #X connect 16 0 1 1; #X connect 18 0 54 0; #X connect 20 0 59 0; #X connect 21 0 58 0; #X connect 24 0 58 0; #X connect 25 0 59 0; #X connect 26 0 27 0; #X connect 27 0 25 0; #X connect 28 0 26 0; #X connect 29 0 40 0; #X connect 30 0 35 0; #X connect 31 0 41 0; #X connect 32 0 30 0; #X connect 32 1 30 1; #X connect 33 0 37 0; #X connect 34 0 38 0; #X connect 35 0 39 0; #X connect 35 0 49 0; #X connect 36 0 49 0; #X connect 37 0 32 0; #X connect 38 0 30 0; #X connect 40 0 41 0; #X connect 40 1 34 0; #X connect 41 0 49 0; #X connect 41 1 33 0; #X connect 42 0 64 0; #X connect 42 0 65 0; #X connect 44 0 24 0; #X connect 45 0 25 0; #X connect 47 0 46 0; #X connect 49 0 54 0; #X connect 49 1 48 0; #X connect 52 0 9 0; #X connect 53 0 10 0; #X connect 54 0 60 0; #X connect 55 0 54 0; #X connect 56 0 54 0; #X connect 57 0 54 0; #X connect 58 0 53 0; #X connect 58 1 51 0; #X connect 58 1 43 0; #X connect 58 1 54 1; #X connect 59 0 52 0; #X connect 59 1 4 0; #X connect 59 1 50 0; #X connect 59 1 60 1; #X connect 60 0 47 0; #X connect 61 0 60 0; #X connect 62 0 60 0; #X connect 63 0 60 0; #X connect 64 0 40 0; #X connect 65 0 41 0; #X connect 66 0 55 0; #X connect 66 0 62 0; #X connect 67 0 68 0; #X connect 68 0 49 0; _______________________________________________ PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
v a d e //
www.vade.info abstrakt.vade.info
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list