Problem with output size of renderer

hi there,

i’m trying to write a patch with a video effect more or less like tonfilms motion blur.
http://vvvv.org/tiki-index.php?page=tonfilm-Patches#_Motion_Blur
the idea is that only pixels that change through motion are updated while the rest stay the way they were when last changed. i wrote a shader that combines the cam input, the detected motion and the previous output frame.
->if (motion>thresh) col=cam, else col=PrevFrame

should work, but somehow i get the original input plus delayed frames, each time smaller -> classical camera feedback.

i detected motion via trautner. to cancel that out as a source of the problem i did it with another shader. the output in the renderer was even smaller then, so i guess it has something to do with the renderers. i set their width and height, also in the inspectors of the texture nodes, to the size of the video i’m using. no use.

i already discussed this problem with tonfilm at the forum but i havent found a solution yet.

any ideas? i’m stuck…

i do not really get it…

can you post a screenshot how your renderer does look like if you just repeat rendering the last frame. best use some geometry in wireframe mode

have you adjusted for the texel-pixel halfpixel offset? do all renderers and ex9textures have the same size? which size?

Have you tried to change the render size with a TRANSFORM in the transform input?

heres a screenshot of the patch and the code of the shader.

{CODE(ln=>1)}
float4 kolo01(vs2ps In): COLOR
{

float4 col;
float motion = tex2D(SampMotion, In.TexCd).g;
float thresh = Threshold;

if( motion > thresh ) {
    col = tex2D(SampCam, In.TexCd);
} else {
    col = tex2D(SampPrev, In.TexCd);

}

return col;

}^

thanks so far!

ff

KoloNet05.jpg (95.5 kB)

It seems like you have no transform on the geometry making it’s default scale be 1.0x1.0 while the renderer is 2.0x2.0 so you get the effect that everything gets smaller and smaller because you only draw on a part of the renderer in the middle and then feed everything seen in the renderer into the feedback loop with the dx9texture.

@ beyon

i attached a transform to the renderer and it actually changes the thing to ALMOST what i want and not with the values i expected.

the most stable picture (i.e. the least feedback) i get with at a scale of 1.415 for the renderer. there the “echo” or traces the shader should produce almost stay the same size, but they still wander of to the below left corner of the renderer.

changing the transform values of the shader doesnt help.

grz
ff

KoloNet05_2009.01.23-12.37.48.jpg (158.0 kB)

ah finally i know what you mean.

the dx9texture output of the renderer is shifted by 1 pixel both horizontal and vertikal.
i remember that there was a related thread years ago…

for fixing you may want to have look at my module IIR (EX9.Texture) which offers a solution. you find it at kalle.Modules.EX9.Texture

yes kalle!

that did it!

altough i still dont understand why the uniform scale of the renderer has to be 1.4143…

i’m sure you already filed that pixelshifter bug, so i won’t bother doing it again.

cheers
ff

1.41 reminds me to the squareroot of 2…

i made something similar a few days ago,
http://vvvv.org/tiki-download_file.php?fileId=1887