Repository navigation
Niagara and Unity Workflow
English | 简体中文
LumenFX separates offline authoring/conversion from the lightweight runtime JAR. None of the Unity, Unreal, or compiler binaries are shipped inside the Minecraft mod JAR.
The Unity Editor exporter is packaged as a standard Unity Package Manager (UPM) package in tools/unity/ (com.kltyton.lumenfx.exporter) and supports Unity 2020.3 LTS and newer.
- In Unity, open Window → Package Manager → + → Add package from disk... and choose
tools/unity/package.json(or Add package from git URL...:https://github.com/kltyton/LumenFX.git?path=/tools/unity). - Optional creator tools:
- Create Minecraft-scaled starter hierarchies via GameObject → LumenFX (
Sprite Burst Preset,Ribbon Trail Preset,Mesh Spark Preset). - Toggle the Scene View Minecraft 1-Block Grid & Player Height Guide via Tools → LumenFX → Toggle Minecraft 1-Block Grid.
- Create Minecraft-scaled starter hierarchies via GameObject → LumenFX (
- Select one or more root
GameObjects in the Hierarchy window and open Tools → LumenFX → Particle Exporter.... - Configure your resource namespace, effect ID (or enable Batch Export), output directory, and optional
pack.mcmetaoutput, then click Validate (clickable inline diagnostics) or Export.
- Main & Emission: Duration, looping, prewarm, simulation speed, start delay, curves & two-curve ranges (with weighted tangents & wrap modes), rate over time, rate over distance, bursts with probability and cycles, ring buffer modes.
- Shapes: Point, Sphere, Hemisphere, Circle, Box, Rectangle, Donut, Cone, Single Sided Edge, Mesh, and Sprite emission shapes (with shape textures).
- Motion & Physics: Velocity over Lifetime (including orbital/radial), Force over Lifetime, Inherit Velocity, Limit Velocity, Size/Color/Rotation over Lifetime & by Speed, Curl Noise, External Force Fields, World & Plane Collisions, Triggers, and Sub-Emitters.
-
Renderers & Materials: Billboard (including Stretched, Horizontal, Vertical, Align to Direction, Min/Max Viewport Size, Flip), Mesh renderers, Particle & Ribbon Trails, Texture Sheet Animation (Grid & Sprite List), Built-in & URP Particle shaders, plus URP Shader Graph (Unlit, Metallic Lit, Specular Lit, Complex Lit) and custom
LumenFxFragmentshader tags.
See tools/unity/README.md for the complete exporter specification.
The offline Niagara compiler lives in tools/compiler/ (.NET 10) alongside the UE5 Editor Plugin (tools/unreal/LumenFxExporter/LumenFxExporter.uplugin) and export scripts in tools/unreal/.
- Copy
tools/unreal/LumenFxExporterinto<YourUE5Project>/Plugins/LumenFxExporterand enable LumenFX Niagara Exporter in Edit → Plugins. - Configure the
LumenFXrepository path and default output directory in Project Settings → Plugins → LumenFX Exporter. - Right-click any
UNiagaraSystemasset in the Content Browser and choose LumenFX → Export to Minecraft LumenFX... to run pre-export validation and async compilation with live progress logs. Seetools/unreal/LumenFxExporter/README.md.
- Export the target Niagara System, Emitters, Materials, Functions, and Texture2D descriptions using
tools/unreal/Export-UnrealAssets.ps1(UAssetAPI JSON) plus full-resolution source PNGs. - Run the offline compiler:
dotnet build tools/compiler/LumenFx.Compiler.csproj -o compiler-out dotnet compiler-out/LumenFx.Compiler.dll niagara <json-root> /Game/Path/To/NS_MyEffect.NS_MyEffect my_mod:effects/my_effect <png-root> <resources-root> <aliases.json> <render-profile.json> <vector-fields-root> <unreal-source-root>
- Optional texture mip/compression baking via
./gradlew.bat bakeEffectTexturesfor.lftex.jsonsidecars. - Package the generated
assets/<namespace>/lumenfx/...files into your mod or resource pack.
-
CPU VectorVM: Executes compiled system/emitter Spawn & Update bytecode with persistent ID tables, LUT/curve sampling, curl noise & 3D vector fields (
.lfvf), and Niagara integration. - GPU Simulation (SPIR-V Compute): Compiles Niagara GPU compute stages and executes them natively on the active GPU backend (Vulkan or OpenGL compute) with SSBO state persistence and proper instance draining/reclamation.
-
SimCache Playback (
.lfsc): Loads offline-recorded or runtime-recorded Niagara SimCaches (both CPU and GPU frames), supports seamless handoff back to live GPU simulation with full attribute restoration (Float,Int,Half, persistent IDs, andAcquireTag), and enforces per-device allocation limits safely. - Renderers: Sprite (including cutout geometry & automatic pixel coverage), Ribbon (custom profiles, Hermite adaptive tessellation, dual UVs), Mesh (multi-LOD slots), Light, Decal, and Volume.
See tools/compiler/README.md for CLI arguments and advanced options.
Because LumenFX is a fork of Photon 26.2, existing Photon .fx effects can be loaded directly through VfxEffects.spawn(...):
- Place
.fxfiles underassets/<namespace>/lumenfx/effects/<path>.fx(alongside their referenced textures/meshes). - Supports Photon timelines, nested sub-effects, emitters, curves, emission shapes, collision & external forces, beams, trails, 3D model particles, custom shader materials, and asynchronous preloading.
- Clean lifecycle handling on natural completion, manual
close()(running Release phases), level changes, and resource reloads.