Welcome, Guest
Want to take part in these discussions? Sign in if you have an account, or apply for one below
-
- CommentAuthorgrindheadgames
- CommentTimeSep 29th 2011
Hi there,
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 -
- CommentAuthorRichard
- CommentTimeSep 30th 2011
Hi Craig
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 -
- CommentAuthorlilive
- CommentTimeOct 31st 2011 edited
Hi,
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 ;) -
- CommentAuthorlilive
- CommentTimeNov 3rd 2011 edited
I have created a StarlingRenderer. It display starling.display.Image particles.
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... -
- CommentAuthorRichard
- CommentTimeNov 5th 2011 edited
Hi
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 -
- CommentAuthorlilive
- CommentTimeNov 9th 2011 edited
Hi Richard, thanks for your answer.
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. -
- CommentAuthorturbidity
- CommentTimeNov 13th 2011
Thanks so much for this lilive! I've been waiting for someone to to get started porting flintparticles to starling! I'll try this code out and post some feedback soon! -
- CommentAuthorturbidity
- CommentTimeNov 16th 2011
Ok, so I have done some work with http://cepetitsite.net/flash/sources/flint-starling/flint-starling.zip.
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!! -
- CommentAuthorRichard
- CommentTimeNov 18th 2011
Hi lilive
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. -
- CommentAuthorlilive
- CommentTimeDec 2nd 2011 edited
Hi,
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 -
- CommentAuthorlilive
- CommentTimeDec 6th 2011 edited
New version: http://cepetitsite.net/flash/sources/flint-starling/flint-starling2.zip
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. -
- CommentAuthorturbidity
- CommentTimeDec 22nd 2011
Lilive,
>> 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. -
- CommentAuthormrpinc
- CommentTimeFeb 9th 2012 edited
I made a slight change to the above posted example (StarlingRenderer.as) I allowed the option to use a RenderTexture instead of just adding the particles as Starling Display objects. I thought this might help performance but it actually hurt it a bit on my machine. Maybe I am doing something wrong.
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);
}
});
} -
- CommentAuthorlilive
- CommentTimeFeb 22nd 2012
Hi mrpinc,
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. -
- CommentAuthorOM_A_HUM
- CommentTimeFeb 29th 2012
http://cepetitsite.net/flash/sources/flint-starling/flint-starling2.zip
i can not go to this
could you reupload to another location?
thanks -
- CommentAuthorlilive
- CommentTimeMar 8th 2012
Oups, sorry, my mistake.
File is available again: http://cepetitsite.net/flash/sources/flint-starling/flint-starling2.zip -
- CommentAuthorturbidity
- CommentTimeApr 24th 2012
Daniel (the Starling developer) has added functionality to the QuadBatch!
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?
1 to 17 of 17
