User Tag List

Page 2 of 2 FirstFirst 1 2
Results 11 to 13 of 13

Thread: Very serious problem. Going from 60 to 15 fps!?

  1. #11
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export Module
    happygreenfrog's Avatar
    Join Date
    May 2011
    Location
    I.L.T.D.O.I.R (I.L.T.D.O.I.R's Location: The Dimension Of Infinite Recursion)
    Posts
    4,307
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by MEHRDAD View Post
    New flash players is optimized with Starge 3D (As mention by Scott).It means that works perfect on GPU base.And you can get high output fps with it..Starling works with this feature:
    http://gamua.com/starling/
    and see this game for Starling performance:
    http://www.whacksite.com/

    Unfortunately Fusion Swf exporter can't support Stage 3D yet.Maybe at future although i think its very hard for CT.because it needs to write as first again.
    Actually, despite what you think, it would be very hard to make it use Stage 3D. It would require a complete and utter re-write of the Flash runtime. And then every graphical extension ever made for the Flash runtime would break, meaning they would have to be re-wrote, too, if it would even be possible to convert them at all (in some cases it might not be). It would be very, very hard for Clickteam to make it use Stage 3D, since, from what I've seen, it is very very very very very very (insert 99999999999999999999999999999999999999999999999999 9999999 more "very"s) hard to use.

    After all, if it was easy to use, would this be the code needed to render 1 triangle that looks like this?:

    Code:
    package{
    import com.adobe.utils.AGALMiniAssembler;
    import flash.display.Sprite;
    import flash.display3D.Context3D;
    import flash.display3D.Context3DProgramType;
    import flash.display3D.Context3DVertexBufferFormat;
    import flash.display3D.IndexBuffer3D;
    import flash.display3D.Program3D;
    import flash.display3D.VertexBuffer3D;
    import flash.events.Event;
    import flash.geom.Matrix3D;
    import flash.geom.Rectangle;
    import flash.geom.Vector3D;
    import flash.utils.getTimer;
    [SWF(width="800", height="600", frameRate="60", backgroundColor="#FFFFFF")]
    public class HelloTriangleColored extends Sprite
    {
    protected var context3D:Context3D;
    protected var program:Program3D;
    protected var vertexbuffer:VertexBuffer3D;
    protected var indexbuffer:IndexBuffer3D;
    public function HelloTriangleColored()
    {
    stage.stage3Ds[0].addEventListener( Event.CONTEXT3D_CREATE, initMolehill );
    stage.stage3Ds[0].requestContext3D();
    addEventListener(Event.ENTER_FRAME, onRender);
    }
    protected function initMolehill(e:Event):void
    {
    context3D = stage.stage3Ds[0].context3D;
    context3D.configureBackBuffer(800, 600, 1, true);
    var vertices:Vector.<Number> = Vector.<Number>([
    -0.3,-0.3,0, 1, 0, 0, // x, y, z, r, g, b
    -0.3, 0.3, 0, 0, 1, 0,
    0.3, 0.3, 0, 0, 0, 1]);
    // Create VertexBuffer3D. 3 vertices, of 6 Numbers each
    vertexbuffer = context3D.createVertexBuffer(3, 6);
    // Upload VertexBuffer3D to GPU. Offset 0, 3 vertices
    vertexbuffer.uploadFromVector(vertices, 0, 3);
    var indices:Vector.<uint> = Vector.<uint>([0, 1, 2]);
    // Create IndexBuffer3D. Total of 3 indices. 1 triangle of 3 vertices
    indexbuffer = context3D.createIndexBuffer(3);
    // Upload IndexBuffer3D to GPU. Offset 0, count 3
    indexbuffer.uploadFromVector (indices, 0, 3);
    var vertexShaderAssembler : AGALMiniAssembler = new AGALMiniAssembler();
    vertexShaderAssembler.assemble( Context3DProgramType.VERTEX,
    "m44 op, va0, vc0\n" + // pos to clipspace
    "mov v0, va1" // copy color
    );
    var fragmentShaderAssembler : AGALMiniAssembler= new AGALMiniAssembler();
    fragmentShaderAssembler.assemble( Context3DProgramType.FRAGMENT,
    "mov oc, v0"
    );
    program = context3D.createProgram();
    program.upload( vertexShaderAssembler.agalcode, fragmentShaderAssembler.agalcode);
    }
    protected function onRender(e:Event):void
    {
    if ( !context3D )
    return;
    context3D.clear ( 1, 1, 1, 1 );
    // vertex position to attribute register 0
    context3D.setVertexBufferAt (0, vertexbuffer, 0, Context3DVertexBufferFormat.FLOAT_3);
    // color to attribute register 1
    context3D.setVertexBufferAt(1, vertexbuffer, 3, Context3DVertexBufferFormat.FLOAT_3);
    // assign shader program
    context3D.setProgram(program);
    var m:Matrix3D = new Matrix3D();
    m.appendRotation(getTimer()/40, Vector3D.Z_AXIS);
    context3D.setProgramConstantsFromMatrix(Context3DProgramType.VERTEX, 0, m, true);
    context3D.drawTriangles(indexbuffer);
    context3D.present();
    }
    }
    }
    Maybe if they use Starling, sure. But I'm saying that Stage 3D isn't easy to use, not that no effort has been put into making it easier. There is also the fact that some older computers might not support your game if you use Stage 3D, but that might not be that big of an issue. Perhaps the biggest issue is the fact that most of the Flash runtime would need to be re-wrote for that to happen, and I'm not sure that is happening any time soon, especially since Clickteam is focusing on the HTML5 runtime at the moment, since it is newer and in some ways buggier (in others it is more stable (mainly the fact that it has better performance), but that is aside of the point).

  2. #12
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export Module
    Outcast's Avatar
    Join Date
    Jan 2011
    Location
    Sweden
    Posts
    3,237
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Is it really an issue of stage3d or not? I did not think many developers who just program in as3 was actually using stage3d?

  3. #13
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export Module
    happygreenfrog's Avatar
    Join Date
    May 2011
    Location
    I.L.T.D.O.I.R (I.L.T.D.O.I.R's Location: The Dimension Of Infinite Recursion)
    Posts
    4,307
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Stage3D does make thing faster, since it uses the GPU. It's basically like the HWA display mode in MMF2, just for Flash. Plenty of developers use it, but that doesn't mean it is needed to make your game run fast. However, from the sounds of things, the MMF2 Flash runtime was coded in a way that makes things run slower than if it was coded to draw things in a different way, and that wouldn't even require changing to Stage 3D to fix (from the sounds of things, Clickteam used something called display lists, and, if I remember correctly, Jacob told me on ClickConverse that display lists aren't a very good way of drawing stuff in Flash at all).

Page 2 of 2 FirstFirst 1 2

Similar Threads

  1. Pulling Problem and Shooting Problem
    By Duggabboo in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 21st March 2010, 05:24 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •