Forums > MaxMSP

jit.gl.scanslide))

January 8, 2012 | 8:54 am

do not tell me how some could be arranged in an analog object jit.scanslide in jit.gl.pix interpretation?
thank you!)


January 8, 2012 | 6:38 pm

unfortunately, the jit.scanslide filter can’t be done with the jitter gen objects because it uses its immediate output for the next input. The general form of the filter is

out = (in-prev_out)*slide_factor+prev_out

where prev_out was the result from the previous cell. To make this in Gen, you’d need to be able to read from the output, which isn’t permitted at this point. It’s impossible with jit.gl.pix because you simply can’t do this on a GPU, but could be implemented in jit.gen or jit.pix in the future. I’ll log a feature request.


January 9, 2012 | 6:57 pm

this way about it might work, but it is very slow due to the fact that within a gen is not possible for, do, etc.( I hope in the future it will be possible.


January 9, 2012 | 6:59 pm

here’s the GLSL code something like inside the loop.






< ![CDATA[

varying vec2 texcoord0;
varying vec2 texdim0;

uniform float width;
uniform float slide_up;
uniform float slide_down;
uniform int iter;

uniform sampler2DRect tex0;

void main()
{

vec2 tc0 = texcoord0;
vec2 td0 = texdim0;

vec4 t1 = texture2DRect(tex0, tc0);
vec4 t2 = texture2DRect(tex0, tc0);

for (int i=1; i

{

float su = tc0.x+(i*width);
float sd = tc0.x-(i*width);

t1 = mix(t1,texture2DRect(tex0, vec2(su-(td0.x*floor(su/td0.x)),tc0.y)),slide_up);
t2 = mix(t2,texture2DRect(tex0, vec2(sd-(td0.x*floor(sd/td0.x)),tc0.y)),slide_down);

gl_FragColor = mix(t1,t2,0.5);

}

}

]]>


January 9, 2012 | 7:04 pm

but it still works in the jit.scanslide 1000000 times faster)) Interestingly he can do it? is it possible to do this interpolation out of the loop?


Viewing 5 posts - 1 through 5 (of 5 total)