hello list
i'm trying to slant (kind of shear xy) a pix
any advice on how to do this ?
i tried to use pix_coordinates , freeframe plugins, pdmtl (without luck .
Please check the image i joined.
it shows the kind of transformations i need.
then it should be recursive, but i keep it for later... i hope the images makes sense.
it's missing the first state wich is 4 squares side by side
Thanks and have a nice end of we
Pierre-Yves Paris France
hi py, have you tried shearXY? it's part of gem. marius.
Py Fave wrote:
hello list
i'm trying to slant (kind of shear xy) a pix
any advice on how to do this ?
i tried to use pix_coordinates , freeframe plugins, pdmtl (without luck .
Please check the image i joined.
it shows the kind of transformations i need.
then it should be recursive, but i keep it for later... i hope the images makes sense.
it's missing the first state wich is 4 squares side by side
Thanks and have a nice end of we
Pierre-Yves Paris France
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Thanks for your help.
i would like to output a pix with this transformation,with image wrapping around , so shearXY is not very practical in my situation.
i would prefer to avoid using pix_snap too.
i need it to be quite fast, working on a live 25 fps 720*576(cropped to square) video feed.
any other otions?
would a GLSL shader do it ?
or this?
[pix dump] | | something shifting a list | | (pix set]
on my video card pix_coordinates works only on right angles .
any advice welcome!
Thanks
Py
2009/7/27 marius schebella marius.schebella@gmail.com
hi py, have you tried shearXY? it's part of gem. marius.
Py Fave wrote:
hello list
i'm trying to slant (kind of shear xy) a pix
any advice on how to do this ?
i tried to use pix_coordinates , freeframe plugins, pdmtl (without luck .
Please check the image i joined.
it shows the kind of transformations i need.
then it should be recursive, but i keep it for later... i hope the images makes sense.
it's missing the first state wich is 4 squares side by side
Thanks and have a nice end of we
Pierre-Yves Paris France
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
today's attempts produced this :
test07.pd
it needs optimisation but it works
i used part of patches i found on the web ,
http://www.mail-archive.com/pd-list@iem.at/msg25216.html
thanks Marius
any comments welcome
questions:
the rendering depends on the window size.
how can i make it take all screen ?
Py Fave wrote:
Thanks for your help.
i would like to output a pix with this transformation,with image wrapping around , so shearXY is not very practical in my situation.
i would prefer to avoid using pix_snap too.
i need it to be quite fast, working on a live 25 fps 720*576(cropped to square) video feed.
any other otions?
would a GLSL shader do it ?
look at the attached shader, maybe it does what you want? marius.
so nice . exactly a good starting point for me . simple and efficient. you made it specially for me ? :-)
i'm trying to learn some glsl and i am not really fluent in it for the moment. to say the less. but reading your code makes me willing to try things.
Thanks
py
2009/7/28 marius schebella marius.schebella@gmail.com
Py Fave wrote:
Thanks for your help.
i would like to output a pix with this transformation,with image wrapping around , so shearXY is not very practical in my situation.
i would prefer to avoid using pix_snap too.
i need it to be quite fast, working on a live 25 fps 720*576(cropped to square) video feed.
any other otions?
would a GLSL shader do it ?
look at the attached shader, maybe it does what you want? marius.
Py Fave wrote:
so nice . exactly a good starting point for me . simple and efficient. you made it specially for me ? :-)
i'm trying to learn some glsl and i am not really fluent in it for the moment. to say the less. but reading your code makes me willing to try things.
hi, yes, atm I am trying to port shaders to pd and help people get started with it (it's part of my work for pdcon09, there is more to come...).
here is a version that will make it more clear what is going on. it does exactly the same thing as the shader I posted before, but splits the steps and has more comments.
------ snip stripeshear.frag ------
// create diamond pattern // shear (x/y) will change the angle of the diamonds // offset (x/y) will move pattern left/right/up/down // resize (x/y) will resize the height/width
// sampler2D is the texture connected in Gem uniform sampler2D texture;
// the data type vec2 means a vector of 2 floats, // to set this value from Pd send a list, e.g. // "shear 1.5 -0.7" uniform vec2 shear; uniform vec2 offset; uniform vec2 resize;
// take the pixel from position x/y and apply a new location to it // in the last line "texture" means the particular pixel // and "texCoord" the position where it will be drawn // the rest is the transformation from the original position to the // diamond pattern void main(void) { // gl_TexCoord[0].x is the original x position. (a float value) // gl_TexCoord[0].y the y position. // to shear the image add an offset based on the x/y position // and the factor "shear". float x = gl_TexCoord[0].x+gl_TexCoord[0].y*shear.x; float y = gl_TexCoord[0].y+gl_TexCoord[0].x*shear.y;
// to shift the whole pattern right/left or up down
// add an offset
// to access the values of the vector you can use
// shear.xy (both) or shear.x or shear.y
// shear.s is the same as shear.x and the same as
// shear.r (letters stand for typical vectors: stuv, xyz, rgba)
x = x + offset.x;
y = y + offset.y;
// finally multiply the position offset to change
// the size of x and/or y
x = x*resize.x;
y = y*resize.y;
// this step is not really necessary, but shows
// how to put 2 floats into a vec2
vec2 texCoord = vec2(x,y);
// finally output the result as
// gl_FragColor, which is a built-in glsl function
gl_FragColor = texture2D(texture, texCoord);
}
-------- snip end
marius.
Thanks
py
2009/7/28 marius schebella <marius.schebella@gmail.com mailto:marius.schebella@gmail.com>
Py Fave wrote: Thanks for your help. i would like to output a pix with this transformation,with image wrapping around , so shearXY is not very practical in my situation. i would prefer to avoid using pix_snap too. i need it to be quite fast, working on a live 25 fps 720*576(cropped to square) video feed. any other otions? would a GLSL shader do it ? look at the attached shader, maybe it does what you want? marius.
Good explanations Marius. Thanx to share this. ++
Jack
Le mardi 28 juillet 2009 à 16:18 -0300, marius schebella a écrit :
Py Fave wrote:
so nice . exactly a good starting point for me . simple and efficient. you made it specially for me ? :-)
i'm trying to learn some glsl and i am not really fluent in it for the moment. to say the less. but reading your code makes me willing to try things.
hi, yes, atm I am trying to port shaders to pd and help people get started with it (it's part of my work for pdcon09, there is more to come...).
here is a version that will make it more clear what is going on. it does exactly the same thing as the shader I posted before, but splits the steps and has more comments.
------ snip stripeshear.frag ------
// create diamond pattern // shear (x/y) will change the angle of the diamonds // offset (x/y) will move pattern left/right/up/down // resize (x/y) will resize the height/width
// sampler2D is the texture connected in Gem uniform sampler2D texture;
// the data type vec2 means a vector of 2 floats, // to set this value from Pd send a list, e.g. // "shear 1.5 -0.7" uniform vec2 shear; uniform vec2 offset; uniform vec2 resize;
// take the pixel from position x/y and apply a new location to it // in the last line "texture" means the particular pixel // and "texCoord" the position where it will be drawn // the rest is the transformation from the original position to the // diamond pattern void main(void) { // gl_TexCoord[0].x is the original x position. (a float value) // gl_TexCoord[0].y the y position. // to shear the image add an offset based on the x/y position // and the factor "shear". float x = gl_TexCoord[0].x+gl_TexCoord[0].y*shear.x; float y = gl_TexCoord[0].y+gl_TexCoord[0].x*shear.y;
// to shift the whole pattern right/left or up down // add an offset // to access the values of the vector you can use // shear.xy (both) or shear.x or shear.y // shear.s is the same as shear.x and the same as // shear.r (letters stand for typical vectors: stuv, xyz, rgba) x = x + offset.x; y = y + offset.y;
// finally multiply the position offset to change // the size of x and/or y x = x*resize.x; y = y*resize.y;
// this step is not really necessary, but shows // how to put 2 floats into a vec2 vec2 texCoord = vec2(x,y);
// finally output the result as // gl_FragColor, which is a built-in glsl function gl_FragColor = texture2D(texture, texCoord); }
-------- snip end
marius.
Thanks
py
2009/7/28 marius schebella <marius.schebella@gmail.com mailto:marius.schebella@gmail.com>
Py Fave wrote: Thanks for your help. i would like to output a pix with this transformation,with image wrapping around , so shearXY is not very practical in my situation. i would prefer to avoid using pix_snap too. i need it to be quite fast, working on a live 25 fps 720*576(cropped to square) video feed. any other otions? would a GLSL shader do it ? look at the attached shader, maybe it does what you want? marius.
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list