effekseer

Garnet Effekseer

garnet-effekseer runs the pinned Effekseer CPU simulation and publishes immutable particle records and Garnet drawings. The native build links the Effekseer core under its MIT license. Garnet issues all graphics commands.

require "garnet-effekseer"

asset = Garnet::Effekseer::Asset.new(File.read("effect.efkefc").to_slice) do |path|
  textures.fetch(path) # application-provided Garnet::Graphics::Texture
end

effect = asset.instantiate(seed: 42)
begin
  effect.advance(1_f32 / 60)
  frame = effect.snapshot
  entity << Garnet::Graphics::Components::Picture.new(frame.drawing)
ensure
  effect.close
end

Asset.load(source), Asset.load(source) { |path| ... } and Asset.with_textures(source) { |path, kind| ... } read the effect from a Garnet::Content::Source and otherwise match the byte constructors.

The example assumes the application has loaded the scene shard and owns the entity, texture lookup, and frame clock. Advance each instance once per tick and reuse its captured frame for multiple views. A frame survives the instance that produced it. stop removes the effect immediately and stop(drain: true) lets existing particles finish. All operations on a player belong to its owner thread. An asset keeps a copy of the validated bytes and resolves dependencies once. Each player has its own manager and parses its own native effect data.

Supported profile

  • EFKE container version 0 with a first runtime chunk at version 1610. Raw SKFE versions 7 and 13 cover the legacy ribbon and distortion fixtures.
  • Unlit sprites in an orthographic XY plane and connected ribbons with linear segments, stretched UVs and authored width. Snapshots convert to Garnet Y-down.
  • Packed per-corner color, color textures supplied by path, nearest/linear sampling, and normal, additive and multiply blending. Consecutive matching draws batch without changing callback order.
  • Bounded container chunk reads, capped collector capacity and explicit errors for unsupported nodes, materials and dependencies. Use trusted editor exports with the pinned native parser.

Back-distortion sprites capture a projected tangent and binormal and sample the preceding Garnet backdrop under their alpha coverage. Use Asset.with_textures(bytes) { |path, kind| ... } to distinguish color images from linear RG distortion maps. Matching consecutive sprites share a map pass. Custom materials, GPU simulation, rings, models, tracks, depth interactions, advanced texture stages and sound remain open. The first runtime chunk controls format selection, including exports that carry an older fallback chunk. The adapter uses a fixed 2D view. Perspective and camera-facing 3D behavior require additional work.

Run cmake -S native -B native/build -DCMAKE_BUILD_TYPE=Release and cmake --build native/build --parallel 6 from this shard, or install it as a path dependency to use its postinstall hook. The workspace scripts/check-composition modes build the core and exercise deterministic playback, ribbons and the shared GPU pixel fixture.

Fixture provenance at the pinned commit is Examples/Resources/square_r.efkefc and Dev/Cpp/Test/Resource/Simple_Ribbon_Parent.efk. Both are copied unchanged. The distortion fixture retains one sprite subtree from the upstream Benediction export.

For manual publication and scheduled ECS playback, see the optional effekseer scene adapter.

Repository

effekseer

Owner
Statistic
  • 0
  • 0
  • 0
  • 1
  • 2
  • 1 day ago
  • November 30, 2026
License

MIT License

Links
Synced at

Wed, 02 Dec 2026 02:09:15 GMT

Languages