Anyone interested in trying out a new particle system?
Features:
Particle drivers (like influencers from PM, but far more powerful)
Instanced particle geometry (compatible with any instancable material)
Single vertex and quad particle geometry
Trailing geometry (useful for slashing effects)
Sprite sheets
As for the API itself, in order to cover as many use-cases as possible, all particle logic (including spawning logic) has been moved to drivers (aka influencers) and Iāve made an effort to make system components extendable and/or replaceable.
Known Issues:
Takes more time to setup even a simple effect with this system than it does with ParticleMonkey or JME particles (see sample code below).
Interpolation/tween API is still pretty sketchy. I hope people could provide feedback and suggestions for this feature in particular.
Particles following geometry is not supported.
Code Sample:
public class TestBasicParticles extends DemoApplication {
public static void main(String[] args) {
new TestBasicParticles().start();
}
@Override
public void demoInitApp() {
ParticleGroup<ParticleData> group = new ParticleGroup(200);
group.setLocalTranslation(0, 3, 0);
group.setOverflowStrategy(OverflowStrategy.CullOld);
group.addDriver(ParticleDriver.force(new Vector3f(0f, -3f, 0f)));
group.addDriver(ParticleDriver.Position);
group.addDriver(ParticleDriver.Angle);
Emitter e = Emitter.create();
e.setParticlesPerEmission(Value.constant(5));
e.setEmissionRate(Value.constant(.1f));
group.addDriver(e);
group.addDriver(new ParticleFactory<ParticleData>() {
@Override
public void particleAdded(ParticleGroup<ParticleData> group, ParticleData p) {
p.setLife(4f);
p.setPosition(group.getVolume().getNextPosition(group.getWorldTransform()));
p.color.set(new ColorHSBA(FastMath.nextRandomFloat(), 1f, .5f, 1f).toRGBA());
p.linearVelocity = VfxUtils.gen.nextUnitVector3f().multLocal(VfxUtils.gen.nextFloat(4));
p.setScale(FastMath.rand.nextFloat(.05f, .2f));
p.angleSpeed.set(FastMath.rand.nextFloat(-5f, 5f));
}
});
rootNode.attachChild(group);
TriParticleGeometry geometry = new TriParticleGeometry(group, MeshPrototype.QUAD);
geometry.setQueueBucket(RenderQueue.Bucket.Transparent);
Material mat = new Material(assetManager, "MatDefs/particles.j3md");
mat.getAdditionalRenderState().setBlendMode(RenderState.BlendMode.Alpha);
mat.setTransparent(true);
geometry.setMaterial(mat);
rootNode.attachChild(geometry);
}
@Override
public void demoUpdate(float tpf) {}
}
I would be grateful if folks would give this particle system a try and provide feedback for me!
Hi @codex , I downloaded your project to try it and it does not compile.
The jme3utilities.math.noise.Generator.nextFloat(float v) method does not exist in the Heart-8.8.0 library, so all VfxUtils.gen.nextFloat(x) and VfxUtils.getGenerator().nextFloat(x) instructions are reported as an error. Could you please check and fix the problem?
There are unused classes in the codex.vfx and codex.vfx.annotations packages. What are they used for?
I would suggest you convert the project with Gradle, otherwise it is complicated to put all the pieces of the project together. If you are interested I will do it for you and post it on github.
nextFloat(x) is inherited from java.util.random.RandomGenerator. Which JDK are you using for this project?
Those are for an in-game effect editor I started working on. Sorry for that being in the master branch, though none of that code should affect anything.
Yeah, probably a good idea. Iām used to ant, so I keep putting learning gradle off . If you want to post a gradle build, I would be gradleful grateful for that.
Hi @codex , the SSRFilter class does not exist in jme-3.6.1-stable. Could you add the source code to the Jme-VFX project, or remove it from the TestMultipleSystems test class please ?
Hi @codex, as promised I converted your project with gradle. I separated the test classes and functions from the library classes. I reworked the code and the javadoc. You can fork it and update it with new ideas (those annotation classes look promising and indicate that you are developing a GUI).
If you want to share your ideas and make your projects easier to use, I would suggest using gradle, it is not hard to learn. Google and the JME community are your friends.
I read on your github that you are a game designer. Are you good with shaders?
Usually the rectangular healthbar fills from left to right, while the circle healthbar fills clockwise and the background color is usually a darker version of the primary color.
Of course, you can use Ant or whatever IDE you prefer to create the project. I will then help you convert it to gradle, and provide support where I am able.
Anyone who wants to take up the challenge is free to join.
I have a few of these on my to-do list for my game already actually, and I also have a few nearly-finished shaders that are (almost) the same as these, albeit less polished and less configurable at the moment (I have something like electricity and the dissolve, but not exactly like how its implemented in Unity)
I also have all of the code to do things like petrify, bodysheild, ghost, and ice using tri-planar texture projection on a player model ( in my case the code is used for splatting a plagued-slime texture onto any model, but if you change the slime texture to an ice or stone texture and add some bells and whistles, then it should work for ice and petrify effects as well)
Were you thinking of making an individual shader for each of these? Or would it be okay to pack them together into one shader for character models? In my situation, I have a shader called āAfflictedCreaturesā which is my catch-all shader for player and NPC models, and I would probably put everything but the healthbars into that single shader (or preferably into seperate .glslib files that any shader can reference), so then all of these cool effects can be used in conjunction without switching the shader.
I can share some screenshots/gifs of what I have so far, but maybe we should start a new thread (or move the last few posts to a new thread if a mod is able to) so I donāt derail this thread too much.
If Iām not missing something, it looks like this requires the jME SDK to build? Iām not seeing any build files in the repo that would pull in the dependencies listed on the wiki.