Skip to main content

Preset Effects

Presets let mods create common visuals without implementing a renderer or writing GLSL. They use Nebulon's internal shaders and the same effect handles, synchronization, culling, render stages, and batching as every other effect — the consuming mod only supplies parameters and textures.

All preset builders live on NebulonPresets.


Billboard sprites

Textured camera- or axis-facing quads with tinting, blending, rotation, and flipbook animation:

BillboardSprite flame = NebulonPresets.billboard(
Identifier.of("my_mod", "textures/effect/flame.png"))
.at(position)
.size(1.5f) // or size(width, height)
.flipbook(8, 8, 24) // 8×8 sheet at 24 fps
.blend(BillboardSprite.Blend.ADDITIVE)
.color(ColorRgba.rgba(0xffaa66ff))
.rotationSpeed(0.4f)
.build();

NebulonRendering.effects().spawn(world, flame, 30);
Builder methodDefaultMeaning
at(Vec3d)World position
size(float) / size(w, h)1 × 1Quad size in blocks
color(ColorRgba)whiteTint and alpha
blend(Blend)ALPHAALPHA or ADDITIVE
facing(Facing)CAMERACamera-facing or Y-axis-facing
rotation(radians)0Static roll
rotationSpeed(rad/s)0Continuous roll
flipbook(cols, rows, fps)noneRow-major sprite sheet animation
animationOffset(seconds)0Desynchronize identical flipbooks
maxRenderDistance(blocks)128Cull distance
Texture identifiers

Billboard textures use ordinary Minecraft resource identifiers including the textures/ prefix and file extension, e.g. my_mod:textures/effect/flame.png. Flipbook frames run left to right, then top to bottom. A frame rate of zero shows the first frame.


SDF shapes

Procedural signed-distance-field shapes on an oriented plane — ideal for ability telegraphs, target markers, and ground decoration:

SdfPlane warningRing = NebulonPresets.arc()
.at(position)
.normal(new Vec3d(0, 1, 0))
.size(5)
.lineWidth(0.12f)
.arc(0, (float) (Math.PI * 1.5))
.color(ColorRgba.rgba(0xff3344dd))
.build();

NebulonRendering.effects().spawn(world, warningRing, 60);

Available shape factories:

FactoryShape
NebulonPresets.circle()Filled circle
NebulonPresets.ring()Outlined ring
NebulonPresets.box()Rectangle
NebulonPresets.roundedBox(cornerRadius)Rectangle with rounded corners
NebulonPresets.polygon(sides)Regular polygon
NebulonPresets.line()Line segment
NebulonPresets.arc()Partial ring with angular range
Builder methodDefaultMeaning
at(Vec3d)Center position
normal(Vec3d)(0, 1, 0)Plane orientation
size(float) / size(w, h)1 × 1Extents in blocks
lineWidth(float)0.08Outline width for ring/line/arc shapes
arc(startRad, endRad)full circleAngular range for arcs
roundedCorners(radius)Corner radius for rounded boxes
polygon(sides, rotationRad)Side count and rotation for polygons
color(ColorRgba)whiteFill/outline color
maxRenderDistance(blocks)128Cull distance

Presets are ordinary world effects, so they can also be spawned server-side:

NebulonNetworking.syncedEffects().spawn(serverWorld, warningRing, 60);

Planned presets

The preset library is intended to grow with packaged soft particles, beam/ribbon/track presets with tiled UVs, mesh auras (Fresnel, dissolve, scrolling noise), primitive volumes, projected decals, and deterministic effect sequences. Scene-depth-dependent options should query renderer capabilities when supporting unusual third-party backends.