But in the begining i see a curios thing, i dont know why but when i render with shader and loop in the queue render in the sader again it is offset in one pixel in X and in Y.

I need to make a transformation dependat of the render backbuffer to correct the error.

show you an example

A liitle Update.

Know going to objetive there is another problem, i use a divisor make minimum adjust when the change it over threshold, i like if this number it bigger, but i loose a lot of presission because i only have an integer range between 0-256.

If i can get in memory float4x4 be great, but i dont know how JAJA

send you un update file.

You can see objects in movement make invisible, or try to this jaja

Well im done for today
Im newbie in vvvv and this help me for practice and learn a lot of things a dont know.

Embed in code texture offset

Put here the last version, it works great for me, hope your feedback i upload…

works nice, just a coding hint. the distance function returns a single float value that is the distance between the two vectors and the shader language allows to write vector calculations that work on all components of a vector very simple, the code can be reduced to:

{
float4 col = tex2D(Samp, In.TexCd);
float4 col_back = tex2D(Samp2, float2 (In.TexCd.x+0.5/Width,In.TexCd.y+0.5/Heigth));
float tmp = distance(col_back, col);
float4 diff = col-col_back;

if (tmp > abs(HighThreshold))
col.rgb=col_back.rgb+(diff.rgb+LowOffset*sign(diff.rgb))/InMoveSpeed;
else
col.rgb=col_back.rgb+(diff.rgb)/StoppedSpeed;

return col;
}

Ty a lot for the hint, ill will update the code :)

i used to work with bg subtraction and lately i used a plugin by u7, here :)
It is GPU based and i’d like to make some test on patch i already know and use, can u update code and post the last version u have please ? thank u :)

I update the code

this line launch error, its keep as old version
if (tmp > abs(HighThreshold))

i put a TOGGLE button to get backgroung in first adjust, its a toggle because its an LFO dependat and with BANG dont work at every time.