Showing posts with label Flash Player 10. Show all posts
Showing posts with label Flash Player 10. Show all posts

Monday, February 15, 2010

[Away3DLite] More particles!

I think you're dead?

Long time no blog post woohoo! this year gonna be fun because I plan to workless play more, I need my life back! It's time for having fun ;D

Particle again?

Yeah! 2x faster one with some clipping cheating, 3x faster for no scale via copyPixels ;)
here's animated bitmap particles, while toggle render to copy pixels mode
we even have some fps to add filters and blend mode there ;D 

away3dlite particles

It's clipping around 1,000 particles, so around 2,000 left for render time, all shared same bitmapdata

OK, It's faster than before, what else?

- Shared bitmapData
- Support render to view/layer/bitmap (warning, bitmap approach need some change later)
- Clip by RectClipping
- Animate frame by frame by move their material rect
- Mouse hitTest each particle can be check by particle.isHit

Prove it!

well, here's for more fancy use, magic happen when you draw model 3D to shared bitmapData

1x version via Sprite3D (2009 demo, 1,000 Sprite3D @ 10/30fps)
http://away3d.googlecode.com/svn/branches/lite/bin/Advanced_Mario1000.swf
image

2x version via Particles (2,000 Particles @ 12/30 drawRect, and @ 24/30fps via copyPixels)
http://away3d.googlecode.com/svn/branches/lite/bin/Advanced_Mario2000.swf
image 
Try click to switch draw method from drawRect  -> copyPixels

Source?

as you wish!, you've been warn, it's dev stuff, which mean daily change will be apply ;p
http://away3d.googlecode.com/svn/branches/lite

Any thing else?

- Well, like it or not 3D with HW support via Flash not happen so soon…so i think caching/pooling bitmapdata like old style sprite 2D game with fixed camera angle is best choice for me this year, even Adobe release HW support tomorrow, we still have to wait next year for real production…

- Sadly but true, PSP didn't have multi touch, DS didn't have high quality graphic, iPad/iPhone didn't support Flash, WinMo 7 didn't support Flash, Flash didn't have HW support, Chrome didn't have RSS icon for feeding web, WebGL need geeky browser hidden somewhere and need super tricky to enable it, I think all this just #FAIL and still happen 'til today, many of them is nonsense ;p

- And here's #WIN list…LG LCD TV/Monitor cheaper than Samsung at better spec, Sony VAIO is cheaper Than DELL at better spec. SkyFire support Flash 10 on mobile for a year but not many peep notice! OpenPlug release AS3 -> mobile solution before Adobe Slider, Unity3D bring 3D technology 10 year far away from Flash 3D

- I won't say someone lazy in case I did ;p , Away3DLite is lack many features too, good luck it's open source, and we are open mind group, we always listen to any developer who want to push Flash to limit, when we squeeze all frame rate out and it still useless, so we can totally blame Adobe at that point…

- Many thanks to all submitted patch/improvement to us last year, you just help me save plenty of time, please don't stop doing that!

Next?

- May be Pixel particles? someone need it? it should be faster 5x for pixel, I think.

- Bad news UVT is slow, if you found that lite is slower in some case, try activate MIPMAP by use 2^n texture should help some, I'm try to figure out this by separate renderer, and render it without calculate "T" internal (and we can blame Adobe here ;p), and look like it not happen so soon

- Model Viewer, It's time to real production, let's start with model viewer :)

del.icio.us Tags:

Saturday, December 5, 2009

[AIR] Hello NativeProcess with C#

you can read bla bla bla somewhere else not here sry, actually i did this for a while but hardly find time to blog this, btw if you follow my twitter, you will find that i yelling my result for this just the day after AIR2 release, so…twitter still rules for daily update, and more slow+detail via blog ;)

here’s fire starter c++
http://www.adobe.com/devnet/air/flash/quickstart/interacting_with_native_process_02.html

and then java
http://corlan.org/2009/11/30/magnifying-glass-air-2-application-or-how-to-communicate-with-a-java-program-from-air/

and..what is this lang btw? ;)
http://mchristoff.com/2009/12/using-the-air-2-0-nativeprocess-api-to-control-mplayer/

nvm, let’s try with C# (it’s my 1st time on C# , so plz don’t hit me ;p)

using System;
using System.IO;

namespace HelloNativeProcess
{
class Program
{
static void Main(string[] args)
{

using (Stream stdin = Console.OpenStandardInput())
using (Stream stdout = Console.OpenStandardOutput())
{
byte[] buffer = new byte[2048];
int bytes;
while ((bytes = stdin.Read(buffer, 0, buffer.Length)) > 0)
{
stdout.Write(buffer, 0, bytes);
}
}
}
}
}

it’s just work!, so….that’s it! :) btw look like adobe example always call new NativeProcess(); and call process.closeInput(); after thing done, i found that i can keep that hole open by just not close it (so no need to new NativeProcess again) and try rapid call…yeah right why don’t someone try streaming OpenGL screen capture result as ByteArray through this hole and draw them to Flash Bitmap? next question is…what for? LOL

well…just for fun then, from my test i got 2048 bytes rapid call by 30fps enterFrame….i got swing result around 30-50ms for read and write back, is this fast enough?, not sure either, suppose to be a bit faster without debug mode, i try blog this in case someone reading and itchy to try that out!
for me…i got no more free time for that, gotta back to work now ;p


del.icio.us Tags: ,,

Monday, October 5, 2009

[Away3DLite] Let's mess with Particles


What?

  • when ppl busy with BSP thing i keep mess up with 2D particles...sound boring huh? it's still fun for me lol ;)
  • it's sort with mesh screenZ, (and yes you can request to make it sort with face but it will be slower obviously, so...i decide to do it really later)
  • draw with old style render method beginBitmapFill+drawRect
  • animated by adding bitmapData sequence, and turn animated on (off by default)
  • auto buffer scale just like DOF (without blurring), slower for small piece but a lot faster for huge bitmap (more than ~24px), but consume more RAM depend on quality option set
  • layer support! weirdo but it's there!, i can imagine that someone use this particle as Tree decor, and that will be nightmare if no layer support! more good news is it's just Sprite that you can add filters or blendmode to it! cool ehh? ;)

Why?

  • render as Object3D is seem to be slower because you need to apply matrix transform twice + invert also more traverse time through child node, pros is you can get native interactive
  • render by drawGraphicsData, so it's just like plane = 2 triangles right? you can test speed for 200-300 plane before thing go slow down, so i count that not a good choice
  • render with copyPixels, yeah i know that best choice, but i need buffer scale and some Bitmap for that, and i need to z-sort that Bitmap with other Mesh! so...not now,... suppose to be have own canvas 1st i think

Result?

  • best score for drawRect is around 10px particles with around 2,000-2,500 at 30/30fps steady... i call this "it's just work" version ;p so you can use it it but don't expect for speed wise just yet ;)

away3dlite particles
http://www.sleepydesign.com/labs/as3/Away3DLite/ExParticles.html

Source?

Next?

  • next try would be drawPath , i'll explain this one later (if it work well ;p) let's compare speed again when it done :)
  • btw, in case no GPU for PC via Flash10.1, let's pray drawPath will be faster ;p
  • any comment for improvement is welcome!
del.icio.us Tags: ,

Monday, August 24, 2009

[Flash 10] Round 1: Away3D vs. Away3DLite

What?

- just speed test, want to see speed improve aren't you? ;)
- expect more explanation about Away3DLite at official Away3D site later

Diff?

- name, coding, size (~13kb)
- render pipeline (3D native)
- overall ~4x speed increase
- maximum rendered faces increase from 3,000 to ~14,000 for quad core and steady at 30/30fps

Result?

- Away3D 119kb, 23-26fps via quad core
http://sleepydesign.com/labs/as3/Away3D/ExSphere.html
image

- Away3DLite 13 kb, 30/30fps via quad core
http://sleepydesign.com/labs/as3/Away3DLite/ExSphere.html
image 

Source?

- yes it's finally public in Away3DLite name like i said before , thx Rob for cleaning up ;)
- libs : http://away3d.googlecode.com/svn/trunk/fp10/Away3DLite/src
- examples : http://away3d.googlecode.com/svn/trunk/fp10/Examples/Away3DLite/as/src

Next?

- round 2? i expect you to do that ;p and do tell me if you get faster result from other engine ;)
- more examples? yes sure things, you can expected more soon
- more features? why not?

Tuesday, June 30, 2009

[Flash10] As promised, MD2 with Animation via native Flash10 3D (~10KB)

no it's not perfect yet, old style face reference is slow thing down again around 2x...got to make it "flat" Array 1st to gain fps back...must be 12,000 faces (in my theory) after optimized

MD2 with Animation via native Flash10 3D

and what so different to 18KB version? it's 10KB! lol and this time i did use Utils3D.projectVectors instead to gain more speed like i said before, and you may already known that all this labs result 'll be add to away3d engine soon, which mean you can expect clean+optimize code there, or let me know here if you really want to use this in your next week project ;p


del.icio.us Tags:

Wednesday, May 20, 2009

[Flash10] Want to know maximum triangles via Pure Flash 10 3D can render?

it's been a while after my latest test via Flash10 about 3D thingy, after mess up with native 3D function, the result is...here ;)

What i just found out?

got fps speed up by Vector, it's not new, just mention ;)

  • Vector is access fast, forget about Array and Object
  • Vector with typed is faster, for example :  Vector.<int>
  • Vector with typed + fixed length is fastest, for example : Vector.<int>(10, true)

Required?

and let's mix thing together!

Result?

- faster? slower? huh? let's hello world 1st with 2 earth
http://sleepydesign.com/labs/as3/Open3D/ExSphere.html

image

- ASE after optimize z-sort ,rip some loop, changed to Vector, but still use array sortOn (faster) http://sleepydesign.com/labs/as3/Open3D/ExASE.html

image


- final one is depend on your machine, just click it and feel free to leave your result as comment
http://sleepydesign.com/labs/as3/Open3D/ExSphereSpeedTest.html 

image

as you can see, without both z-sort (move mouse to left) for meshes and faces, we can pump up to 26,600 faces 30/30fps with medium quality via Intel Quad Core, (and drop to 29fps sometime while i hold key to take screenshot ;p) and ~12fps when z-sort is on, culling is on which mean around ~13,300 is real render faces number? maybe i count wrong number? can someone confirm by click and hold your mouse to see wireframe and manually count 'em by hand? kidding ;o

FYI

  • in last demo i try simulate real life job by add mouse event, always rotate all XYZ, bla bla
  • ~7kb engine size for now and can be smaller...lol
  • no "Face class" yet, surprise? i get rid of it cause it's cost ~1fps after promote function to class!, which mean class look up is slow thing down, must figure out better way to seal it ;\
  • last try with ND3D i test only drawTriangles, and look like a good idea to loop and draw 'em as Face one by one, you can get faster result by collect and draw it "just one time" in mesh loop
  • this time i did use Utils3D.projectVectors(projection, vout, triangles.vertices, triangles.uvtData);
  • nothing to do with "Open3D" name, it's just...random idea name ;)

Source?

  • sure, coming soon just need some clean it up a bit ;)
  • maybe finish this ~9kb MD2 demo before release the source svn somewhere

Next?

  • better back on collada thing, i got something about animation clip to share, both good and bad news come along ;)
Technorati Tags:

Tuesday, April 21, 2009

[Flash10] Massive amounts of 3D lines without Alchemy and PixelBender?

Want to know what happen if we add line draw to Joa Ebert 300,000 particles? kidding! lol ;p but i still want to try how much lines F10 can handle heehee bad habit ;), let's do it!...

Result?

 Flash10 lines

FYI

  • try increase more MAX_PARTICLES as you wish
  • try remove line alpha/line style for some speed gain
  • try drawPath if you want to compare ;)
  • it's about 3000 lines with 27fps on my 2.4ghz single core
  • and 5000 with 28fps with 2.13ghz quad core

Source?

Next?

  • do you want to know how much fps on pure 3D Flash10 vertices with texture? my last try is 30/30fps at ~3,000 vertices at 2.4ghz single core @medium quality and drop eventually after add more vertices ;o , 'll blog about that soon ;)
Technorati Tags: ,,

Friday, December 12, 2008

[Alchemy] 22 Nightmare Steps for me to Getting Started

my last try with C++ was back to around year 1994 with Turbo C or Borland C (as i remember), let's try again in 2008 lol, i’m on window xp btw… let’s go!

http://labs.adobe.com/wiki/index.php/Alchemy:Documentation:Getting_Started

Requirements
Steps

Step 1 Download and install Cygwin. Make sure to install the following packages:

  • Perl

    image 
  • zip

    image 
  • gcc / g++ //it's in Devel folder (took me an hour to find)

    image

Step 2 Download and install Java.
// as i said just get them both

  • Java SE Runtime Environment (JRE) 6 Update 11
  • Java SE Development Kit (JDK) 6 Update 11

Step 3 Make sure to restart the Cygwin terminal after installing Java.
// huh? i didn't start anything yet shall i restart?

Step 4
Download and install the Flex SDK, and add the $FLEX_HOME/bin directory to your Cygwin environment's path (within ~/.bashrc) (See below for an example).
// (within ~/.bashrc)??? i got 2 of bashrc file which one?

  • C:\cygwin\etc\skel\.bashrc <-- this one? let's see inside

    # To pick up the latest recommended .bashrc content,
    # look in /etc/defaults/etc/skel/.bashrc
    // hmmm? this mean if i need last know good one i've to take from defaults folder right?

    # The copy in your home directory (~/.bashrc) is yours, please
    # feel free to customise it to create a shell

    // hmmmmmmm home directory? where is it? is that "C:\cygwin\" or "C:\" ? or should i create new folder like this "C:\~" or this "C:\home" ???

  • C:\cygwin\etc\defaults\etc\skel\.bashrc <-- or this one?
    # Modifying /etc/skel/.bashrc directly will prevent
    # setup from updating it.

    // hmmmmmmmmmm so i do not need to mod it right?

//look like i fail already in step 4 let's skip(1st) this and look back later

Step 5 Download the Alchemy Package for your system from the pre-release site. For this example, we will assume that Windows is being used.
// easy one : http://labs.adobe.com/downloads/alchemy.html

Step 6 Unzip the package and copy the alchemy folder to you system. We will refer to this path as $ALCHEMY_HOME
// you system? your system? it's that "C:\WINDOWS"?, or  "C:\WINDOWS\system" ??, or "C:\WINDOWS\system32" ???, i got plenty of system here which one???, ….skip again(2nd)

Step 7 Open a Cygwin terminal and change to the $ALCHEMY_HOME/ directory.
// Cygwin terminal? should be here : C:\cygwin\Cygwin.bat

@echo off

C:
chdir C:\cygwin\bin

bash --login –i


image 

// huh? after launch i can see C:\~ in title which mean system folder is "C:\” ????
and then “change to the $ALCHEMY_HOME/ directory” ….how?… let’s type “help” there

image

hmm… how about “dir”
image 
okie, another clue here i’m in “C:\Documents and Settings\todsaporn.banjerdkit” folder
let’s copy “alchemy-cygwin-v0.4a” to C:\cygwin\alchemy cause i assume that “C:\cygwin\” is root folder
and then…

Step 8
Run the $ALCHEMY_HOME/config script

./config

image


ok, i got Flex 3.2 here C:\Program Files\Adobe\Flex Builder 3\sdks\3.2.0\bin, then “and add /path/to/FlexSDK/bin to your path.” …your path? which path? maybe %PATH% in
“Environment Variables”  here http://support.microsoft.com/default.aspx?scid=kb;en-us;310519


let’s add them both user and system!

image 

and then exit and restart last step again

image


great! warning is gone! , let’s try next step

Step 9 Open alchemy_setup for editing and add the path to the ADL executable (included in the Flex SDK):

export ADL=/cygdrive/c/flex/bin/adl.exe

Make sure to uncomment this line, and that it contains the path to ADL.exe on your system.

@C:\cygwin\alchemy\alchemy-setup
#line 22




export ADL=C:\Program Files\Adobe\Flex Builder 3\sdks\3.2.0\bin\adl.exe


if you follow me to this step you ‘ll end up with plenty of error here LOL, sorry :P
almost 3 days gone to setup! who ever write this instruction suppose to be in 600 adobe cut-out list :P, before this story go to far i’ll cut it to the end


Hint



  1. “C:\Program Files\Adobe\Flex Builder 3\sdks\3.2.0” never work cause folder name it’s too fancy, you must change (copy) flex folder to something like “C:\flex” and folder structure will look like this




    C:\flex
    C:\cygwin\alchemy
    and below this actually no need but…it’s refuse to compile if i remove it, don’t ask me why :P
    C:\alchemy


  2. “.bashrc” never call for me, i already put “.bashrc” file to every folder in c:\ drive, but they never call, for me i use “C:\cygwin\etc\profile” file to add start up command like this




    echo "profile..."
    export FLEX_HOME=/cygdrive/c/flex


    export ALCHEMY_HOME=/alchemy/
    source /alchemy/alchemy-setup


    PATH=$ALCHEMY_HOME/achacks:/cygdrive/c/flex/bin:$PATH
    export PATH


  3. you can access “C:\” by use “/cygdrive/c/” for sample “C:\alchemy” mean “/cygdrive/c/alchemy/”
  4. Step 9 will look like this --> export ADL=/cygdrive/c/flex/bin/adl.exe

Result


as you can see below, i still got error msg there but thing get compiled and running! weird ever!

image


so, if you completely noobs like me and not feeling so lucky, i think you can skip this and try again really later, for me i’m done with this ;/


Next?


i think i didn’t need c++ for real life by now, so let’s get back to 3D thing ;P





Technorati Tags:

Tuesday, September 16, 2008

Flash Player 10 : drawTriangles is faster?

What?

Flash Player 10 is out there for a while, and i really want to know is that faster for 3d with core function? let's try it, shall we? let's googling and let's see what i got there

How?

  1. start reading here : http://www.senocular.com/flash/tutorials/flash10drawingapi/
  2. or here : http://www.boostworthy.com/blog/?p=242
  3. more basic sample here : http://flashandmath.com/advanced/p10triangles/index.html
  4. advance sample here : http://pixelero.wordpress.com/2008/08/31/flash-10-part-4-of-testing-drawtriangles-old-school-tunnels/

Required?

  1. Flex and Flash Player 10 crazy setup
  2. some old computer...why? you 'll got same 24/24fps both of them in fast computer ;P

And then?

i'm lazy enough to rewrite all that, i think that should be better if we can compare speed with old as3 3d engine and new core drawTriangles function right? so i pick ND3D engine in this case cause it's nice and simple enough for integrate to Flash Player 10 (only need 1 night to integrate), ...tadaaa

Flash10 nulldesign AdditiveCubes 

Link?

  1. F9 : http://sleepydesign.com/labs/as3/ND3D/AdditiveCubes.html
  2. F10 : http://sleepydesign.com/labs/as3/ND3D/AdditiveCubes_F10.html

Result?

far as i test with my old computer i got Flash Player 10 with drawTriangles is slower than old style lineTo/moveTo for 2-3 fps, and plz don't trust/argue me yet, better follow link here :  http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=72&catid=675&threadid=1387302&enterthread=y

So?

don't ask me! ask adobe! lol ;)