Flint Particle System Forum - Starling Sat, 26 May 2012 06:09:50 +0100 http://flintparticles.org/forum/ Lussumo Vanilla 1.1.10 & Feed Publisher Starling http://flintparticles.org/forum/comments.php?DiscussionID=523&Focus=1735#Comment_1735 http://flintparticles.org/forum/comments.php?DiscussionID=523&Focus=1735#Comment_1735 Thu, 29 Sep 2011 13:01:18 +0100 grindheadgames
Over the last few days I have been looking into the Starling framework. It looks like it may be able to provide some extra power to Flint by leveraging the hardware acceleration made available to Flash by the Stage3D API. Are you considering implementing it into Flint? It would be interesting to see if it made a big improvement to the performance or not.

Thanks for a great project

Craig Beswetherick ]]>
Starling http://flintparticles.org/forum/comments.php?DiscussionID=523&Focus=1736#Comment_1736 http://flintparticles.org/forum/comments.php?DiscussionID=523&Focus=1736#Comment_1736 Fri, 30 Sep 2011 08:12:37 +0100 Richard
We are planning to integrate Flint with Starling at some point in the not too distant future. It's all a matter of finding the spare time to do it (if anyone on this forum wants to have a crack at it I'm happy to provide guidance to get you started). We will be looking at other 2D render engines that use Stage3D too. Don't know yet which we'll support - depends both on popularity and ease of implementation.

Richard ]]>
Starling http://flintparticles.org/forum/comments.php?DiscussionID=523&Focus=1758#Comment_1758 http://flintparticles.org/forum/comments.php?DiscussionID=523&Focus=1758#Comment_1758 Mon, 31 Oct 2011 18:13:34 +0000 lilive
First, thanks a lot for Flint. It's the first particles library I tried, and it suits me perfectly.

I will try to integrate Starling. If I can do something good enough, I will share it of course.
Any tip will be welcome.

And sorry for my english ;) ]]>
Starling http://flintparticles.org/forum/comments.php?DiscussionID=523&Focus=1767#Comment_1767 http://flintparticles.org/forum/comments.php?DiscussionID=523&Focus=1767#Comment_1767 Thu, 03 Nov 2011 18:14:00 +0000 lilive The emitter initializers are ShareTextures or SubTextures objects, which take an Array of IBitmapDrawable objects as constructor parameter.
In fact, with my old computer, the performance improvement isn't really awesome for 2000 small particles. But the framerate remains stable with 2000 quite big particles instead of small ones.




Still sorry for my english... ]]>
Starling http://flintparticles.org/forum/comments.php?DiscussionID=523&Focus=1772#Comment_1772 http://flintparticles.org/forum/comments.php?DiscussionID=523&Focus=1772#Comment_1772 Sat, 05 Nov 2011 11:12:23 +0000 Richard
Sorry I didn't get back to you sooner, but it sounds like you're on the right track, creating renderers and texture initializers for Starling. I have heard there are performance issues in Starling which are going to be addressed.

Is your code available to others? Thanks ]]>
Starling http://flintparticles.org/forum/comments.php?DiscussionID=523&Focus=1784#Comment_1784 http://flintparticles.org/forum/comments.php?DiscussionID=523&Focus=1784#Comment_1784 Wed, 09 Nov 2011 21:30:56 +0000 lilive
The source is here http://cepetitsite.net/flash/sources/flint-starling/flint-starling.zip
There's not so many classes, just a StarlingRenderer which use a SharedTextures or a SubTextures initializer.
I tried to add English comments...
If you want, tell me please about any mistake or better idea.

I'm currently working on a direct stage3D renderer, without Starling. I hope this will improve performances. ]]>
Starling http://flintparticles.org/forum/comments.php?DiscussionID=523&Focus=1786#Comment_1786 http://flintparticles.org/forum/comments.php?DiscussionID=523&Focus=1786#Comment_1786 Sun, 13 Nov 2011 10:05:22 +0000 turbidity Starling http://flintparticles.org/forum/comments.php?DiscussionID=523&Focus=1788#Comment_1788 http://flintparticles.org/forum/comments.php?DiscussionID=523&Focus=1788#Comment_1788 Wed, 16 Nov 2011 12:46:03 +0000 turbidity
Everything worked great. You rock!

Here are my notes:

org.flintparticles.starling.StarlingManager: ---

Should the StarlingManager class be moved outside the org.flintparticles package? Is there some reason we absolutely need to use StarlingManager class to add renderers to our starling displayObject list?

I really like your StarlingManager class (I wish it was part of starling by default), but it would be easier for other people to use if we can add a StarlingRenderer to any Starling displayObject without using the StarlingManager class to instantiate our starling object.


Performance is great under 350 particles on my computer, and this is adequate for my needs.

You can check out my primitive 2d Starling+Glaze physics engine at :

http://jaketastic.com/starling/

(starling.swf)
WASD=move SPACEBAR=shoot (Shoot to see particle effects in starling!)

Overall this is an awesome start to porting Flint Particles to starling! You are the best!

If you'd like me to anything to help support this port please let me know!! ]]>
Starling http://flintparticles.org/forum/comments.php?DiscussionID=523&Focus=1789#Comment_1789 http://flintparticles.org/forum/comments.php?DiscussionID=523&Focus=1789#Comment_1789 Fri, 18 Nov 2011 08:04:42 +0000 Richard
Haven't had time to look at your code yet, but I will. Thank you for posting it. For stage3d without Starling, take a look at Michael Ivanov's project at https://github.com/sasmaster/FLINTMolehill. ]]>
Starling http://flintparticles.org/forum/comments.php?DiscussionID=523&Focus=1795#Comment_1795 http://flintparticles.org/forum/comments.php?DiscussionID=523&Focus=1795#Comment_1795 Fri, 02 Dec 2011 23:10:45 +0000 lilive
Thank you for the feedback turpidity. I agree with you. After your answer, I started to change the code following your suggestions, but I had not enough time.
In fact, I had tried to add starling because I want Stage3D accelerated particles. I didn't know anything about Stage3D, so I tried with Starling. But now, I know that it isn't very hard to create stage3D "sprites". Add Starling to flint particles make sense for a starling application (like yours) which already use Starling. This isn't my case. But I will try to finish my last modifications and share it here.

Thank you for the link Richard, I missed it. I will compare his code with mine. I have worked to render a lot of quads with Stage3D, but I haven't integrate it to flint yet.
Out of curiosity, you can see what I did here:
load Main_mode0.swf
load Main.swf ]]>
Starling http://flintparticles.org/forum/comments.php?DiscussionID=523&Focus=1797#Comment_1797 http://flintparticles.org/forum/comments.php?DiscussionID=523&Focus=1797#Comment_1797 Tue, 06 Dec 2011 13:20:45 +0000 lilive
Turpidity, now you can either use the StarlingManager class to initialize Starling, or initialize it by your own. See the examples Main1.as and Main2.as
After testing, I see no performance differences using SharedTextures or SubTextures initializers. ]]>
Starling http://flintparticles.org/forum/comments.php?DiscussionID=523&Focus=1839#Comment_1839 http://flintparticles.org/forum/comments.php?DiscussionID=523&Focus=1839#Comment_1839 Thu, 22 Dec 2011 09:56:20 +0000 turbidity
>> New version: http://cepetitsite.net/flash/sources/flint-starling/flint-starling2.zip

This is probably fantastic. I will look over it later and post my notes here. Thanks again for your excellent work. ]]>
Starling http://flintparticles.org/forum/comments.php?DiscussionID=523&Focus=1883#Comment_1883 http://flintparticles.org/forum/comments.php?DiscussionID=523&Focus=1883#Comment_1883 Thu, 09 Feb 2012 20:11:17 +0000 mrpinc
Here are the changes - just to 3 functions

public function StarlingRenderer(useStarlingManager:Boolean = false, useRenderTexture:Boolean = true, w:int = 1024, h:int = 768)
{
_useRenderTexture = useRenderTexture;

if (_useRenderTexture)
{
_renderTexture = new RenderTexture(w, h, false);
addChild( new Image(_renderTexture) );
}

....rest of constructor
}

protected function addParticle( particle:Particle ):void
{
_particles.push( particle );
var p:Particle2D = particle as Particle2D;
var img:Image = p.image as Image;

img.color = p.color;
img.x = p.x;
img.y = p.y;
img.scaleX = img.scaleY = p.scale;
img.rotation = p.rotation;

if(!_useRenderTexture)addChildAt( img, 0 );
}


protected function renderParticles( particles:Array ):void
{
var particle:Particle2D;
var img:Image;
var len:int = particles.length;

if (_useRenderTexture == false)
{
for( var i:int = 0; i < len; ++i )
{
particle = Particle2D( particles[i] );
img = particle.image;
img.color = particle.color & 0xFFFFFF;
img.alpha = (particle.color >>> 24) / 255;
img.x = particle.x;
img.y = particle.y;
img.scaleX = img.scaleY = particle.scale;
img.rotation = particle.rotation;
}
return;
}

_renderTexture.drawBundled(function():void
{
for (var j:int=0; j>> 24) / 255;
img.x = particle.x;
img.y = particle.y;
img.scaleX = img.scaleY = particle.scale;
img.rotation = particle.rotation;
_renderTexture.draw(img);
}
});
} ]]>
Starling http://flintparticles.org/forum/comments.php?DiscussionID=523&Focus=1890#Comment_1890 http://flintparticles.org/forum/comments.php?DiscussionID=523&Focus=1890#Comment_1890 Wed, 22 Feb 2012 12:22:12 +0000 lilive
I don't know if this can improve performances, or if you made something wrong.

I don't use Starling anymore, because I wrote my own Stage3D renderer, which draw all the particles in a single Context3D.drawTriangles() call. I will share it someday, I just need some time. ]]>
Starling http://flintparticles.org/forum/comments.php?DiscussionID=523&Focus=1891#Comment_1891 http://flintparticles.org/forum/comments.php?DiscussionID=523&Focus=1891#Comment_1891 Wed, 29 Feb 2012 03:45:48 +0000 OM_A_HUM i can not go to this
could you reupload to another location?
thanks ]]>
Starling http://flintparticles.org/forum/comments.php?DiscussionID=523&Focus=1893#Comment_1893 http://flintparticles.org/forum/comments.php?DiscussionID=523&Focus=1893#Comment_1893 Thu, 08 Mar 2012 21:49:50 +0000 lilive File is available again: http://cepetitsite.net/flash/sources/flint-starling/flint-starling2.zip ]]> Starling http://flintparticles.org/forum/comments.php?DiscussionID=523&Focus=1919#Comment_1919 http://flintparticles.org/forum/comments.php?DiscussionID=523&Focus=1919#Comment_1919 Tue, 24 Apr 2012 09:43:06 +0100 turbidity
from: forum.starling-framework.org/topic/direct-blit-for-gpu :--

"In Starling 1.1, there's the class "QuadBatch", which allows you to add quads to a GPU VertexBuffer quickly. The class was already in Starling 1.0, but I recently changed it to be easier to use: it's now a display object... rendering this object is super efficient. It's just one single draw operation, no matter how big the object."

Does this have the potential to clear the way for a more efficient implementation of Flint Particles with Starling? ]]>