Motion blur

Software: Away3D 4.x

andreahmed, Member
Posted: 04 October 2013 08:21 AM   Total Posts: 62

Hi All,

What is the easiest approach to add a motion blur for a 3D Object or its texture using away3d ?

Should I use AGAL or is there a simpler and faster approach ?

   

Avatar
SharpEdge, Member
Posted: 04 October 2013 01:20 PM   Total Posts: 94   [ # 1 ]

you can look at Nvidia documentation, it’s really complete: developer.nvidia.com

   

Avatar
GoroMatsumoto, Sr. Member
Posted: 05 October 2013 01:12 AM   Total Posts: 166   [ # 2 ]

Away3D already has “MotionBlurFilter3D”.
The algorithm looks almost same as Nvidia’s way.

   

andreahmed, Member
Posted: 05 October 2013 06:55 AM   Total Posts: 62   [ # 3 ]

but it is only works for the whole scene. I just one texture or one model to be blurred.

   

Avatar
GoroMatsumoto, Sr. Member
Posted: 05 October 2013 07:14 AM   Total Posts: 166   [ # 4 ]

http://john-chapman-graphics.blogspot.jp/2013/01/per-object-motion-blur.html
Try to implement like this.

   

andreahmed, Member
Posted: 05 October 2013 07:35 AM   Total Posts: 62   [ # 5 ]

Thanks goro. What about a simple blur ? Is there a fast way instead of applying gaussian blur,..etc. ?

If I have cylinder with multiple textures for example, If I would like to apply blur on that object, how about blur each texture ? is this a good method ?

   

Avatar
GoroMatsumoto, Sr. Member
Posted: 05 October 2013 07:59 AM   Total Posts: 166   [ # 6 ]

I can’t imagine of your situation very well.
If you blur your cylinder’s texture only,
outlines of it’s geometry are sharp yet.
That doesn’t look like a motion blur, you know?

Anyway, if you want a motion blur on 3d,
you have to apply the effect to rendered scene texture.
Basically, it’s very different from legacy 2d flash.

If you don’t know about 3d graphics very well,
I recommend the MotionBlurFilter3D class.
And try to learn more about 3d graphic rendering : )

 

   

andreahmed, Member
Posted: 05 October 2013 08:16 AM   Total Posts: 62   [ # 7 ]

How would that class help me ? Can it be applied to one texture ?

1) Well, the cylinder’s sides are not important, I’m trying to simulate a slot reel machine, so I want to blur the reel (textures) when its spinning. The only part of the cylinder that will be shown to the viewer, is the symbols side only, and those that are needed to be blurred I think… ?


2) What would you suggest more for learning ? books ? directions ? articles ?

Thanks for your reply and for your help!

   

Avatar
GoroMatsumoto, Sr. Member
Posted: 05 October 2013 08:35 AM   Total Posts: 166   [ # 8 ]

I see.

1) At this moment, Away3d doesn’t have a blur class like you described.
You have to blur each texture on CPU, and upload to GPU on each frame.

2)
Away3D example sources:
https://github.com/away3d/away3d-examples-fp11
You can know what can we do with Away3d.

Tutorials:
http://away3d.com/tutorials/Special:Titles

and searching on internet for more advanced technics or tuts.
Cheers.

   

andreahmed, Member
Posted: 05 October 2013 08:44 AM   Total Posts: 62   [ # 9 ]

I thought about the idea of uploading the textures, after bluring to the GPU.
But is it possible to just blur the final texture that is applied to the 3D Model, on Just the GPU ?  I know I have to write an agal shader for that, correct?

   

Avatar
GoroMatsumoto, Sr. Member
Posted: 05 October 2013 09:04 AM   Total Posts: 166   [ # 10 ]

You should write the shader as MaterialMethod.
Good luck.

   

Avatar
SharpEdge, Member
Posted: 07 October 2013 08:11 AM   Total Posts: 94   [ # 11 ]

As Matsumoto said if you want to apply a GPU Blur you should follow the link of Matsumoto with the guide to the AGAL code, otherwise, if you choose to blur it with CPU ( for your needs i think it’s the best) you could use some basic AS3 filters on the texture, like this: BlurFilter

   

GrokDD, Newbie
Posted: 08 October 2013 03:09 AM   Total Posts: 28   [ # 12 ]

Perhaps,
Another approach.

Having two or three textures for each symbol with variance of degree of blur, and hot swap them on the fly, based on the rate of the wheel spinning.

if I understand correctly, you want to blur the slot symbols as they spin at high speeds as the user pulls the wheel.

So have several predefined reels with photoshoped blured symbols. Based on the speed of rotation, change the texture on the reel mesh to suit your visual tastes.

Or…. Better approach, have three separate reels in the scene with three different levels of pre-blured symbols. Then as the reels speed up or slow down, the alpha of the reels increase or decrease to expose the blury-er or less blured reel as needed.  I think this would be less noticeable transition then my first idea.

Good luck!

 

   

GrokDD, Newbie
Posted: 08 October 2013 03:10 AM   Total Posts: 28   [ # 13 ]
   

Avatar
GoroMatsumoto, Sr. Member
Posted: 08 October 2013 04:37 AM   Total Posts: 166   [ # 14 ]

@SharpEdge
Yes, I think so too.
CPU blur is a better way.

@GrokDD
Nice idea. And Away3d has sprite sheet animation feature.
http://away3d.com/tutorials/Using_sprite_sheets_in_your_project
As my experience, texture uploading is a little heavy task.
The sprite sheet animation is better than uploading a bitmap on every frame.

@andreahmed
If you write the shader, here is a hint of AGAL.
https://github.com/away3d/away3d-core-fp11/blob/master/src/away3d/filters/tasks/Filter3DVBlurTask.as

Cheers.

   

andreahmed, Member
Posted: 09 October 2013 09:53 AM   Total Posts: 62   [ # 15 ]

Thanks Goro
I’m trying to add the motion blur class that is in starting and integrate it with Away3d.

I have two options
1. Integrate the whole starting project, and share the context and use the filter, but I will find problems with different textures architecture between both frameworks

2. Just copy the fragmenet shader class and integrate it in away3d, but I really do not know how complex is that, because the filter classes in away3d is not really clear.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X