|
|
andreahmed, Member
Posted: 09 October 2013 11:14 AM Total Posts: 62
[ # 17 ]
I got another idea. I won’t care about both frameworks, and just start with the stage3d, and get a vertex, pixel shader works, with motion blur, as an abstract way, then add the result to away3d texture, providing the context3d,..etc.
Will just work with the first abstraction layer.
|
andreahmed, Member
Posted: 10 October 2013 09:42 AM Total Posts: 62
[ # 18 ]
What is the mature way or the correct way for adding the motion blur, If i hate a lot of symbols, and each symbol has its own material or texture. Should I blur each symbol’s texture ?
This is scenario, but If I have another scenario, that I have all the symbols or the bitmaps are embedded in just one texture, should I add blur for the resultant big texture ? it will be slow ?
|
GoroMatsumoto, Sr. Member
Posted: 10 October 2013 10:41 AM Total Posts: 166
[ # 19 ]
Maybe, you should try CPU blur.
And if I’m have same problem,
I will make each reel’s texture as bitmapdata on the fly.
And blur them on CPU.
|
andreahmed, Member
Posted: 10 October 2013 11:48 AM Total Posts: 62
[ # 20 ]
is there a way to convert the material to bitmapdata ? or converting the texture to bitmapdata?
You know, I’m sure 100% that downloading from the GPU to CPU will be really really slow.
|
GoroMatsumoto, Sr. Member
Posted: 10 October 2013 12:43 PM Total Posts: 166
[ # 21 ]
No no. Sorry, maybe my english was not so good.
At first, you make a bitmapdata.
And convert it to a texture and upload to GPU.
And on each frame, blur the bitmapdata, convert one, and upload.
Good luck.
|
andreahmed, Member
Posted: 10 October 2013 01:04 PM Total Posts: 62
[ # 22 ]
yes but adding motion blur in that way, is really CPU consuming correct?
How would I change the blur dynamically, If I had to add it while bluring the bitmapdata?
|
GoroMatsumoto, Sr. Member
Posted: 10 October 2013 01:17 PM Total Posts: 166
[ # 23 ]
Just change blur amount.
About the performance,
you should try and confirm it by yourself.
|
andreahmed, Member
Posted: 10 October 2013 01:21 PM Total Posts: 62
[ # 24 ]
My main problem is : I had to iterate through the bitmaps and apply filter to them, then make a big texture out of them, then model the cylinder.
So I can not add a motion blur in that case
In Each frame, I do that:
but the bitmaps should be dynamically loaded, and texture with model with them, and have gradual blur over the bitmapsdata, and that is impossible in that way, because I have to create again the last bitmaps ( symbols) that was there before bluring and upload them to texture…
TweenMax.delayedCall(4, onFinish); function onFinish():void { if ( loader[0]) { var mesh:Mesh = Mesh(loader[0].getChildAt(0)); if (Update) { Update = false; var matrix:Matrix = new Matrix(); for (var j:int = 0; j < bitmaps.length; j++) { blur.blurX = 10; blur.blurY = 10; blur.quality = BitmapFilterQuality.MEDIUM; bitmaps[j].applyFilter( bitmaps[j] ,new Rectangle(0,0,128, 128),new Point(0,0),blur); } // draw 36 var offsetx:Number = 0; var offsety:int = 0; for (var i2:int = 0; i2 < 2; i2++) { for (var j:int = 0; j < 16; j++) { matrix.identity(); matrix.translate(offsetx,offsety); render.draw(bitmaps[j], matrix); offsetx+=128; } offsetx =0; offsety+=129; } for (var j:int = 0; j < 4; j++) { matrix.identity(); matrix.translate(offsetx,offsety); render.draw(bitmaps[j], matrix); offsetx+=128; } m_BlurText = new TextureMaterial ( new BitmapTexture( render) ) ; mesh.material = m_BlurText; } } TweenMax.delayedCall(5, finish); function finish():void{ mesh.material = m_finalText; } }
|