I just tested it out here, and my CPU went up to 80%, but are you using a giant transparent graphic? Heavy use of transparency like that (and requiring a render 30+ times a second) could definitely work the CPU.

I remember having to carefully manage how much of the screen I was rendering with transparency, in order to provide acceptable frame rates. The result seems to ask for 40% of my CPU, but using the CPU isn't altogether bad. If you're rendering on enter frame, it will render more or less often depending on the machine. Flash isn't using the GPU for this stuff, so it's (kind of) to be expected.

http://alissapittenger.com/



On Fri, 16 Jul 2010 09:30:39 -0700, Darcey Lloyd <[email protected]> wrote:

Hits 97% here on chrome win xp. However my work machine was made by cave
men.

I've been experiencing similar problems lately but this is due to flash
player 10.1, until adobe fix it I have put all my work back to being
published for FP9. It's not much of a conversion process.

However if this is not what is causing the problem, try removing /
commenting out piece by piece elements of your application till you find the
cpu killer.

D





On 16 July 2010 17:16, Ali <[email protected]> wrote:

Hi Gurus,

I am trying to create my site in away3Dlite but I am facing a big
problem that is when I run my website's first page it took about 80%
of CPU usage.

CUP usage
http://www.riyasatali.com/site/cupusage.jpg

Live link
http://www.riyasatali.com/site/site.html

Here is my Code

/***********************************************************/

package
{
       import away3dlite.cameras.HoverCamera3D;
       import away3dlite.containers.Scene3D;
       import away3dlite.containers.View3D;
       import away3dlite.materials.BitmapFileMaterial;
       import away3dlite.materials.ColorMaterial;
       import away3dlite.materials.MovieMaterial;
       import away3dlite.primitives.Plane;
       import away3dlite.primitives.Sphere;

       import flash.display.*;
       import flash.display.BlendMode;
       import flash.events.Event;
       import flash.text.TextField;

       import flashx.textLayout.conversion.PlainTextExporter;

       [SWF(backgroundColor="#000000",frameRate=30)]
       public class site extends Sprite
       {
               private var bgMaterial:BitmapFileMaterial;
               private var View:View3D;
               private var bgPlan:Plane;
               private var tmpPlane:Plane;
               private var scene:Scene3D;
               private var splashes:Array;
               private var mainCam:HoverCamera3D;

               private var tmpSprite:Sprite;
               private var txtField:TextField;

               public function site()
               {
                       // create a viewport
                       init();

                       addEvents();

                       addMaterials();
                       resize();
                       addObject();



               }
               private function init():void{
                       scene=new Scene3D();
                       mainCam=new HoverCamera3D();
                       View = new View3D(scene,mainCam);
                       splashes=new Array();
                       txtField=new TextField();
                       tmpSprite=new Sprite()
                       var t_splashName:String="";

                       tmpSprite.addChild(txtField);

                       for (var i:Number=1;i<=5;i++){
                               t_splashName="assets/splash"+i+".png";

                               tmpPlane=new Plane(new
BitmapFileMaterial(t_splashName));
                               //tmpPlane.layer.blendMode=BlendMode.ADD;
                               splashes.push(tmpPlane);

                               //scene.addChild(splashes[i-1]);
                               //txtField.text+=" \n"+t_splashName;
                               splashes[i-1].rotationX=90;
                               splashes[i-1].mouseEnabled=false;
                       }
                       splashes.push(new Plane(new
BitmapFileMaterial("assets/
splash6.png")));
                       splashes[5].rotationX=90;
                       //splashes[5].layer=new Sprite();
                       //splashes[5].layer.blendMode=BlendMode.ADD;
                       splashes.push(new Plane(new
BitmapFileMaterial("assets/
enter1.png")));
                       splashes[6].rotationX=90;


                       splashes[5].width=stage.fullScreenWidth;
                       splashes[5].height=stage.fullScreenHeight-100;
                       splashes[5].z=-50;

                       splashes[5].material.smooth=true;

 //splashes[5].x=((stage.fullScreenWidth/2)-splashes[5].width/2);
                       //splashes[5].y=((stage.fullScreenHeight/2)-
(splashes[5].height*2));
                       splashes[5].mouseEnabled=false;
                       splashes[6].mouseEnabled=false;
                       splashes[6].width=stage.fullScreenWidth;
                       splashes[6].height=stage.fullScreenHeight-100;
                       splashes[6].z=-80;

                       splashes[6].material.smooth=true;

                       scene.addChild(splashes[5]);
                       scene.addChild(splashes[6]);
                       /*var tPl:Plane=new Plane(new
MovieMaterial(tmpSprite));
                       tPl.width=100;
                       tPl.height=100;
                       tPl.x=-200;
                       tPl.z=-200;
                       tPl.rotationX=90;
                       scene.addChild(tPl);*/

                       mainCam.distance=850;
                       mainCam.hover();
                       //View.camera=mainCam;
                       addChild(View);

               }
               private function addMaterials():void{
bgMaterial=new BitmapFileMaterial("assets/bg.jpg");
                       bgMaterial.smooth=true;
               }

               private function addObject():void{

                       bgPlan = new Plane(bgMaterial);

                       bgPlan.width=stage.fullScreenWidth;
                       bgPlan.height=stage.fullScreenHeight-120;

                       bgPlan.rotationX=90;
                       bgPlan.mouseEnabled=false;
                       scene.addChild(bgPlan);
               }

               private function addEvents():void{

                       addEventListener(Event.ENTER_FRAME,rndr);
                       addEventListener(Event.RESIZE,onResize);
               }

               private function resize():void{
                       stage.align=StageAlign.TOP_LEFT;
                       stage.scaleMode=StageScaleMode.NO_SCALE;
                       //View.camera.z=-600;

                       View.x=stage.fullScreenWidth/2;
                       View.y=(stage.fullScreenHeight-100)/2;

               }
               private function onResize(e:Event):void{
                       resize();
               }
               private function rndr(e:Event):void{
var xDist:Number = mouseX - stage.fullScreenWidth *
0.5;
var yDist:Number = mouseY - stage.fullScreenHeight *
0.5;

                       mainCam.tiltAngle=yDist/150;
                       mainCam.panAngle=xDist/150;

                       mainCam.hover();

                       View.render();
               }
       }
}

/**********************************************************/

Please help thanks.

Riyasat


--
Joshua Granick
Owner / Lead Developer
[ eclecticdesignstudio ]
P: (916) 889-7306

Reply via email to