PerlinNoiseEffect for PV3D

 

写了个PerlinNoiseEffect类,但效率很差,对于较大的bitmapData运行起来会比较累。

 

Code:

scene.addChild(dae);
            
            var bfx:BitmapEffectLayer 
= new BitmapEffectLayer(viewport, viewportWidth, viewportHeight, true0, BitmapClearMode.CLEAR_PRE, falsefalse);
            viewport.containerSprite.addLayer(bfx);
            bfx.addDisplayObject3D(dae, 
true);
            bfx.blendMode 
= BlendMode.ADD;
            
            var perlinNoise_bmd:BitmapData 
= new BitmapData(bfx.width, bfx.height);
            
            bfx.addEffect(
new PerlinNoiseEffect(perlinNoise_bmd, new DisplacementMapFilter(perlinNoise_bmd, new Point(), 1123, DisplacementMapFilterMode.COLOR), 10151));
            bfx.addEffect(
new BitmapColorEffect(1, .9, .85, .95));

 

Download:PerlinNoiseEffect.as

Preview:http://niuniuzhu.cn/p/PerlinNoise/

posted @ 2008-08-31 16:04 牛牛猪 阅读(...) 评论(...) 编辑 收藏