Papervision3D: GreatWhite swallows Effects - Creating a BitmapEffectLayer

Yesterday I updated my Papervision3D SVN package and to my shock and dismay the Effects branch disappeared. I was so shocked that I went to bed and refused to take a look at the implications of the merge until this morning. No doubt a lot of improvement has gone into the new build but the loss of the Pixel and Pixel3d classes have hurt me a great deal. With out a shadow of a doubt they have been my favourite of all the Papervision classes and in truth on account of those classes I really wish the branches were never merged or totally merged. I personally have never used the Great White branch and there was so much stuff in the Effects branch that so much will be missed except there is a total integration. I'm still hoping that this will be the case.

Having said that and gotten over my initial shock there is a lot to be said for GreatWhite +. Most of the basic Papervision procedures remain the same but, the first change of note I discovered was with effect rendering. The BitmapEffectsLayer is now a subclass of the ViewportLayer which in turn replaces the RenderLayer.

Previous:
//CREATE THE BITMAP EFFECT LAYER PREVIOUSLY (FX BRANCH)
_bfx = new BitmapEffectLayer(800, 600, true, 0, BitmapClearMode.CLEAR_POST, true, false);
_bfx.addEffect(new BitmapLayerEffect(new BlurFilter(2, 2, 2), false));

_vport.addRenderLayer(_bfx);

Now:
//CREATE THE BITMAP EFFECT LAYER NOW
_bfxl = new BitmapEffectLayer(_vp, 500, 500);
_bfxl.addDisplayObject3D(_scene.getChildByName('part'));
_bfxl.addEffect(new BitmapLayerEffect(new BlurFilter(2, 2, 8)));

_vp.containerSprite.addLayer(_bfxl);

This gives a certain amount of granularity to the use of your various effect as you can add and remove from the BitmapEvectLayer display stack at will.

2 comments:

Oliver said...

Hi,Thanks for pointing that.
You really helped me a lot.

aYo ii said...

:)

My Instagram