DOF: Blur effects

12 messages Options
Embed this post
Permalink
Richard-219

DOF: Blur effects

Reply Threaded More More options
Print post
Permalink
Hello Everyone,

Mr. Doob or anyone else who may have an example. I would love to  
apply this DOF effect: http://mrdoob.com/lab/pv3d/dof/05/   , but  
could use a little help getting started.
Is there a tutorial on this floating around?
I believe I would be applying a blur effect on each object based on  
its distance from the camera? Not exactly sure how :)

Thanks!


_______________________________________________
Papervision3D mailing list
[hidden email]
http://osflash.org/mailman/listinfo/papervision3d_osflash.org
bryanschoen

Re: DOF: Blur effects

Reply Threaded More More options
Print post
Permalink
You can download his source from http://mrdoob.com/lab/pv3d/dof/07/dof07.fla
I would suggest you study his code.

 
On Mon, Apr 21, 2008 at 10:25 PM, Richard <[hidden email]> wrote:
Hello Everyone,

Mr. Doob or anyone else who may have an example. I would love to
apply this DOF effect: http://mrdoob.com/lab/pv3d/dof/05/   , but
could use a little help getting started.
Is there a tutorial on this floating around?
I believe I would be applying a blur effect on each object based on
its distance from the camera? Not exactly sure how :)

Thanks!


_______________________________________________
Papervision3D mailing list
[hidden email]
http://osflash.org/mailman/listinfo/papervision3d_osflash.org


_______________________________________________
Papervision3D mailing list
[hidden email]
http://osflash.org/mailman/listinfo/papervision3d_osflash.org
Lofih

Re: DOF: Blur effects

Reply Threaded More More options
Print post
Permalink
Hi bryan it's a quite different approach, mr doob's works well in a demo but in a real situation with dynamic objects it's just useless.

Although if you know your objects before hand clearly use mr doob's solution.

On Tue, Apr 22, 2008 at 6:30 PM, Bryan Schoen <[hidden email]> wrote:
You can download his source from http://mrdoob.com/lab/pv3d/dof/07/dof07.fla
I would suggest you study his code.

 
On Mon, Apr 21, 2008 at 10:25 PM, Richard <[hidden email]> wrote:
Hello Everyone,

Mr. Doob or anyone else who may have an example. I would love to
apply this DOF effect: http://mrdoob.com/lab/pv3d/dof/05/   , but
could use a little help getting started.
Is there a tutorial on this floating around?
I believe I would be applying a blur effect on each object based on
its distance from the camera? Not exactly sure how :)

Thanks!


_______________________________________________
Papervision3D mailing list
[hidden email]
http://osflash.org/mailman/listinfo/papervision3d_osflash.org


_______________________________________________
Papervision3D mailing list
[hidden email]
http://osflash.org/mailman/listinfo/papervision3d_osflash.org




--
Pedro Furtado
http://www.dreaminginflash.com
http://dailypv3d.wordpress.com
_______________________________________________
Papervision3D mailing list
[hidden email]
http://osflash.org/mailman/listinfo/papervision3d_osflash.org
laurent-2

Re: DOF: Blur effects

Reply Threaded More More options
Print post
Permalink
In reply to this post by bryanschoen

The technic used by Mr.Doob pre calculate the blur effect at
initialisation time storing the different blured image in an array. Then
at run time it gets the right key function of z-depth. So it's not for
dynamic object.
I used it in some experiment, in a different way as I stored the blured
image on each frame of a movieClip and used the imageSequence propertie
of the DisplayObject2D made by blitz agency. By now there's perhaps a
different sprite2D object in PV, I have no clue
I don't know if it's faster or slower, it's just the best way I was able
to do it as I was learning PV and AS3 at same time.
Tell me if you want some code I can sum up the piece here.

L


Bryan Schoen a écrit :

> You can download his source from
> http://mrdoob.com/lab/pv3d/dof/07/dof07.fla
> I would suggest you study his code.
>
>  
> On Mon, Apr 21, 2008 at 10:25 PM, Richard <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     Hello Everyone,
>
>     Mr. Doob or anyone else who may have an example. I would love to
>     apply this DOF effect: http://mrdoob.com/lab/pv3d/dof/05/   , but
>     could use a little help getting started.
>     Is there a tutorial on this floating around?
>     I believe I would be applying a blur effect on each object based on
>     its distance from the camera? Not exactly sure how :)
>
>     Thanks!
>
>
>     _______________________________________________
>     Papervision3D mailing list
>     [hidden email] <mailto:[hidden email]>
>     http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Papervision3D mailing list
> [hidden email]
> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>  


_______________________________________________
Papervision3D mailing list
[hidden email]
http://osflash.org/mailman/listinfo/papervision3d_osflash.org
kowen

Re: DOF: Blur effects

Reply Threaded More More options
Print post
Permalink
In reply to this post by Richard-219
I think he used movieclips. A movieclip with lets say.. 30 images from sharp to blur.
By calculating the distance between the movieclip and the camera, he changes the image within the movieclip.

Richard-219 wrote:
Hello Everyone,

Mr. Doob or anyone else who may have an example. I would love to  
apply this DOF effect: http://mrdoob.com/lab/pv3d/dof/05/   , but  
could use a little help getting started.
Is there a tutorial on this floating around?
I believe I would be applying a blur effect on each object based on  
its distance from the camera? Not exactly sure how :)

Thanks!


_______________________________________________
Papervision3D mailing list
Papervision3D@osflash.org
http://osflash.org/mailman/listinfo/papervision3d_osflash.org
Geoff Hinchcliffe

Re: DOF: Blur effects

Reply Threaded More More options
Print post
Permalink
In reply to this post by Richard-219
You can use the Effects branch to apply blur dynamically to achieve a  
DOF effect.
I have a crude example here:
http://gravitron.com.au/dof/

I'm not sure how feasible it would be to use the dynamic blurring in a  
"real" project.
And I'm not sure how/when the effects branch will be integrated into  
PV proper.

Cheers, Geoff

On 22/04/2008, at 3:25 PM, Richard wrote:

> Hello Everyone,
>
> Mr. Doob or anyone else who may have an example. I would love to
> apply this DOF effect: http://mrdoob.com/lab/pv3d/dof/05/   , but
> could use a little help getting started.
> Is there a tutorial on this floating around?
> I believe I would be applying a blur effect on each object based on
> its distance from the camera? Not exactly sure how :)
>
> Thanks!
>
>
> _______________________________________________
> Papervision3D mailing list
> [hidden email]
> http://osflash.org/mailman/listinfo/papervision3d_osflash.org


_______________________________________________
Papervision3D mailing list
[hidden email]
http://osflash.org/mailman/listinfo/papervision3d_osflash.org
Daniel O' Brian

Re: DOF: Blur effects

Reply Threaded More More options
Print post
Permalink

Hi Geoff,

Crude you may say it is but it looks like magic to me. Is this using the
effects layer approach?

Also would this allow the effect to be applied to a dynamic object with
interactive content?

On another note is there any indication of how long it will be before
any of this functionality is merged into GW. I know you guys are busy
working on GW beta but there's a world of people crying out for this
stuff out here.

Dan

From: [hidden email]
[mailto:[hidden email]] On Behalf Of Geoff
Hinchcliffe
Sent: 23 April 2008 07:35
To: [hidden email]
Subject: Re: [Papervision3D] DOF: Blur effects

You can use the Effects branch to apply blur dynamically to achieve a  
DOF effect.
I have a crude example here:
http://gravitron.com.au/dof/

I'm not sure how feasible it would be to use the dynamic blurring in a  
"real" project.
And I'm not sure how/when the effects branch will be integrated into  
PV proper.

Cheers, Geoff

On 22/04/2008, at 3:25 PM, Richard wrote:

> Hello Everyone,
>
> Mr. Doob or anyone else who may have an example. I would love to
> apply this DOF effect: http://mrdoob.com/lab/pv3d/dof/05/   , but
> could use a little help getting started.
> Is there a tutorial on this floating around?
> I believe I would be applying a blur effect on each object based on
> its distance from the camera? Not exactly sure how :)
>
> Thanks!
>
>
> _______________________________________________
> Papervision3D mailing list
> [hidden email]
> http://osflash.org/mailman/listinfo/papervision3d_osflash.org


_______________________________________________
Papervision3D mailing list
[hidden email]
http://osflash.org/mailman/listinfo/papervision3d_osflash.org

This email transmission is confidential and intended solely
for the person or organisation to whom it is addressed. If you
are not the intended recipient, you must not copy, distribute
or disseminate the information, or take any action in relation
to it and please delete this e-mail. Any views expressed in
this message are those of the individual sender, except where
the sender specifically states them to be the views of any
organisation or employer. If you have received this message
in error, do not open any attachment but please notify the
sender (above).  This message has been checked for all known
viruses powered by Messagelabs.  For further information
visit www.messagelabs.com/stats.asp  Please rely on your own
virus check as no responsibility is taken by the sender for
any damage rising out of any virus infection this communication
may contain.

LIDA Ltd 36 Golden Square, Soho, London, W1F 9EE, United Kingdom
Reg No. 03860916, registered in the United Kingdom.

_______________________________________________
Papervision3D mailing list
[hidden email]
http://osflash.org/mailman/listinfo/papervision3d_osflash.org
Geoff Hinchcliffe

Re: DOF: Blur effects

Reply Threaded More More options
Print post
Permalink
Some javascript/style in this post has been disabled (why?)
FYI:

Begin forwarded message:
From: Ralph Hauwert <[hidden email]>
Date: 12 April 2008 2:56:51 AM
Subject: Re: [Papervision3D] R:  effects and GW branch
Reply-To: [hidden email]

Currently, the effects branch is maintained by Andy; he's the only one officially working on this branch. The effects branch was a version for Andy to work in, and work done in that should be ported back to GW. Currently, GW is miles ahead of effects; it contains newer versions of most core classes. As such, the effects branch can be considered deprecated. It's there until we have a proper layering system in GW. This layering system will be slightly different from effects, and implemented in a future proof way.

To emulate layers in GW you can use multiple viewports with viewport object filters.

Regards,
Ralph.

On 23/04/2008, at 7:44 PM, Daniel O' Brian wrote:

On another note is there any indication of how long it will be before
any of this functionality is merged into GW. I know you guys are busy
working on GW beta but there's a world of people crying out for this
stuff out here.

Dan


_______________________________________________
Papervision3D mailing list
[hidden email]
http://osflash.org/mailman/listinfo/papervision3d_osflash.org
Geoff Hinchcliffe

Re: DOF: Blur effects

Reply Threaded More More options
Print post
Permalink
In reply to this post by Daniel O' Brian
Hi Dan,
that DOF example does use the effects layer approach.
It's been a while since I played around with it, so I had to remind  
myself as to what I'd done...

I think ou could use the effects on a dynamic object with interactive  
content.
The effects layers are much like typical Flash effects so they  
shouldn't prevent other functionality.
I had a previous version of the DOF where the letters could  be  
dragged and dropped.

Anyway, the main part of the script is this:

                        // blur each object relative to z position
                        for (var c:uint = 1; c<msg.length+1; c++) {
                                var obj:DisplayObject3D = planes["plane"+c];
                                var nm:String = obj.name;
                                // Remove effect
                                fxObj[nm].removeEffect(fxObj["fx"+nm]);
                                // Set blur amount based on sceneZ - z distance from scene 0 point
                                var blurAmt:Number = Math.round((Math.abs(obj.sceneZ)/50)/
blurInc)*blurInc;
                                fxObj["fx"+nm] = AbstractEffect(fxObj[nm].addEffect(new  
LayerEffect(new BlurFilter(blurAmt, blurAmt, 2))));
                                obj.renderLayer = fxObj[nm];
                        }
                        renderer.renderScene(scene, camera, viewport);

I'm sure it could be more elegantly put together, but you can see the  
basic idea.
The loop refers to the planes which are all named in numerical order.
(I've stored them all in an Object because the getChildByName function  
wouldn't work for me)
Blur is set using the sceneZ value.
The blurInc is just testing different increments for the blur effect.
Finally the effect is added to the plane.

Hope this helps.

I think there has been mention of plans to integrate effects into GW  
but perhaps in a different way to the Effects Branch approach.

cheers, Geoff

On 23/04/2008, at 7:44 PM, Daniel O' Brian wrote:

> Hi Geoff,
>
> Crude you may say it is but it looks like magic to me. Is this using  
> the
> effects layer approach?
>
> Also would this allow the effect to be applied to a dynamic object  
> with
> interactive content?
>
> On another note is there any indication of how long it will be before
> any of this functionality is merged into GW. I know you guys are busy
> working on GW beta but there's a world of people crying out for this
> stuff out here.
>
> Dan


_______________________________________________
Papervision3D mailing list
[hidden email]
http://osflash.org/mailman/listinfo/papervision3d_osflash.org
Daniel O' Brian

Re: DOF: Blur effects

Reply Threaded More More options
Print post
Permalink
Thanks Geoff,

That's a geat help

Danny

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Geoff
Hinchcliffe
Sent: 24 April 2008 12:09
To: [hidden email]
Subject: Re: [Papervision3D] DOF: Blur effects

Hi Dan,
that DOF example does use the effects layer approach.
It's been a while since I played around with it, so I had to remind  
myself as to what I'd done...

I think ou could use the effects on a dynamic object with interactive  
content.
The effects layers are much like typical Flash effects so they  
shouldn't prevent other functionality.
I had a previous version of the DOF where the letters could  be  
dragged and dropped.

Anyway, the main part of the script is this:

                        // blur each object relative to z position
                        for (var c:uint = 1; c<msg.length+1; c++) {
                                var obj:DisplayObject3D =
planes["plane"+c];
                                var nm:String = obj.name;
                                // Remove effect
                                fxObj[nm].removeEffect(fxObj["fx"+nm]);
                                // Set blur amount based on sceneZ - z
distance from scene 0 point
                                var blurAmt:Number =
Math.round((Math.abs(obj.sceneZ)/50)/
blurInc)*blurInc;
                                fxObj["fx"+nm] =
AbstractEffect(fxObj[nm].addEffect(new  
LayerEffect(new BlurFilter(blurAmt, blurAmt, 2))));
                                obj.renderLayer = fxObj[nm];
                        }
                        renderer.renderScene(scene, camera, viewport);

I'm sure it could be more elegantly put together, but you can see the  
basic idea.
The loop refers to the planes which are all named in numerical order.
(I've stored them all in an Object because the getChildByName function  
wouldn't work for me)
Blur is set using the sceneZ value.
The blurInc is just testing different increments for the blur effect.
Finally the effect is added to the plane.

Hope this helps.

I think there has been mention of plans to integrate effects into GW  
but perhaps in a different way to the Effects Branch approach.

cheers, Geoff

On 23/04/2008, at 7:44 PM, Daniel O' Brian wrote:

> Hi Geoff,
>
> Crude you may say it is but it looks like magic to me. Is this using  
> the
> effects layer approach?
>
> Also would this allow the effect to be applied to a dynamic object  
> with
> interactive content?
>
> On another note is there any indication of how long it will be before
> any of this functionality is merged into GW. I know you guys are busy
> working on GW beta but there's a world of people crying out for this
> stuff out here.
>
> Dan


_______________________________________________
Papervision3D mailing list
[hidden email]
http://osflash.org/mailman/listinfo/papervision3d_osflash.org

This email transmission is confidential and intended solely
for the person or organisation to whom it is addressed. If you
are not the intended recipient, you must not copy, distribute
or disseminate the information, or take any action in relation
to it and please delete this e-mail. Any views expressed in
this message are those of the individual sender, except where
the sender specifically states them to be the views of any
organisation or employer. If you have received this message
in error, do not open any attachment but please notify the
sender (above).  This message has been checked for all known
viruses powered by Messagelabs.  For further information
visit www.messagelabs.com/stats.asp  Please rely on your own
virus check as no responsibility is taken by the sender for
any damage rising out of any virus infection this communication
may contain.

LIDA Ltd 36 Golden Square, Soho, London, W1F 9EE, United Kingdom
Reg No. 03860916, registered in the United Kingdom.

_______________________________________________
Papervision3D mailing list
[hidden email]
http://osflash.org/mailman/listinfo/papervision3d_osflash.org
markosana

Re: DOF: Blur effects

Reply Threaded More More options
Print post
Permalink
In reply to this post by Richard-219
Thanks, but how to applicated to planes with assetmoviematerial? Somebody can help me please?

// material ex.1,2, 3,..
var material_mc1:MovieAssetMaterial = new MovieAssetMaterial("mc_1", true, true, true);
material_mc1.smooth = true;
material_mc1.interactive = true;
material_mc1.doubleSided = false;
plane1 = new Plane(material_mc1, 1300, 2000, 10, 10);
scene.addChild (plane1);
plane1.x= 1400;
plane1.y= 0;
plane1.z= 0;

//move plane ex.1,2..
function plane1Clicked (myEvent:InteractiveScene3DEvent):void{
Tweener.addTween(plane1, {x:-330, time:3, transition:"easeInOutQuint" });
Tweener.addTween(plane1, {y:150, time:3, transition:"easeInOutQuint"});
Tweener.addTween(plane1, {z:250, time:3, transition:"easeInOutQuint"});
Tweener.addTween(plane2, {x:700,  time:2, transition:"easeInOutQuint" });
Tweener.addTween(plane2, {y:400, time:2, transition:"easeInOutQuint"});
Tweener.addTween(plane2, {z:600, time:2, transition:"easeInOutQuint"}); }


//render
private function render (event:Event):void {

//move camera with mouse
camera.x += (((stage.mouseX-(stage.stageWidth * .5))*5)-camera.x )*.05;
camera.y += (((stage.mouseY-(stage.stageHeight*.5))*5)-camera.y )*.05;

camera.target = plane0;

//code for z blur or depth of field how to write?


//render
renderer.renderScene(scene, camera, viewport);
Lars Schwarz

Re: DOF: Blur effects

Reply Threaded More More options
Print post
Permalink
hi there,

afaik there are like 2 methods:

1) create N materials (one for earch object used in the scene) and add
a blurfilter to each
of them depending on the z position. inside your loop you change to
objects material according
the the objects current z position. this one obviously works only if
all objects use the same material...

2) add a blurfilter to each material inside your render loop setting
the blur quality according to
their z position

hth: lars

On Sun, Oct 18, 2009 at 5:54 PM, markosana <[hidden email]> wrote:

>
> Thanks, but how to applicated to planes with assetmoviematerial? Somebody can
> help me please?
>
> // material ex.1,2, 3,..
> var material_mc1:MovieAssetMaterial = new MovieAssetMaterial("mc_1", true,
> true, true);
> material_mc1.smooth = true;
> material_mc1.interactive = true;
> material_mc1.doubleSided = false;
> plane1 = new Plane(material_mc1, 1300, 2000, 10, 10);
> scene.addChild (plane1);
> plane1.x= 1400;
> plane1.y= 0;
> plane1.z= 0;
>
> //move plane ex.1,2..
> function plane1Clicked (myEvent:InteractiveScene3DEvent):void{
> Tweener.addTween(plane1, {x:-330, time:3, transition:"easeInOutQuint" });
> Tweener.addTween(plane1, {y:150, time:3, transition:"easeInOutQuint"});
> Tweener.addTween(plane1, {z:250, time:3, transition:"easeInOutQuint"});
> Tweener.addTween(plane2, {x:700,  time:2, transition:"easeInOutQuint" });
> Tweener.addTween(plane2, {y:400, time:2, transition:"easeInOutQuint"});
> Tweener.addTween(plane2, {z:600, time:2, transition:"easeInOutQuint"}); }
>
>
> //render
> private function render (event:Event):void {
>
> //move camera with mouse
> camera.x += (((stage.mouseX-(stage.stageWidth * .5))*5)-camera.x )*.05;
> camera.y += (((stage.mouseY-(stage.stageHeight*.5))*5)-camera.y )*.05;
>
> camera.target = plane0;
>
> //code for z blur or depth of field how to write?
>
>
> //render
> renderer.renderScene(scene, camera, viewport);
>
> --
> View this message in context: http://www.nabble.com/DOF%3A-Blur-effects-tp16826085p25862844.html
> Sent from the Papervision3D mailing list archive at Nabble.com.
>
>
> _______________________________________________
> Papervision3D mailing list
> [hidden email]
> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>

_______________________________________________
Papervision3D mailing list
[hidden email]
http://osflash.org/mailman/listinfo/papervision3d_osflash.org