RE: [Flashcoders] ConvolutionFilter performance

2006-01-31 Thread Mike Mountain
 RGBtoHEX(r, g, b) {
return (r  16 | g  8 | b);
}
function spectre(angle) {
r = (180-angle)/180*Math.PI;
var c_r = Math.sin(r++)*127+128  16;
var c_g = Math.sin(r)*127+128  8;
var c_b = Math.cos(r--)*127+128;
return (c_r | c_g | c_b);
}
var filterArray = new Array();
//var filter:GlowFilter = new GlowFilter(color, alpha, blurX, blurY, strength, 
quality, inner, knockout);
//filterArray.push(filter);
var blurX = 20;
var blurY = 20;
var quality = 2;
var filter = new BlurFilter(blurX, blurY, quality);
filterArray.push(filter);
//
var plug = _root.createEmptyMovieClip('plug', 10);
plug._y = 200;
plug._x = 200;
createEmptyMovieClip('canvas', 200);
t = 0;
numsegs = 15;
segmentLength = 6;
drawCord = function () {
t += 2;
lw = Math.sin(t)*100;
//trace(lw);
a = 100;
//trace(a)
canvas.clear();
var col = spectre(t);
canvas.lineStyle(1, col, a);
canvas.moveTo(plug._x, plug._y);
points[0] = new Object();
points[0].x = plug._x;
points[0].y = plug._y;
var v1 = 1;
while (v1points.length-1) {
v4 = Math.atan2(points[v1].y-points[v1-1].y, 
points[v1].x-points[v1-1].x);
v3 = points[v1-1].x+(segmentLength)*Math.cos(v4)*2;
v2 = points[v1-1].y+(segmentLength)*Math.sin(v4)*2;
points[v1].x = v3;
points[v1].y = v2;
canvas.lineStyle((points.length-v1)/2, col);
canvas.lineTo(v3, v2);
++v1;
}
//(points.length-v1)/2
};
var points = new Array();
var i = 0;
while (inumsegs) {
points[i] = new Object();
points[i].x=5*i, points[i].y=Math.sin(i/20);
++i;
}
//drawCord();
plug.xVel = 10+Math.random()*10;
plug.yVel = 10+Math.random()*10;
plug.xmax = Stage.width;
plug.xmin = 0;
plug.ymax = Stage.height;
plug.ymin = 0;

var matrixX:Number = 3;
var matrixY:Number = 3;
var matrix:Array = [1, 1, 1, 0, 0, 0, 0, 1, 0];
var divisor:Number = 4;
var sfilter:ConvolutionFilter = new ConvolutionFilter(matrixX, matrixY, matrix, 
divisor);
/*
var blurX = 10;
var blurY = 10;
var quality = 2;
var sfilter = new BlurFilter(blurX, blurY, quality);
*/
//
myMatrix = new Matrix();
translateMatrix = new Matrix();
degrees = 180;
radians = (degrees/180)*Math.PI;
myMatrix.rotate(radians);
translateMatrix.translate(768, 768);
myMatrix.concat(translateMatrix);
myColorTransform = new ColorTransform();
blendMode = normal;
myRectangle = new Rectangle(0, 0, 768, 768);
smooth = true;
// sfilter = new BlurFilter(5, 5, 1);
plug.onEnterFrame = function() {
rolldie = Math.random()*100;
if (rolldie97) {
this.xVel = -10+Math.random()*20;
this.yVel = -10+Math.random()*20;
}
canvas.filters = filterArray;
drawCord();
copyStage();
var nextX = this.xVel+this._x;
var nextY = this.yVel+this._y;
if (nextXthis.xmax) {
this.xVel = (this.xVel+Math.random()*10)*-1;
nextX = this.xmax-(nextX-this.xmax);
} else if (nextXthis.xmin) {
this.xVel = (this.xVel+Math.random()*10)*-1;
nextX = this.xmin+(this.xmin-nextX);
}
if (nextYthis.ymax) {
this.yVel = (this.yVel+Math.random()*10)*-1;
nextY = this.ymax-(nextY-this.ymax);
} else if (nextYthis.ymin) {
this.yVel = (this.yVel+Math.random()*10)*-1;
nextY = this.ymin+(this.ymin-nextY);
}
this._x = nextX;
this._y = nextY;
onScreen.copyPixels(offScreen1, offScreen1.rectangle, zeroPoint);
onScreen.applyFilter(offScreen1, offScreen1.rectangle, new Point(0, 0), 
sfilter);
offScreen1.draw(_root, myMatrix, myColorTransform, blendMode, 
myRectangle, smooth);
};
[/as]

Although it may be something to do with the application of the filter

Scuse the dodgy code - WIP.

M


 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf 
 Of Mike Duguid
 Sent: 30 January 2006 22:44
 To: Flashcoders mailing list
 Subject: Re: [Flashcoders] ConvolutionFilter performance
 
 Mike, do you have an example of this? My current test shows 
 the opposite - that convolution is proving more cpu intensive 
 than blurfilter?
 
 
  Mike Mountain  [EMAIL PROTECTED] wrote:
  In my tests convolution filter was much faster than a blurfilter.
  But it's an easy one to swap oout and test for yourself...
 
 
  Andreas Rønning [EMAIL PROTECTED] wrote:
  Does anyone know which is faster; a blurring one-pass convolution 
  filter or a blurfilter? Or are they just 2 sides to the 
 same story? I 
  need a high performance blur operation for depth of field..
 
  Cheers,
 
  - Andreas
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo

Re: [Flashcoders] ConvolutionFilter performance

2006-01-31 Thread franto
 onScreen:BitmapData = new BitmapData(width, height, false, 0);
 var zeroPoint:Point = new Point(0, 0);
 var clip:MovieClip = createEmptyMovieClip(clip, 1);
 clip._x = 0;
 clip._y = 0;
 clip.attachBitmap(onScreen, 1);
 // wire the bitmap to the screen
 function RGBtoHEX(r, g, b) {
 return (r  16 | g  8 | b);
 }
 function spectre(angle) {
 r = (180-angle)/180*Math.PI;
 var c_r = Math.sin(r++)*127+128  16;
 var c_g = Math.sin(r)*127+128  8;
 var c_b = Math.cos(r--)*127+128;
 return (c_r | c_g | c_b);
 }
 var filterArray = new Array();
 //var filter:GlowFilter = new GlowFilter(color, alpha, blurX, blurY, 
 strength, quality, inner, knockout);
 //filterArray.push(filter);
 var blurX = 20;
 var blurY = 20;
 var quality = 2;
 var filter = new BlurFilter(blurX, blurY, quality);
 filterArray.push(filter);
 //
 var plug = _root.createEmptyMovieClip('plug', 10);
 plug._y = 200;
 plug._x = 200;
 createEmptyMovieClip('canvas', 200);
 t = 0;
 numsegs = 15;
 segmentLength = 6;
 drawCord = function () {
 t += 2;
 lw = Math.sin(t)*100;
 //trace(lw);
 a = 100;
 //trace(a)
 canvas.clear();
 var col = spectre(t);
 canvas.lineStyle(1, col, a);
 canvas.moveTo(plug._x, plug._y);
 points[0] = new Object();
 points[0].x = plug._x;
 points[0].y = plug._y;
 var v1 = 1;
 while (v1points.length-1) {
 v4 = Math.atan2(points[v1].y-points[v1-1].y, 
 points[v1].x-points[v1-1].x);
 v3 = points[v1-1].x+(segmentLength)*Math.cos(v4)*2;
 v2 = points[v1-1].y+(segmentLength)*Math.sin(v4)*2;
 points[v1].x = v3;
 points[v1].y = v2;
 canvas.lineStyle((points.length-v1)/2, col);
 canvas.lineTo(v3, v2);
 ++v1;
 }
 //(points.length-v1)/2
 };
 var points = new Array();
 var i = 0;
 while (inumsegs) {
 points[i] = new Object();
 points[i].x=5*i, points[i].y=Math.sin(i/20);
 ++i;
 }
 //drawCord();
 plug.xVel = 10+Math.random()*10;
 plug.yVel = 10+Math.random()*10;
 plug.xmax = Stage.width;
 plug.xmin = 0;
 plug.ymax = Stage.height;
 plug.ymin = 0;

 var matrixX:Number = 3;
 var matrixY:Number = 3;
 var matrix:Array = [1, 1, 1, 0, 0, 0, 0, 1, 0];
 var divisor:Number = 4;
 var sfilter:ConvolutionFilter = new ConvolutionFilter(matrixX, matrixY, 
 matrix, divisor);
 /*
 var blurX = 10;
 var blurY = 10;
 var quality = 2;
 var sfilter = new BlurFilter(blurX, blurY, quality);
 */
 //
 myMatrix = new Matrix();
 translateMatrix = new Matrix();
 degrees = 180;
 radians = (degrees/180)*Math.PI;
 myMatrix.rotate(radians);
 translateMatrix.translate(768, 768);
 myMatrix.concat(translateMatrix);
 myColorTransform = new ColorTransform();
 blendMode = normal;
 myRectangle = new Rectangle(0, 0, 768, 768);
 smooth = true;
 // sfilter = new BlurFilter(5, 5, 1);
 plug.onEnterFrame = function() {
 rolldie = Math.random()*100;
 if (rolldie97) {
 this.xVel = -10+Math.random()*20;
 this.yVel = -10+Math.random()*20;
 }
 canvas.filters = filterArray;
 drawCord();
 copyStage();
 var nextX = this.xVel+this._x;
 var nextY = this.yVel+this._y;
 if (nextXthis.xmax) {
 this.xVel = (this.xVel+Math.random()*10)*-1;
 nextX = this.xmax-(nextX-this.xmax);
 } else if (nextXthis.xmin) {
 this.xVel = (this.xVel+Math.random()*10)*-1;
 nextX = this.xmin+(this.xmin-nextX);
 }
 if (nextYthis.ymax) {
 this.yVel = (this.yVel+Math.random()*10)*-1;
 nextY = this.ymax-(nextY-this.ymax);
 } else if (nextYthis.ymin) {
 this.yVel = (this.yVel+Math.random()*10)*-1;
 nextY = this.ymin+(this.ymin-nextY);
 }
 this._x = nextX;
 this._y = nextY;
 onScreen.copyPixels(offScreen1, offScreen1.rectangle, zeroPoint);
 onScreen.applyFilter(offScreen1, offScreen1.rectangle, new Point(0, 
 0), sfilter);
 offScreen1.draw(_root, myMatrix, myColorTransform, blendMode, 
 myRectangle, smooth);
 };
 [/as]

 Although it may be something to do with the application of the filter

 Scuse the dodgy code - WIP.

 M


  -Original Message-
  From: [EMAIL PROTECTED]
  [mailto:[EMAIL PROTECTED] On Behalf
  Of Mike Duguid
  Sent: 30 January 2006 22:44
  To: Flashcoders mailing list
  Subject: Re: [Flashcoders] ConvolutionFilter performance
 
  Mike, do you have an example of this? My current test shows
  the opposite - that convolution is proving more cpu intensive
  than blurfilter?
 
 
   Mike Mountain  [EMAIL PROTECTED] wrote:
   In my tests convolution filter was much faster than a blurfilter.
   But it's an easy one to swap oout and test for yourself...
 
 
   Andreas Rønning [EMAIL PROTECTED] wrote

Re: [Flashcoders] ConvolutionFilter performance

2006-01-31 Thread Cédric Muller
 = new Point(0, 0);
var clip:MovieClip = createEmptyMovieClip(clip, 1);
clip._x = 0;
clip._y = 0;
clip.attachBitmap(onScreen, 1);
// wire the bitmap to the screen
function RGBtoHEX(r, g, b) {
return (r  16 | g  8 | b);
}
function spectre(angle) {
r = (180-angle)/180*Math.PI;
var c_r = Math.sin(r++)*127+128  16;
var c_g = Math.sin(r)*127+128  8;
var c_b = Math.cos(r--)*127+128;
return (c_r | c_g | c_b);
}
var filterArray = new Array();
//var filter:GlowFilter = new GlowFilter(color, alpha, blurX,  
blurY, strength, quality, inner, knockout);

//filterArray.push(filter);
var blurX = 20;
var blurY = 20;
var quality = 2;
var filter = new BlurFilter(blurX, blurY, quality);
filterArray.push(filter);
//
var plug = _root.createEmptyMovieClip('plug', 10);
plug._y = 200;
plug._x = 200;
createEmptyMovieClip('canvas', 200);
t = 0;
numsegs = 15;
segmentLength = 6;
drawCord = function () {
t += 2;
lw = Math.sin(t)*100;
//trace(lw);
a = 100;
//trace(a)
canvas.clear();
var col = spectre(t);
canvas.lineStyle(1, col, a);
canvas.moveTo(plug._x, plug._y);
points[0] = new Object();
points[0].x = plug._x;
points[0].y = plug._y;
var v1 = 1;
while (v1points.length-1) {
v4 = Math.atan2(points[v1].y-points[v1-1].y, points 
[v1].x-points[v1-1].x);

v3 = points[v1-1].x+(segmentLength)*Math.cos(v4)*2;
v2 = points[v1-1].y+(segmentLength)*Math.sin(v4)*2;
points[v1].x = v3;
points[v1].y = v2;
canvas.lineStyle((points.length-v1)/2, col);
canvas.lineTo(v3, v2);
++v1;
}
//(points.length-v1)/2
};
var points = new Array();
var i = 0;
while (inumsegs) {
points[i] = new Object();
points[i].x=5*i, points[i].y=Math.sin(i/20);
++i;
}
//drawCord();
plug.xVel = 10+Math.random()*10;
plug.yVel = 10+Math.random()*10;
plug.xmax = Stage.width;
plug.xmin = 0;
plug.ymax = Stage.height;
plug.ymin = 0;

var matrixX:Number = 3;
var matrixY:Number = 3;
var matrix:Array = [1, 1, 1, 0, 0, 0, 0, 1, 0];
var divisor:Number = 4;
var sfilter:ConvolutionFilter = new ConvolutionFilter(matrixX,  
matrixY, matrix, divisor);

/*
var blurX = 10;
var blurY = 10;
var quality = 2;
var sfilter = new BlurFilter(blurX, blurY, quality);
*/
//
myMatrix = new Matrix();
translateMatrix = new Matrix();
degrees = 180;
radians = (degrees/180)*Math.PI;
myMatrix.rotate(radians);
translateMatrix.translate(768, 768);
myMatrix.concat(translateMatrix);
myColorTransform = new ColorTransform();
blendMode = normal;
myRectangle = new Rectangle(0, 0, 768, 768);
smooth = true;
// sfilter = new BlurFilter(5, 5, 1);
plug.onEnterFrame = function() {
rolldie = Math.random()*100;
if (rolldie97) {
this.xVel = -10+Math.random()*20;
this.yVel = -10+Math.random()*20;
}
canvas.filters = filterArray;
drawCord();
copyStage();
var nextX = this.xVel+this._x;
var nextY = this.yVel+this._y;
if (nextXthis.xmax) {
this.xVel = (this.xVel+Math.random()*10)*-1;
nextX = this.xmax-(nextX-this.xmax);
} else if (nextXthis.xmin) {
this.xVel = (this.xVel+Math.random()*10)*-1;
nextX = this.xmin+(this.xmin-nextX);
}
if (nextYthis.ymax) {
this.yVel = (this.yVel+Math.random()*10)*-1;
nextY = this.ymax-(nextY-this.ymax);
} else if (nextYthis.ymin) {
this.yVel = (this.yVel+Math.random()*10)*-1;
nextY = this.ymin+(this.ymin-nextY);
}
this._x = nextX;
this._y = nextY;
onScreen.copyPixels(offScreen1, offScreen1.rectangle,  
zeroPoint);
onScreen.applyFilter(offScreen1, offScreen1.rectangle, new  
Point(0, 0), sfilter);
offScreen1.draw(_root, myMatrix, myColorTransform,  
blendMode, myRectangle, smooth);

};
[/as]

Although it may be something to do with the application of the  
filter


Scuse the dodgy code - WIP.

M



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf
Of Mike Duguid
Sent: 30 January 2006 22:44
To: Flashcoders mailing list
Subject: Re: [Flashcoders] ConvolutionFilter performance

Mike, do you have an example of this? My current test shows
the opposite - that convolution is proving more cpu intensive
than blurfilter?



Mike Mountain  [EMAIL PROTECTED] wrote:
In my tests convolution filter was much faster than a blurfilter.
But it's an easy one to swap oout and test for yourself...




Andreas Rønning [EMAIL PROTECTED] wrote:
Does anyone know which is faster; a blurring one-pass convolution
filter or a blurfilter? Or are they just 2 sides to the

same story? I

need a high performance blur operation for depth of field..

Cheers,

- Andreas

Re: [Flashcoders] ConvolutionFilter performance

2006-01-31 Thread Cédric Muller
, 0);
var clip:MovieClip = createEmptyMovieClip(clip, 1);
clip._x = 0;
clip._y = 0;
clip.attachBitmap(onScreen, 1);
// wire the bitmap to the screen
function RGBtoHEX(r, g, b) {
return (r  16 | g  8 | b);
}
function spectre(angle) {
r = (180-angle)/180*Math.PI;
var c_r = Math.sin(r++)*127+128  16;
var c_g = Math.sin(r)*127+128  8;
var c_b = Math.cos(r--)*127+128;
return (c_r | c_g | c_b);
}
var filterArray = new Array();
//var filter:GlowFilter = new GlowFilter(color, alpha, blurX,  
blurY, strength, quality, inner, knockout);

//filterArray.push(filter);
var blurX = 20;
var blurY = 20;
var quality = 2;
var filter = new BlurFilter(blurX, blurY, quality);
filterArray.push(filter);
//
var plug = _root.createEmptyMovieClip('plug', 10);
plug._y = 200;
plug._x = 200;
createEmptyMovieClip('canvas', 200);
t = 0;
numsegs = 15;
segmentLength = 6;
drawCord = function () {
t += 2;
lw = Math.sin(t)*100;
//trace(lw);
a = 100;
//trace(a)
canvas.clear();
var col = spectre(t);
canvas.lineStyle(1, col, a);
canvas.moveTo(plug._x, plug._y);
points[0] = new Object();
points[0].x = plug._x;
points[0].y = plug._y;
var v1 = 1;
while (v1points.length-1) {
v4 = Math.atan2(points[v1].y-points[v1-1].y, points 
[v1].x-points[v1-1].x);

v3 = points[v1-1].x+(segmentLength)*Math.cos(v4)*2;
v2 = points[v1-1].y+(segmentLength)*Math.sin(v4)*2;
points[v1].x = v3;
points[v1].y = v2;
canvas.lineStyle((points.length-v1)/2, col);
canvas.lineTo(v3, v2);
++v1;
}
//(points.length-v1)/2
};
var points = new Array();
var i = 0;
while (inumsegs) {
points[i] = new Object();
points[i].x=5*i, points[i].y=Math.sin(i/20);
++i;
}
//drawCord();
plug.xVel = 10+Math.random()*10;
plug.yVel = 10+Math.random()*10;
plug.xmax = Stage.width;
plug.xmin = 0;
plug.ymax = Stage.height;
plug.ymin = 0;

var matrixX:Number = 3;
var matrixY:Number = 3;
var matrix:Array = [1, 1, 1, 0, 0, 0, 0, 1, 0];
var divisor:Number = 4;
var sfilter:ConvolutionFilter = new ConvolutionFilter(matrixX,  
matrixY, matrix, divisor);

/*
var blurX = 10;
var blurY = 10;
var quality = 2;
var sfilter = new BlurFilter(blurX, blurY, quality);
*/
//
myMatrix = new Matrix();
translateMatrix = new Matrix();
degrees = 180;
radians = (degrees/180)*Math.PI;
myMatrix.rotate(radians);
translateMatrix.translate(768, 768);
myMatrix.concat(translateMatrix);
myColorTransform = new ColorTransform();
blendMode = normal;
myRectangle = new Rectangle(0, 0, 768, 768);
smooth = true;
// sfilter = new BlurFilter(5, 5, 1);
plug.onEnterFrame = function() {
rolldie = Math.random()*100;
if (rolldie97) {
this.xVel = -10+Math.random()*20;
this.yVel = -10+Math.random()*20;
}
canvas.filters = filterArray;
drawCord();
copyStage();
var nextX = this.xVel+this._x;
var nextY = this.yVel+this._y;
if (nextXthis.xmax) {
this.xVel = (this.xVel+Math.random()*10)*-1;
nextX = this.xmax-(nextX-this.xmax);
} else if (nextXthis.xmin) {
this.xVel = (this.xVel+Math.random()*10)*-1;
nextX = this.xmin+(this.xmin-nextX);
}
if (nextYthis.ymax) {
this.yVel = (this.yVel+Math.random()*10)*-1;
nextY = this.ymax-(nextY-this.ymax);
} else if (nextYthis.ymin) {
this.yVel = (this.yVel+Math.random()*10)*-1;
nextY = this.ymin+(this.ymin-nextY);
}
this._x = nextX;
this._y = nextY;
onScreen.copyPixels(offScreen1, offScreen1.rectangle,  
zeroPoint);
onScreen.applyFilter(offScreen1, offScreen1.rectangle, new  
Point(0, 0), sfilter);
offScreen1.draw(_root, myMatrix, myColorTransform,  
blendMode, myRectangle, smooth);

};
[/as]

Although it may be something to do with the application of the  
filter


Scuse the dodgy code - WIP.

M



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf
Of Mike Duguid
Sent: 30 January 2006 22:44
To: Flashcoders mailing list
Subject: Re: [Flashcoders] ConvolutionFilter performance

Mike, do you have an example of this? My current test shows
the opposite - that convolution is proving more cpu intensive
than blurfilter?



Mike Mountain  [EMAIL PROTECTED] wrote:
In my tests convolution filter was much faster than a blurfilter.
But it's an easy one to swap oout and test for yourself...




Andreas Rønning [EMAIL PROTECTED] wrote:
Does anyone know which is faster; a blurring one-pass convolution
filter or a blurfilter? Or are they just 2 sides to the

same story? I

need a high performance blur operation for depth of field..

Cheers,

- Andreas

RE: [Flashcoders] ConvolutionFilter performance

2006-01-31 Thread Mike Mountain
Interesting, it runs like a dog with blur filter on mine, fast and sweet as pie 
(a bit 'shaky' but not enough to be a problem) with convolution on my PC.

You PC or Mac?

M

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf 
 Of Cédric Muller
 Sent: 31 January 2006 09:43
 To: Flashcoders mailing list
 Subject: Re: [Flashcoders] ConvolutionFilter performance
 
 ???
 blurFilter=very smooth
 convultionFilter=shaky and unstable
 
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] ConvolutionFilter performance

2006-01-31 Thread franto
 PROTECTED]
  [mailto:[EMAIL PROTECTED] On Behalf
  Of Mike Duguid
  Sent: 30 January 2006 22:44
  To: Flashcoders mailing list
  Subject: Re: [Flashcoders] ConvolutionFilter performance
 
  Mike, do you have an example of this? My current test shows
  the opposite - that convolution is proving more cpu intensive
  than blurfilter?
 
 
  Mike Mountain  [EMAIL PROTECTED] wrote:
  In my tests convolution filter was much faster than a blurfilter.
  But it's an easy one to swap oout and test for yourself...
 
 
  Andreas R�nning [EMAIL PROTECTED] wrote:
  Does anyone know which is faster; a blurring one-pass convolution
  filter or a blurfilter? Or are they just 2 sides to the
  same story? I
  need a high performance blur operation for depth of field..
 
  Cheers,
 
  - Andreas
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
 
 
  --
  --
  --
  -
  Franto
 
  http://blog.franto.com
  http://www.flashcoders.sk
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



--
-
Franto

http://blog.franto.com
http://www.flashcoders.sk
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] ConvolutionFilter performance

2006-01-31 Thread Cédric Muller
);
offScreen1.draw(_root, myMatrix, myColorTransform,
blendMode, myRectangle, smooth);
};
[/as]


With convolution filter:

[as]
import flash.filters.*;
import flash.geom.*;
import flash.display.*;
//
//import flash.display.Bitmap;
var width:Number = 768;
var height:Number = 768;
var offScreen1:BitmapData = new BitmapData(width, height, false,  
0);

var onScreen:BitmapData = new BitmapData(width, height, false, 0);
var zeroPoint:Point = new Point(0, 0);
var clip:MovieClip = createEmptyMovieClip(clip, 1);
clip._x = 0;
clip._y = 0;
clip.attachBitmap(onScreen, 1);
// wire the bitmap to the screen
function RGBtoHEX(r, g, b) {
return (r  16 | g  8 | b);
}
function spectre(angle) {
r = (180-angle)/180*Math.PI;
var c_r = Math.sin(r++)*127+128  16;
var c_g = Math.sin(r)*127+128  8;
var c_b = Math.cos(r--)*127+128;
return (c_r | c_g | c_b);
}
var filterArray = new Array();
//var filter:GlowFilter = new GlowFilter(color, alpha, blurX,
blurY, strength, quality, inner, knockout);
//filterArray.push(filter);
var blurX = 20;
var blurY = 20;
var quality = 2;
var filter = new BlurFilter(blurX, blurY, quality);
filterArray.push(filter);
//
var plug = _root.createEmptyMovieClip('plug', 10);
plug._y = 200;
plug._x = 200;
createEmptyMovieClip('canvas', 200);
t = 0;
numsegs = 15;
segmentLength = 6;
drawCord = function () {
t += 2;
lw = Math.sin(t)*100;
//trace(lw);
a = 100;
//trace(a)
canvas.clear();
var col = spectre(t);
canvas.lineStyle(1, col, a);
canvas.moveTo(plug._x, plug._y);
points[0] = new Object();
points[0].x = plug._x;
points[0].y = plug._y;
var v1 = 1;
while (v1points.length-1) {
v4 = Math.atan2(points[v1].y-points[v1-1].y, points
[v1].x-points[v1-1].x);
v3 = points[v1-1].x+(segmentLength)*Math.cos(v4)*2;
v2 = points[v1-1].y+(segmentLength)*Math.sin(v4)*2;
points[v1].x = v3;
points[v1].y = v2;
canvas.lineStyle((points.length-v1)/2, col);
canvas.lineTo(v3, v2);
++v1;
}
//(points.length-v1)/2
};
var points = new Array();
var i = 0;
while (inumsegs) {
points[i] = new Object();
points[i].x=5*i, points[i].y=Math.sin(i/20);
++i;
}
//drawCord();
plug.xVel = 10+Math.random()*10;
plug.yVel = 10+Math.random()*10;
plug.xmax = Stage.width;
plug.xmin = 0;
plug.ymax = Stage.height;
plug.ymin = 0;

var matrixX:Number = 3;
var matrixY:Number = 3;
var matrix:Array = [1, 1, 1, 0, 0, 0, 0, 1, 0];
var divisor:Number = 4;
var sfilter:ConvolutionFilter = new ConvolutionFilter(matrixX,
matrixY, matrix, divisor);
/*
var blurX = 10;
var blurY = 10;
var quality = 2;
var sfilter = new BlurFilter(blurX, blurY, quality);
*/
//
myMatrix = new Matrix();
translateMatrix = new Matrix();
degrees = 180;
radians = (degrees/180)*Math.PI;
myMatrix.rotate(radians);
translateMatrix.translate(768, 768);
myMatrix.concat(translateMatrix);
myColorTransform = new ColorTransform();
blendMode = normal;
myRectangle = new Rectangle(0, 0, 768, 768);
smooth = true;
// sfilter = new BlurFilter(5, 5, 1);
plug.onEnterFrame = function() {
rolldie = Math.random()*100;
if (rolldie97) {
this.xVel = -10+Math.random()*20;
this.yVel = -10+Math.random()*20;
}
canvas.filters = filterArray;
drawCord();
copyStage();
var nextX = this.xVel+this._x;
var nextY = this.yVel+this._y;
if (nextXthis.xmax) {
this.xVel = (this.xVel+Math.random()*10)*-1;
nextX = this.xmax-(nextX-this.xmax);
} else if (nextXthis.xmin) {
this.xVel = (this.xVel+Math.random()*10)*-1;
nextX = this.xmin+(this.xmin-nextX);
}
if (nextYthis.ymax) {
this.yVel = (this.yVel+Math.random()*10)*-1;
nextY = this.ymax-(nextY-this.ymax);
} else if (nextYthis.ymin) {
this.yVel = (this.yVel+Math.random()*10)*-1;
nextY = this.ymin+(this.ymin-nextY);
}
this._x = nextX;
this._y = nextY;
onScreen.copyPixels(offScreen1, offScreen1.rectangle,
zeroPoint);
onScreen.applyFilter(offScreen1, offScreen1.rectangle, new
Point(0, 0), sfilter);
offScreen1.draw(_root, myMatrix, myColorTransform,
blendMode, myRectangle, smooth);
};
[/as]

Although it may be something to do with the application of the
filter

Scuse the dodgy code - WIP.

M



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf
Of Mike Duguid
Sent: 30 January 2006 22:44
To: Flashcoders mailing list
Subject: Re: [Flashcoders] ConvolutionFilter performance

Mike, do you have an example of this? My current test shows
the opposite - that convolution is proving more cpu intensive
than blurfilter?



Mike Mountain  [EMAIL

Re: [Flashcoders] ConvolutionFilter performance

2006-01-31 Thread Cédric Muller
 mailing list
Subject: Re: [Flashcoders] ConvolutionFilter performance

Mike, do you have an example of this? My current test shows
the opposite - that convolution is proving more cpu intensive
than blurfilter?



Mike Mountain  [EMAIL PROTECTED] wrote:
In my tests convolution filter was much faster than a  
blurfilter.

But it's an easy one to swap oout and test for yourself...




Andreas R�nning [EMAIL PROTECTED] wrote:
Does anyone know which is faster; a blurring one-pass  
convolution

filter or a blurfilter? Or are they just 2 sides to the

same story? I

need a high performance blur operation for depth of field..

Cheers,

- Andreas

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




--
--- 
---
--- 
---

-
Franto

http://blog.franto.com
http://www.flashcoders.sk
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




--
- 
- 
---

Franto

http://blog.franto.com
http://www.flashcoders.sk
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] ConvolutionFilter performance

2006-01-31 Thread franto
) {
  this.yVel = (this.yVel+Math.random()*10)*-1;
  nextY = this.ymax-(nextY-this.ymax);
  } else if (nextYthis.ymin) {
  this.yVel = (this.yVel+Math.random()*10)*-1;
  nextY = this.ymin+(this.ymin-nextY);
  }
  this._x = nextX;
  this._y = nextY;
  onScreen.copyPixels(offScreen1, offScreen1.rectangle,
  zeroPoint);
  onScreen.applyFilter(offScreen1, offScreen1.rectangle, new
  Point(0, 0), sfilter);
  offScreen1.draw(_root, myMatrix, myColorTransform,
  blendMode, myRectangle, smooth);
  };
  [/as]
 
  Although it may be something to do with the application of the
  filter
 
  Scuse the dodgy code - WIP.
 
  M
 
 
  -Original Message-
  From: [EMAIL PROTECTED]
  [mailto:[EMAIL PROTECTED] On Behalf
  Of Mike Duguid
  Sent: 30 January 2006 22:44
  To: Flashcoders mailing list
  Subject: Re: [Flashcoders] ConvolutionFilter performance
 
  Mike, do you have an example of this? My current test shows
  the opposite - that convolution is proving more cpu intensive
  than blurfilter?
 
 
  Mike Mountain  [EMAIL PROTECTED] wrote:
  In my tests convolution filter was much faster than a
  blurfilter.
  But it's an easy one to swap oout and test for yourself...
 
 
  Andreas R�nning [EMAIL PROTECTED] wrote:
  Does anyone know which is faster; a blurring one-pass
  convolution
  filter or a blurfilter? Or are they just 2 sides to the
  same story? I
  need a high performance blur operation for depth of field..
 
  Cheers,
 
  - Andreas
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
 
 
  --
  ---
  ---
  ---
  ---
  -
  Franto
 
  http://blog.franto.com
  http://www.flashcoders.sk
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
 
 
  --
  -
  -
  ---
  Franto
 
  http://blog.franto.com
  http://www.flashcoders.sk
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



--
-
Franto

http://blog.franto.com
http://www.flashcoders.sk
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] ConvolutionFilter performance

2006-01-31 Thread Mike Mountain
in IE convo is still faster - not got firefox at work so can't test.

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of franto
 Sent: 31 January 2006 10:35
 To: Flashcoders mailing list
 Subject: Re: [Flashcoders] ConvolutionFilter performance
 
 in your performance test in Firefox, all seems same for me, 
 little bit blur has slower
 
 but CPU usage on blur: 38-40 %
 on convo: 34 - 38%
 
 my previous tests was in Flash IDE
 
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] ConvolutionFilter performance

2006-01-31 Thread Ian Thomas
I definitely get better performance out of Convo rather than Blur in both
Firefox and IE on Win XP.

Cheers,
  Ian

On 1/31/06, franto [EMAIL PROTECTED] wrote:

 in your performance test in Firefox, all seems same for me, little bit
 blur has slower

 but CPU usage on blur: 38-40 %
 on convo: 34 - 38%

 my previous tests was in Flash IDE


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] ConvolutionFilter performance

2006-01-31 Thread Mike Duguid
I notice between lines 29  33 of your convolution version you have
pushed a blurFilter into the filterArray - if you remove this from
both versions and rely on convolution purely for blurring, as you can
observe the effect isn't as pronounced as directly applying a
blurFilter - to get an effective blur from a single iteration of a
convolution matrix I've found requires a 5x5 matrix or alternatively
use multiple iterations which may negate any cpu advantage that a
single 3x3 convolution matrix application has?


On 1/31/06, Mike Mountain [EMAIL PROTECTED] wrote:
 Looks like:

 Convolution = better on PC
 Blur = better on mac

 Oh joy

  -Original Message-
  From: [EMAIL PROTECTED]
  [mailto:[EMAIL PROTECTED] On Behalf
  Of Cédric Muller
  Sent: 31 January 2006 09:44
  To: Flashcoders mailing list
  Subject: Re: [Flashcoders] ConvolutionFilter performance
 
  I am using Flash 8 on OS X 10.4
 
  ?? really strange ...
 
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] ConvolutionFilter performance

2006-01-31 Thread Mike Mountain

 I notice between lines 29  33 of your convolution version 
 you have pushed a blurFilter into the filterArray 

It's blurring the individual item - the second time around blurs the
entire canvas. 

This still means 

Blur + blur = slow on Pc/ fast on mac
blur + convo slow on mac/fast on PC

- if you 
 remove this from both versions and rely on convolution purely 
 for blurring, as you can observe the effect isn't as 
 pronounced 

But there's still a performance difference  - which is platform
dependant, which to me is an issue.

as directly applying a blurFilter - to get an 
 effective blur from a single iteration of a convolution 
 matrix I've found requires a 5x5 matrix or alternatively use 
 multiple iterations which may negate any cpu advantage that a 
 single 3x3 convolution matrix application has?

Go for it - obviously you'd use the best technique in order to achieve
the effect you desire.

Like I say this code is WIP but I thought it demonstrates the
differences quite effectively.

M
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] ConvolutionFilter performance

2006-01-31 Thread Cédric Muller
I am still puzzled about that thing ... (unbalanced results on PC vs  
MAC)

...



I notice between lines 29  33 of your convolution version
you have pushed a blurFilter into the filterArray


It's blurring the individual item - the second time around blurs the
entire canvas.

This still means

Blur + blur = slow on Pc/ fast on mac
blur + convo slow on mac/fast on PC

- if you

remove this from both versions and rely on convolution purely
for blurring, as you can observe the effect isn't as
pronounced


But there's still a performance difference  - which is platform
dependant, which to me is an issue.

as directly applying a blurFilter - to get an

effective blur from a single iteration of a convolution
matrix I've found requires a 5x5 matrix or alternatively use
multiple iterations which may negate any cpu advantage that a
single 3x3 convolution matrix application has?


Go for it - obviously you'd use the best technique in order to achieve
the effect you desire.

Like I say this code is WIP but I thought it demonstrates the
differences quite effectively.

M
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] ConvolutionFilter performance

2006-01-31 Thread franto
nice example :)) maybe let the result textfield editable, to be able
past results ;)

blur: 12740
convo3x3 : 9092
convo5x5: 36517   uff
no filter: 5634

it's very interesting topic, i will post in on my blog to have more results...
can I?



On 1/31/06, Mike Duguid [EMAIL PROTECTED] wrote:
 I've stuck another example here: http://www.flashcool.com/blur.html
 On the pc, as Mike said, convolution is faster, but if you need more
 than a subtle blur may not be what's required.

 On 1/30/06, Andreas Rønning [EMAIL PROTECTED] wrote:
  Does anyone know which is faster; a blurring one-pass convolution filter
  or a blurfilter? Or are they just 2 sides to the same story? I need a
  high performance blur operation for depth of field..
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



--
-
Franto

http://blog.franto.com
http://www.flashcoders.sk
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] ConvolutionFilter performance

2006-01-31 Thread Mike Mountain
In that test the convolution filter came out marginally faster than no
filters at all!


 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf 
 Of Mike Duguid
 Sent: 31 January 2006 13:05
 To: Flashcoders mailing list
 Subject: Re: [Flashcoders] ConvolutionFilter performance
 
 I've stuck another example here: http://www.flashcool.com/blur.html
 On the pc, as Mike said, convolution is faster, but if you 
 need more than a subtle blur may not be what's required.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] ConvolutionFilter performance

2006-01-31 Thread Mike Mountain
Are these just the filters applied to a stright MC? It'd be interesting to see 
the same thing done double buffered - with the filters being applied to the 
bitmapdata before it is drawn back.

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf 
 Of Mike Duguid
 Sent: 31 January 2006 13:05
 To: Flashcoders mailing list
 Subject: Re: [Flashcoders] ConvolutionFilter performance
 
 I've stuck another example here: http://www.flashcool.com/blur.html
 On the pc, as Mike said, convolution is faster, but if you 
 need more than a subtle blur may not be what's required.
 
 On 1/30/06, Andreas Rønning [EMAIL PROTECTED] wrote:
  Does anyone know which is faster; a blurring one-pass convolution 
  filter or a blurfilter? Or are they just 2 sides to the 
 same story? I 
  need a high performance blur operation for depth of field..
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] ConvolutionFilter performance

2006-01-31 Thread franto
but not on PC :))

On 1/31/06, Mike Mountain [EMAIL PROTECTED] wrote:
 In that test the convolution filter came out marginally faster than no
 filters at all!


  -Original Message-
  From: [EMAIL PROTECTED]
  [mailto:[EMAIL PROTECTED] On Behalf
  Of Mike Duguid
  Sent: 31 January 2006 13:05
  To: Flashcoders mailing list
  Subject: Re: [Flashcoders] ConvolutionFilter performance
 
  I've stuck another example here: http://www.flashcool.com/blur.html
  On the pc, as Mike said, convolution is faster, but if you
  need more than a subtle blur may not be what's required.
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



--
-
Franto

http://blog.franto.com
http://www.flashcoders.sk
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] ConvolutionFilter performance

2006-01-31 Thread franto
and i got 2.8Ghx, 512MB Ram PC :)

On 1/31/06, franto [EMAIL PROTECTED] wrote:
 but not on PC :))

 On 1/31/06, Mike Mountain [EMAIL PROTECTED] wrote:
  In that test the convolution filter came out marginally faster than no
  filters at all!
 
 
   -Original Message-
   From: [EMAIL PROTECTED]
   [mailto:[EMAIL PROTECTED] On Behalf
   Of Mike Duguid
   Sent: 31 January 2006 13:05
   To: Flashcoders mailing list
   Subject: Re: [Flashcoders] ConvolutionFilter performance
  
   I've stuck another example here: http://www.flashcool.com/blur.html
   On the pc, as Mike said, convolution is faster, but if you
   need more than a subtle blur may not be what's required.
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 


 --
 -
 Franto

 http://blog.franto.com
 http://www.flashcoders.sk



--
-
Franto

http://blog.franto.com
http://www.flashcoders.sk
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] ConvolutionFilter performance

2006-01-31 Thread Mike Mountain
 Yes - on my PC.

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of franto
 Sent: 31 January 2006 13:21
 To: Flashcoders mailing list
 Subject: Re: [Flashcoders] ConvolutionFilter performance
 
 but not on PC :))
 
 On 1/31/06, Mike Mountain [EMAIL PROTECTED] wrote:
  In that test the convolution filter came out marginally 
 faster than no 
  filters at all!
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] ConvolutionFilter performance

2006-01-31 Thread Mike Duguid
just applied directly to mc. whoops there was a bug in there too, I've
added the fla to the page if anybody wants to muck about with it

 Are these just the filters applied to a stright MC? It'd be interesting to 
 see the same thing done double buffered - with the filters being applied to 
 the bitmapdata before it is drawn back.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] ConvolutionFilter performance

2006-01-31 Thread franto
so, please wrote the times, its really strange

On 1/31/06, Mike Mountain [EMAIL PROTECTED] wrote:
  Yes - on my PC.

  -Original Message-
  From: [EMAIL PROTECTED]
  [mailto:[EMAIL PROTECTED] On Behalf Of franto
  Sent: 31 January 2006 13:21
  To: Flashcoders mailing list
  Subject: Re: [Flashcoders] ConvolutionFilter performance
 
  but not on PC :))
 
  On 1/31/06, Mike Mountain [EMAIL PROTECTED] wrote:
   In that test the convolution filter came out marginally
  faster than no
   filters at all!
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



--
-
Franto

http://blog.franto.com
http://www.flashcoders.sk
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] ConvolutionFilter performance

2006-01-31 Thread Mike Mountain
 

 so, please wrote the times, its really strange

Blur: 5622
Conv 3x3: 5625
Conv 5x5: 14453
None: 5640
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] ConvolutionFilter performance

2006-01-31 Thread franto
Firefox:

blurFilter blur v convolution blur
blur filter time : 9382
convolution 3x3 (not very blurry though) : 8037
convolution 5x5 (more blurry but still not very) : 36431
no filter : 5637

IE:

blurFilter blur v convolution blur
blur filter time : 5771
convolution 3x3 (not very blurry though) : 5625
convolution 5x5 (more blurry but still not very) : 31900
no filter : 5648

Flash IDE (120 FPS):

blurFilter blur v convolution blur
blur filter time : 4849
convolution 3x3 (not very blurry though) : 3556
convolution 5x5 (more blurry but still not very) : 32154
no filter : 2909


Flash IDE (30 FPS):

blurFilter blur v convolution blur
blur filter time : 12129
convolution 3x3 (not very blurry though) : 12139
convolution 5x5 (more blurry but still not very) : 32906
no filter : 1216


On 1/31/06, franto [EMAIL PROTECTED] wrote:
 so, please wrote the times, its really strange

 On 1/31/06, Mike Mountain [EMAIL PROTECTED] wrote:
   Yes - on my PC.
 
   -Original Message-
   From: [EMAIL PROTECTED]
   [mailto:[EMAIL PROTECTED] On Behalf Of franto
   Sent: 31 January 2006 13:21
   To: Flashcoders mailing list
   Subject: Re: [Flashcoders] ConvolutionFilter performance
  
   but not on PC :))
  
   On 1/31/06, Mike Mountain [EMAIL PROTECTED] wrote:
In that test the convolution filter came out marginally
   faster than no
filters at all!
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 


 --
 -
 Franto

 http://blog.franto.com
 http://www.flashcoders.sk



--
-
Franto

http://blog.franto.com
http://www.flashcoders.sk
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] ConvolutionFilter performance

2006-01-31 Thread Cédric Muller

ok, thanks

Conclusion:
convolution filters plainly DON'T WORK on macs ... (dualcore 2ghz!)



I've stuck another example here: http://www.flashcool.com/blur.html
On the pc, as Mike said, convolution is faster, but if you need more
than a subtle blur may not be what's required.

On 1/30/06, Andreas Rønning [EMAIL PROTECTED] wrote:
Does anyone know which is faster; a blurring one-pass convolution  
filter

or a blurfilter? Or are they just 2 sides to the same story? I need a
high performance blur operation for depth of field..

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] ConvolutionFilter performance

2006-01-31 Thread Cédric Muller

blur filter time : 7295
convolution 3x3 (not very blurry though) : 31391
convolution 5x5 (more blurry but still not very) : 56559
no filter : 7265

Mac OS 10.4.4
DualCore G5  2x2Ghz

:-))
so shitty I have now have to go for a sleep ... or book a room in a  
sanatorium


oh oh
you want a scoop ?

Flash is no more ubiquitous ;)

of course, this has to do with hardware acceleration  AND decceleration


nice example :)) maybe let the result textfield editable, to be able
past results ;)

blur: 12740
convo3x3 : 9092
convo5x5: 36517   uff
no filter: 5634

it's very interesting topic, i will post in on my blog to have more  
results...

can I?



On 1/31/06, Mike Duguid [EMAIL PROTECTED] wrote:

I've stuck another example here: http://www.flashcool.com/blur.html
On the pc, as Mike said, convolution is faster, but if you need more
than a subtle blur may not be what's required.

On 1/30/06, Andreas Rønning [EMAIL PROTECTED] wrote:
Does anyone know which is faster; a blurring one-pass convolution  
filter
or a blurfilter? Or are they just 2 sides to the same story? I  
need a

high performance blur operation for depth of field..

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




--
-- 
-- 
-

Franto

http://blog.franto.com
http://www.flashcoders.sk
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] ConvolutionFilter performance

2006-01-31 Thread Ian Thomas
Hrm. I get:

blur filter time : 11032
convolution 3x3: 10144
convolution 5x5: 37781
no filter : 7510

Win XP, 3GHz, 512MB RAM

I wonder if it's a graphics card/hardware acceleration thing. (I have a
rubbish graphics card.)

Ian

On 1/31/06, Mike Mountain [EMAIL PROTECTED] wrote:



  so, please wrote the times, its really strange

 Blur: 5622
 Conv 3x3: 5625
 Conv 5x5: 14453
 None: 5640
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] ConvolutionFilter performance

2006-01-31 Thread chris
Blur: 5944
convolution 3x3: 5641
convolution 5x5: 29932
no filter: 5646

also Win XP, 3GHz (northwood), 512MB RAM - intel 915 GAV motherboard w/built in 
crap vga

-Oorspronkelijk bericht-
Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Namens Ian Thomas
Verzonden: dinsdag 31 januari 2006 14:48
Aan: Flashcoders mailing list
Onderwerp: Re: [Flashcoders] ConvolutionFilter performance

Hrm. I get:

blur filter time : 11032
convolution 3x3: 10144
convolution 5x5: 37781
no filter : 7510

Win XP, 3GHz, 512MB RAM

I wonder if it's a graphics card/hardware acceleration thing. (I have a
rubbish graphics card.)

Ian

On 1/31/06, Mike Mountain [EMAIL PROTECTED] wrote:



  so, please wrote the times, its really strange

 Blur: 5622
 Conv 3x3: 5625
 Conv 5x5: 14453
 None: 5640
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] ConvolutionFilter performance

2006-01-31 Thread Kalle Thyselius, inlovewith
powerbook 15, 1.25 GHz, 1GB RAM:

blur filter: 13 745
convolution 3x3: 44 437
convolution 5x5 : 119 497
no filter : 7 216


kalle




On 1/31/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 Blur: 5944
 convolution 3x3: 5641
 convolution 5x5: 29932
 no filter: 5646

 also Win XP, 3GHz (northwood), 512MB RAM - intel 915 GAV motherboard w/built 
 in crap vga

 -Oorspronkelijk bericht-
 Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Namens Ian Thomas
 Verzonden: dinsdag 31 januari 2006 14:48
 Aan: Flashcoders mailing list
 Onderwerp: Re: [Flashcoders] ConvolutionFilter performance

 Hrm. I get:

 blur filter time : 11032
 convolution 3x3: 10144
 convolution 5x5: 37781
 no filter : 7510

 Win XP, 3GHz, 512MB RAM

 I wonder if it's a graphics card/hardware acceleration thing. (I have a
 rubbish graphics card.)

 Ian

 On 1/31/06, Mike Mountain [EMAIL PROTECTED] wrote:
 
 
 
   so, please wrote the times, its really strange
 
  Blur: 5622
  Conv 3x3: 5625
  Conv 5x5: 14453
  None: 5640
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



--
inlovewith.com
inlovewith ltd.
kalle thyselius
linnégatan 76, stockholm, sweden
+ 46 707 602 600
inlovewith you
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] ConvolutionFilter performance

2006-01-31 Thread David Rorex
win xp
amd sempron 3100+ 1.8ghz 960MB ram
crappy integrated gfx card

--
firefox FP8

blur : 9720
convolution 3x3 : 8836
convolution 5x5 : 38737
no filter : 5372
--
IE FP 8.5

blur : 5965
convolution 3x3 : 5704
convolution 5x5 : 39783
no filter : 5717

On 1/31/06, Kalle Thyselius, inlovewith [EMAIL PROTECTED] wrote:

 powerbook 15, 1.25 GHz, 1GB RAM:

 blur filter: 13 745
 convolution 3x3: 44 437
 convolution 5x5 : 119 497
 no filter : 7 216


 kalle




 On 1/31/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
  Blur: 5944
  convolution 3x3: 5641
  convolution 5x5: 29932
  no filter: 5646
 
  also Win XP, 3GHz (northwood), 512MB RAM - intel 915 GAV motherboard
 w/built in crap vga
 
  -Oorspronkelijk bericht-
  Van: [EMAIL PROTECTED] [mailto:
 [EMAIL PROTECTED] Namens Ian Thomas
  Verzonden: dinsdag 31 januari 2006 14:48
  Aan: Flashcoders mailing list
  Onderwerp: Re: [Flashcoders] ConvolutionFilter performance
 
  Hrm. I get:
 
  blur filter time : 11032
  convolution 3x3: 10144
  convolution 5x5: 37781
  no filter : 7510
 
  Win XP, 3GHz, 512MB RAM
 
  I wonder if it's a graphics card/hardware acceleration thing. (I have a
  rubbish graphics card.)
 
  Ian
 
  On 1/31/06, Mike Mountain [EMAIL PROTECTED] wrote:
  
  
  
so, please wrote the times, its really strange
  
   Blur: 5622
   Conv 3x3: 5625
   Conv 5x5: 14453
   None: 5640
   ___
   Flashcoders mailing list
   Flashcoders@chattyfig.figleaf.com
   http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
  
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 


 --
 inlovewith.com
 inlovewith ltd.
 kalle thyselius
 linnégatan 76, stockholm, sweden
 + 46 707 602 600
 inlovewith you
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] ConvolutionFilter performance

2006-01-31 Thread Weyert de Boer

Mike Mountain wrote:

In my tests convolution filter was much faster than a blurfilter.
But it's an easy one to swap oout and test for yourself... 
  
Of course you could use the ConvolutionFilter on the pc, and BlurFilter 
on the mac by using: System.capabilities.os ;=)
Anyway on my computer the BlurFilter looks better quality-wise then the 
ConvolutionFilter version. Anyway where can I find

the flash movie with the timing?


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] ConvolutionFilter performance

2006-01-31 Thread elibol
In both IE and Firefox the convultion filter is much quicker.

I had a strange experience with this, in the Flash IDE test that I made, the
blurFilter was VERY slow, however, when I hold on to the window, the filter
begins processing quicker. When I right click on the window, the same
happens.

these are my results for Duguids code:

Windows XP SP2 2 gigs of ram @ 2Ghz

blurFilter blur v convolution blur

blur filter time : 8825

convolution 3x3 (not very blurry though) : 7519

convolution 5x5 (more blurry but still not very) : 32372

no filter : 5636


Could it maybe have to do with the OSX superior UI rendering capabilities?

M.

On 1/31/06, Weyert de Boer [EMAIL PROTECTED] wrote:

 Mike Mountain wrote:
  In my tests convolution filter was much faster than a blurfilter.
  But it's an easy one to swap oout and test for yourself...
 
 Of course you could use the ConvolutionFilter on the pc, and BlurFilter
 on the mac by using: System.capabilities.os ;=)
 Anyway on my computer the BlurFilter looks better quality-wise then the
 ConvolutionFilter version. Anyway where can I find
 the flash movie with the timing?


 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] ConvolutionFilter performance

2006-01-30 Thread Andreas Rønning
Does anyone know which is faster; a blurring one-pass convolution filter 
or a blurfilter? Or are they just 2 sides to the same story? I need a 
high performance blur operation for depth of field..


Cheers,

- Andreas
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] ConvolutionFilter performance

2006-01-30 Thread Mike Mountain
In my tests convolution filter was much faster than a blurfilter.

But it's an easy one to swap oout and test for yourself... 

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf 
 Of Andreas Rønning
 Sent: 30 January 2006 10:03
 To: Flashcoders mailing list
 Subject: [Flashcoders] ConvolutionFilter performance
 
 Does anyone know which is faster; a blurring one-pass 
 convolution filter or a blurfilter? Or are they just 2 sides 
 to the same story? I need a high performance blur operation 
 for depth of field..
 
 Cheers,
 
 - Andreas
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] ConvolutionFilter performance

2006-01-30 Thread Mike Duguid
Mike, do you have an example of this? My current test shows the
opposite - that convolution is proving more cpu intensive than
blurfilter?


 Mike Mountain  [EMAIL PROTECTED] wrote:
 In my tests convolution filter was much faster than a blurfilter.
 But it's an easy one to swap oout and test for yourself...


 Andreas Rønning [EMAIL PROTECTED] wrote:
 Does anyone know which is faster; a blurring one-pass convolution filter
 or a blurfilter? Or are they just 2 sides to the same story? I need a
 high performance blur operation for depth of field..

 Cheers,

 - Andreas
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders