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 method | Default | Meaning |
|---|---|---|
at(Vec3d) | — | World position |
size(float) / size(w, h) | 1 × 1 | Quad size in blocks |
color(ColorRgba) | white | Tint and alpha |
blend(Blend) | ALPHA | ALPHA or ADDITIVE |
facing(Facing) | CAMERA | Camera-facing or Y-axis-facing |
rotation(radians) | 0 | Static roll |
rotationSpeed(rad/s) | 0 | Continuous roll |
flipbook(cols, rows, fps) | none | Row-major sprite sheet animation |
animationOffset(seconds) | 0 | Desynchronize identical flipbooks |
maxRenderDistance(blocks) | 128 | Cull distance |
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:
| Factory | Shape |
|---|---|
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 method | Default | Meaning |
|---|---|---|
at(Vec3d) | — | Center position |
normal(Vec3d) | (0, 1, 0) | Plane orientation |
size(float) / size(w, h) | 1 × 1 | Extents in blocks |
lineWidth(float) | 0.08 | Outline width for ring/line/arc shapes |
arc(startRad, endRad) | full circle | Angular range for arcs |
roundedCorners(radius) | — | Corner radius for rounded boxes |
polygon(sides, rotationRad) | — | Side count and rotation for polygons |
color(ColorRgba) | white | Fill/outline color |
maxRenderDistance(blocks) | 128 | Cull 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.