GitBrincie212 / Apel-Mod

Apel is a library that brings particle animations to the table with flexible behaviour and a clean developer interface. It promises also lots of predefined shapes & paths to help the developer on their particle scene
Other
2 stars 1 forks source link

Client payload handler #22

Closed DarthSharkie closed 4 months ago

DarthSharkie commented 4 months ago

This is still a draft (though it does work correctly, as far as I know, see the end of the comment), but wanted to share the approach I'm thinking on the rendering and instructions.

My plan from here:

I can see this working, but it's possible the refactor train will continue further. What I don't want to do right now is have the ParticleObjects and ApelRenderers get more tied together. ParticleObjects should still be telling ApelRenderers what and where to draw, but the renderers handle the mechanism by which drawing actually becomes visible to the player.

Also note that my eventual plan for (I think) significant performance gains is to evolve the client rendering to maintain its own Particles instead of letting the ParticleManager do it all. This will mean the particle trails go away; they happen because we keep spewing new particles on every frame. This means ParticleObjects will need some sort of grouping of instructions and an internal label to collect those Particle instances.

Testing thus far is using the following snippet, which lets me compare server/client easily:

ParticleCombiner<? extends ParticleObject> combiner = new ParticleCombiner<>(ellipse, cylinder2, tet1, tri1, sphere, circle, triangle, quad, bezierCurve, point);
PointAnimator pointAnimator1 = new PointAnimator(1, combiner, user.getPos().toVector3f().add(10, 1, 4), 10000);
PointAnimator pointAnimator2 = new PointAnimator(1, combiner, user.getPos().toVector3f().add(-10, 1, 4), 10000);
pointAnimator1.beginAnimation(ApelRenderer.create(world));
pointAnimator2.beginAnimation(ApelRenderer.client(world));