libgdx / libgdx

Desktop/Android/HTML5/iOS Java game development framework
http://www.libgdx.com/
Apache License 2.0
23.02k stars 6.42k forks source link

Talos Particle Editor + Runtime (Insipred by Unreal Niagara) #5797

Closed azakhary closed 3 years ago

azakhary commented 4 years ago

LibGDX Particle system and its editor are pretty ancient. We love it, we hate it, we use it anyway. I was really inspired by Unreal Niagara particle system which is a node-based editor to do some crazy stuff. And I thought it will be really cool for libGDX to have something exactly like that.

So here you go: https://youtu.be/j8L8B68a9qw

Github: https://github.com/rockbite/talos

It's all written in libGDX, should be fast. I am opening this issue so you guys can discuss if it's worth maybe replacing the old editor with this one at some point? Or just putting this one somewhere for download. Also here to answer any questions.

Finally, I sadly only spent one week to make it, so it definitely needs some fixes and optimizations, so if anyone has time to contribute a little bit of code that would be fantastic.

yuripourre commented 4 years ago

Beautiful project!

julienvillegas commented 4 years ago

Super!! very professional. The existing particle edior does not work well on an apple Retina display. I will try that one. It could replace the existing one IMO

metaphore commented 4 years ago

Awesome stuff! I think that could be a great alternative particle engine. Not sure about replacement, the concept feels very different, doesn't seem that the old particle emitter somehow compatible with this node structure.

Tom-Ski commented 4 years ago

The project already has legacy import to import particles generated with the current libgdx editor to talos editor. @azakhary can probably provide some examples of of side by sides with the different versions, one being run through the importer.

elenatres commented 4 years ago

The editor looks great, but I didn't find any example of how to use created particle effect in the libGdx game project. Could you please provide a short code snippet of how to load the exported particle file and render it?

azakhary commented 4 years ago

I think the best example is here: https://github.com/rockbite/talos/blob/686dd2c98eefac02ba86b8c828c81a97d4a03161/runtimes/talos-libgdx/test/com/rockbite/talos/runtime/test/LegacyCompareTest.java#L113

Check out the TalosActor, you don't need to create actor, but you can see in the constructur it create particl edescriptor, loads it, and makes it spawn a particle instance, which is what you want. then you render it in renderer. pay attention to ScopePayload which is just an empty object you need to supply for later advanced stuff. (I don't remember if you can get away with not supplying it)

Let me know if this helps!

azakhary commented 4 years ago
public void create() {
    particleEffectDescriptor = new ParticleEffectDescriptor();
    particleEffectDescriptor.setAssetProvider(new TestAssetProvider(atlas));
    particleEffectDescriptor.load(effect);
    particleEffect = particleEffectDescriptor.createEffectInstance();
    particleEffect.setScope(new ScopePayload());

    renderer = new SpriteBatchParticleRenderer(batch);
}

public void draw (Batch batch, float parentAlpha) {
    particleEffect.update(Gdx.graphics.getDeltaTime()); 
    particleEffect.render(renderer);
}
azakhary commented 4 years ago

@Tom-Ski we should probably have default asset providers and scopes be set already so all is left to do is to load the effect and create its instances. these two rows need to be optional I think. (and also not call the simple asset provider TestAssetProvider, but like AtlasAssetProvider)

slebed commented 4 years ago

I just found looking through the bug tracker. Really wonderfully done.

crykn commented 3 years ago

Talos is definitely a really cool project! However, since we're trying to clean up the issue tracker and this is not really an issue, I'm closing this. Moreover, Talos is featured on top of the tools section of our new website, which is imo a better place to bring attention to such an amazing project.