-
Notifications
You must be signed in to change notification settings - Fork 3
Particles
Overuse of particles can cause low performance due to the huge amount of polygons and logic of every single one of them. Particles are addition to graphics, not its full replacement.
ParticleBuilder - Class for simply summoning particles with Fluffy Fur.
getParticleOptions() -> GenericParticleOptions -
setRenderType(RenderType) - sets the Render type.
setParticleRenderType(ParticleRenderType) - sets particle Render type.
It's used for Vanilla Render types.
Example: setParticleRenderType(ParticleRenderType.PARTICLE_SHEET_OPAQUE)
setBufferSource(MultiBufferSource) - sets
setFormat(VertexFormat) - sets Vertex format.
setBehavior(ParticleBehavior) - sets Particle behaviour.
setColorData(ColorParticleData) - sets Color data.
setTransparencyData(GenericParticleData) - sets Transparency data.
setScaleData(GenericParticleData) - sets Scale data.
setSpinData(SpinParticleData) - sets Spin data.
setLightData(LightParticleData) - sets Light data.
setSpriteData(SpriteParticleData) - sets Sprite data.
addTickActor(Consumer<GenericParticle>), addSpawnActor(Consumer<GenericParticle>), addRenderActor(Consumer<GenericParticle>), addRenderPostActor(Consumer<GenericParticle>) - creates the Consumer every time when particle spawns, ticks, render ticks and its end of render ticks.
It's used for more advanced particle configuration.
Example:
final Consumer<GenericParticle> target = p -> {
//p <-- particle
p.setSpeed(p.getSpeed().add(0, 0.1f, 0));
};
particleBuilder.addTickActor(target);clearActors(), clearTickActor(), clearSpawnActors(), clearRenderActors(), clearRenderPostActors() - clears all Actors.
setDiscardFunction(GenericParticleOptions.DiscardFunctionType) - sets the Discard function for particle (NONE, INVISIBLE, ENDING_CURVE_INVISIBLE)
setLifetime(int) - sets the Lifetime value.
setLifetime(int, int) - sets the Lifetime value plus a random value from 0 to second value.
setGravity(int) - sets the Gravity value.
setGravity(int, int) - sets the Gravity value plus a random value from 0 to second value.
setFriction(int) - sets the Friction.
Friction works using it's own logic every tick, multiplying the value of Speed by its value.
With a value from 0 to 1 particle will slow down, and with a values greater than 1 particle will accelerate.
setFriction(int, int) - sets the Friction value plus a random value from 0 to second value.
enableCull(), disableCull(), setShouldCull(boolean) - sets the Render culling.
Particles won't be rendered if the camera is not facing towards the particle. Because of culling, the particle may not be displayed correctly when the camera is rotated.
False by default.
enableRenderTraits(), disableRenderTraits(), setShouldRenderTraits(boolean) - sets the parameters updating every render tick.
Used for smoother particle rendering.
True by default.
enablePhysics(), disablePhysics(), setHasPhysics(boolean) - sets the Physics of particle.
When value is false, particle will ignore block collision.
True by default.
randomVelocity(double), randomVelocity(double, double), randomVelocity(double, double, double) -
flatRandomVelocity(double, double, double) -
addVelocity(double, double, double) -
setVelocity(double, double, double) -
randomOffset(double), randomOffset(double, double), randomOffset(double, double, double) -
flatRandomOffset(double, double, double) -
enableForce(), enableForce(), enableForce(boolean) -
setDistance(double) -
enableDistanceSpawn(), disableDistanceSpawn(), setDistanceSpawn(boolean) -
addAdditionalBuilder(ParticleBuilder) -
clearAdditionalBuilders() -
spawn(Level, Vec3), spawn(Level, double, double, double) -
repeat(Level, Vec3, int), repeat(Level, double, double, double, int) -
repeat(Level, Vec3, int, float), repeat(Level, double, double, double, int, float) -
create(ParticleType<?>), create(RegistryObject<?>) -
create(GenericParticleOptions) -
ParticleBuilder.create(FluffyFurParticles.WISP)
.setColorData(ColorParticleData.create(0, 0, 1, 1, 0, 0).build())
.setTransparencyData(GenericParticleData.create(0.5f, 0).setEasing(Easing.QUARTIC_OUT).build())
.setScaleData(GenericParticleData.create(0.3f, 2, 0).setEasing(Easing.ELASTIC_OUT).build())
.setLifetime(200, 100)
.randomVelocity(0.35f)
.repeat(level, x, y, z, 50);Documentation - English:
The Fluffy Wiki
Документация - Русский:
The Fluffy Wiki