jit.gl.scanslide))

Jan 8, 2012 at 8:54am

jit.gl.scanslide))

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

#61091
Jan 8, 2012 at 6:38pm

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.

#220158
Jan 9, 2012 at 6:57pm

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.

#220159
Jan 9, 2012 at 6:59pm

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);

}

}

]]>

#220160
Jan 9, 2012 at 7:04pm

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?

#220161

You must be logged in to reply to this topic.