Skip to content

gambit07/fxmaster

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1,302 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gambit's FXMaster

GitHub release GitHub all releases Discord

FXMaster+.mp4

Supporting The Module

ko-fi Patreon Gambits Lounge


Welcome to the official release of FXMaster V8! This release brings brand new handling for V14 Scene Levels, new Manage Layers functionality to order particle and filter effects, new macro API with improved flexibility, and more! Hope everyone enjoys!

Any support via the Patreon or Ko-fi is greatly appreciated! If you are a Patreon subscriber you will receive access to the FXMaster+ module. FXMaster+ can be accessed from Patreon, and it's where I will be adding new particle effects and filters moving forward. For the month of April, it will get you access to the ⚪Wind, ⚪Wind Wisp, 🔵Water, 🟡Lightning Bolts, 🔵Fish, 🟢Glitch, 🔵Ice, 🟤Duststorm, 🟤Sandstorm, 🟢Ghosts, 🟡Sunlight, 🟢Magic Crystals, 🟡Fireflies, 🌸Sakura Bloom, and 🌸Sakura Blossoms Effects - Effects are previewed below:

wind.mp4

Water (click to expand)
waterPreview.mp4
Lightning Bolts (click to expand)
lightningBolts.mp4
Fish (click to expand)
fish.mp4
Glitch (click to expand)
glitch.mp4
Ice (click to expand)
ice.mp4
Duststorm + Sandstorm (click to expand)
dust-sand-storm.mp4
Ghosts (click to expand)
ghosts.mp4
Sunlight (click to expand)
sunlight.mp4
Magic Crystals (click to expand)

magiccrystals.mp4

Fireflies (click to expand)

fireflies.mp4

Sakura Bloom (click to expand)

sakura-effect.mp4


FXMaster is a module for Foundry Virtual Tabletop that provides various types of effects:

  • Particle Effects, including weather (rain, clouds, fog, snow, etc.), animals (crows, bats, spiders, etc.), and a few others.
  • Filter Effects, including color overlays, underwater, lightning, and more.

This module also provides ways to easily configure these effects.

Table of Contents

Installation Instructions

To install FXMaster, find FXMaster in the module browser, or paste the following URL into the Install Module dialog in the Setup menu of Foundry Virtual Tabletop:

https://github.com/gambit07/fxmaster/releases/latest/download/module.json

FAQ

  • Q: What is the difference between Particle Effects and Filter Effects?

    A: Particle Effects are global effects that display particles on the whole scene. Mostly they are weather effects, but they also include animals and some other effects.
    Filter Effects are filters that adjust the whole scene in some way, e.g. by adjusting the color or distorting the scene to look like it's underwater.

  • Q: Can I provide my own effects?

    A: You can provide your own Particle Effects when using FXMaster+ in the Manage User Particle Effects menu. It's not possible to provide your own Filter Effects.

Usage

The functionality of FXMaster can be accessed via FXMaster Controls FXMaster Controls Icon in scene controls. Each FXMaster app has its own tool inside scene controls.

Particle Effects  

Particle Effects include weather effects like rain, fog, clouds, and snow, but also other global particle effects such as birds flying across the scene or spiders crawling around.

There are two ways to implement Particle Effects: via the FXMaster Controls menu for global Particle Effects, or via a Region using the FXMaster: Particle Effects Region behavior.

Particle Effects via FXMaster Controls App

Clicking on the FXMaster Controls tool opens the Particle Effects Management app:

Particle Effects Management

In this app, you can configure individual Particle Effects. They are sorted into different groups ("Weather", "Ambient", and "Animals").

You can activate individual Particle Effects by clicking the corresponding toggle button.

By clicking on the name of a Particle Effect, you expand it, showing the options for that effect:

Particle Effect Options

Particle Effects via Region Behavior

After adding a Region, open the Region config menu and navigate to the Behaviors tab. Add a new behavior and select the option 'FXMaster: Particle Effects':

Particle Effects Management

  • In this menu, you can configure individual Particle Effects in the same way as in the main app, and add region elevation visibility handling.

    • Selecting the checkbox next to a Particle Effect will display a dropdown of its options.
    • Saving the Region behavior will add the selected Particle Effects to the region.
    • For region elevation, use the Elevation Constraints dropdown.
  • Elevation Constraints

    • None - No elevation restrictions are considered.
    • Tokens POV - Visibility will be restricted to a given token’s POV.
      • Example: If the region elevation bottom is set to 10 feet and the region elevation top is set to 20 feet, the particle effect will be visible to the token while their elevation is between 10 and 20 feet.
      • Example: If the region elevation bottom is set to 10 feet and the region elevation top is infinite, the particle effect will be visible to the token while their elevation is 10 feet or above.
      • Example: If the region elevation bottom is infinite and the region elevation top is set to 20 feet, the particle effect will be visible to the token while their elevation is 20 feet or below.
    • Specific Tokens POV - Same visibility as Tokens POV, but only allows visibility for Token UUIDs entered. Any Token UUID not entered will not be able to see the particle effect.
    • Always Visible for GM - Ignores Tokens POV for GM and makes the effect always visible.
  • In addition, you can subscribe the Particle Region behavior to the Token Enters and Token Exits events.

    • These events can work in concert with the Elevation Constraints options, or on their own.
  • Events

    • Token Enters - Effect becomes visible when a token enters the bounds of the region.
      • This event can be paired with Token Exits to turn an effect on and off when a token moves in/out.
      • Alternatively, you can only add Token Enters; in that case the effect becomes visible once a token enters and remains visible even if they exit.
    • Token Exits - Effect becomes not visible when a token exits the bounds of the region.

Masking Particle Effects

By default, Particle Effects added via the app are displayed across the entire scene. However, it is possible to mask them from specific areas. This can be achieved within Regions by using the Region behavior "Suppress Weather" or "FXMaster: Suppress Scene Particles". "Suppress Weather" masks all Particle and Filter effects along with core Foundry effects, "FXMaster: Suppress Scene Particles" only masks FXMaster Particle Effects.

  • When using "FXMaster: Suppress Scene Particles", there is additional region elevation visibility handling.

  • Elevation Constraints

    • None - No elevation restrictions are considered.
    • Tokens POV - Visibility suppression will be restricted to a given token’s POV.
    • Specific Tokens POV - Same visibility as Tokens POV, but only allows visibility for Token UUIDs entered. Any Token UUID not entered will not be able to see the suppression.
    • Always Visible for GM - Ignores Tokens POV for GM and makes the suppression always visible.
  • In addition, you can subscribe the Particle Region behavior to the Token Enters and Token Exits events.

    • These events can work in concert with the Elevation Constraints options, or on their own.
  • Events

    • Token Enters - Effect becomes suppressed when a token enters the bounds of the region.
      • This event can be paired with Token Exits to turn suppression on and off when a token moves in/out.
      • Alternatively, you can only add Token Enters; in that case the effect becomes suppressed once a token enters and remains suppressed even if they exit.
    • Token Exits - Suppression becomes disabled when a token exits the bounds of the region.
  • Finally, you can opt to enable Edge Fade %. When this setting is above 0, scene level filters will be blended into the region edges to create a more natural looking suppression area rather than a stark cutout shape

Particle Effects are only displayed outside the region areas when masked. If a Hole shape is added to the region, scene particle effects will display in the hole area cutout.

⚠ Performance Note

The Particle Effects provided by FXMaster have recently had an overhaul for Performance in versions 7.2.0+. I've normalized particle density and added in support for Foundrys built-in Performance Mode client setting. FXMaster will now adjust density based on that setting, where percentage is the fraction of total particles set in the manager that will be emitted, Maximum = 100%, High = 75%, Medium = 50%, Low = 25% (NOTE: Your players must know to use the performance mode setting within Foundry, so keep that in mind if a player has issues with performance related to effects). These changes allow much more flexibility for the GM across different player PC configurations and should prevent issues that could occur in the past on very large scenes where maximum density for a given particle effect could crash the scene. If there is an issue where too many particle effects cause a crash, launch the world in safe configuration and delete the configured Particle Effects for the scene by running the following as a script macro or in the developer console (F12):

canvas.scene.unsetFlag("fxmaster", "effects");

You can then safely reactivate your modules.

Filter Effects  

Filter Effects include effects that change the underlying scene visuals in some way like altering the color, displaying an old film effect, or adding underwater displacement. There are two ways to implement Filter Effects: via the FXMaster Controls menu for global Filter Effects, or via a Region using the FXMaster: Filter Effects Region behavior.

Filter Effects via FXMaster Controls App

Clicking on this tool opens the Filter Effects Management app:

Filter Effects Management

You can activate individual Filter Effects by clicking the corresponding toggle button.

By clicking on the name of a Filter Effect, you expand it, showing the options for that effect:

Filter Effect Options

The available options differ heavily between individual Filter Effects, so it doesn't make much sense to list them here.

The options will be adjusted in real-time as you make changes to them.

Filter Effects via Region Behavior

After adding a Region, open the Region config menu and navigate to the Behaviors tab. Add a new behavior and select the option 'FXMaster: Filter Effects':

Filter Effects Management

  • In this menu, you can configure individual Filter Effects in the same way as in the main app, and add region elevation visibility handling.

    • Selecting the checkbox next to a Filter Effect will display a dropdown of its options.
    • Saving the Region behavior will add the selected Filter Effects to the region.
    • For region elevation, use the Elevation Constraints dropdown.
  • Elevation Constraints

    • None - No elevation restrictions are considered.
    • Tokens POV - Visibility will be restricted to a given token’s POV.
      • Example: If the region elevation bottom is set to 10 feet and the region elevation top is set to 20 feet, the filter effect will be visible to the token while their elevation is between 10 and 20 feet.
      • Example: If the region elevation bottom is set to 10 feet and the region elevation top is infinite, the filter effect will be visible to the token while their elevation is 10 feet or above.
      • Example: If the region elevation bottom is infinite and the region elevation top is set to 20 feet, the filter effect will be visible to the token while their elevation is 20 feet or below.
    • Specific Tokens POV - Same visibility as Tokens POV, but only allows visibility for Token UUIDs entered. Any Token UUID not entered will not be able to see the filter effect.
    • Always Visible for GM - Ignores Tokens POV for GM and makes the effect always visible.
  • In addition, you can subscribe the Filter Region behavior to the Token Enters and Token Exits events.

    • These events can work in concert with the Elevation Constraints options, or on their own.
  • Events

    • Token Enters - Effect becomes visible when a token enters the bounds of the region.
      • This event can be paired with Token Exits to turn an effect on and off when a token moves in/out.
      • Alternatively, you can only add Token Enters; in that case the effect becomes visible once a token enters and remains visible even if they exit.
    • Token Exits - Effect becomes not visible when a token exits the bounds of the region.

Masking Filter Effects

By default, Filter Effects added via the scene app are displayed across the entire scene. However, it is possible to mask them from specific areas. This can be achieved within Regions by using the Region behavior "Suppress Weather" or "FXMaster: Suppress Scene Filters". "Suppress Weather" masks all Particle and Filter effects along with core Foundry effects, "FXMaster: Suppress Scene Filters" only masks FXMaster Filter Effects and adds additional functionality.

  • When using "FXMaster: Suppress Scene Filters", there is additional region elevation visibility handling.

  • Elevation Constraints

    • None - No elevation restrictions are considered.
    • Tokens POV - Suppression will be restricted to a given token’s POV.
    • Specific Tokens POV - Same visibility as Tokens POV, but only allows visibility for Token UUIDs entered. Any Token UUID not entered will not be able to see the suppression.
    • Always Visible for GM - Ignores Tokens POV for GM and makes the suppression always visible.
  • In addition, you can subscribe the Filter Region behavior to the Token Enters and Token Exits events.

    • These events can work in concert with the Elevation Constraints options, or on their own.
  • Events

    • Token Enters - Suppression becomes visible when a token enters the bounds of the region.
      • This event can be paired with Token Exits to turn suppression on and off when a token moves in/out.
      • Alternatively, you can only add Token Enters; in that case the suppression becomes visible once a token enters and remains visible even if they exit.
    • Token Exits - Suppression becomes disabled when a token exits the bounds of the region.
  • Finally, you can opt to enable Edge Fade %. When this setting is above 0, scene level filters will be blended into the region edges to create a more natural looking suppression area rather than a stark cutout shape

Filter Effects are only displayed outside the region areas when masked. If a Hole shape is added to the region, scene filter effects will display in the hole area cutout.

API Effects UI Manager  

The API Effects manager is a utility for inspecting, editing, and removing scene-wide effects that were added via macros or presets through FXMaster’s APIs.

Manage API Effects

To open: Scene Controls → FXMaster Controls → API Effects (plug icon).

What it shows:

  • Scene-wide Particle and Filter entries that were added programmatically.
  • Each row can be expanded to view the raw JSON parameters stored for that effect (type, options, etc).

Actions:

  • Edit (pencil) - Opens an editor for that single effect instance.
  • Delete (trash) - Removes that single API-created effect from the Scene.

Notes:

  • The Presets API below creates multiple entries with ids like apiPreset_<presetName>_p0 / apiPreset_<presetName>_f0, which will show up here if you ever need to inspect or remove them manually.

Save Particle and Filter Effects as a Macro  

This tool allows you to create a macro from the currently active Particle Effects and Filter Effects. When clicking this tool, a dialog allows you to name the macro, and toggle optionals for a Play or Toggle macro as well as Skip Fading true/false parameter. A macro is created in the macro directory after saving. It's not put onto the hotbar, so you need to drag it there yourself if you'd like to.

When executed, the macro sets the Particle Effects and Filter Effects of the current scene to the state they were in when the macro was created.

Clear Particle and Filter Effects  

When clicked, this tool shows a confirmation dialog to delete all Particle Effects and Filter Effects from the current scene.

Levels  

When using native Scene Levels in Foundry V14+, scene-wide Particle Effects and Filter Effects can be limited to specific Levels instead of rendering across the whole scene. This makes it possible to keep an effect on only the selected floor or floors while other Levels remain unaffected.

Using Levels with Scene Effects

In the Particle Effects Management and Filter Effects Management apps, scene-wide effects include a Levels selector.

  • All Levels - The effect renders everywhere it normally would on the current scene.
  • One or more specific Levels - The effect is restricted to the selected Scene Levels.

This Level restriction can be combined with other FXMaster routing options such as Below Tokens, Below Tiles, and Below Foreground. Native tile, foreground, and supported suppression behavior are still respected after the Level restriction is applied.

Notes

  • The Levels selector is intended for scene-wide effects added through the FXMaster management apps.
  • Region-based FXMaster effects follow the Region's own placement, assigned levels, and elevation visibility handling.
  • On scenes that do not use multiple native Scene Levels, scene-wide effects behave as normal global effects.

Layers  

The Manage Layers window is used to control the render order of enabled FXMaster effects. It allows scene-wide, region-based, and API-created effects to be mixed together in a single stack so you can decide which effects render above or below the others.

Manage Layers Window

Manage Layers

To open: Scene Controls → FXMaster Controls → Manage Layers (layer-group icon).

The window lists every currently enabled Particle Effect and Filter Effect that participates in FXMaster's scene compositor.

What it shows:

  • Order - The current top-to-bottom render order. Higher entries in the list render above lower entries.
  • Effect - The effect name and whether it is a Particle or Filter effect.
  • Source - Where the effect came from.
    • Scene - Added directly through the main FXMaster management apps.
    • Region - Added by an FXMaster Region behavior.
    • API - Added programmatically by an API call.
    • API - Preset - Added by the Presets API.
    • API - Macro - Added by a saved FXMaster macro or other macro-style API playback.
  • Owner - The Scene or Region that owns the effect.
  • Level - On scenes using multiple native Levels, this column shows which Scene Level or Levels the effect is currently limited to if relevant.

Actions:

  • Move Up / Move Down - Reorder an effect in the stack.
  • Reset Order - Restore the default FXMaster stack order for the current scene.

Notes

  • Layer order is separate from Below Tokens, Below Tiles, and Below Foreground. Those options still control whether an effect appears underneath those scene elements, while the Layers window controls the order between FXMaster effects themselves.
  • Effects added later will appear in the list automatically with highest priority and can be reordered at any time.
  • The Level column is informational. To change which Level an effect uses, edit the effect in its manager or Region behavior.

Developer API

FXMaster exposes two supported global APIs for macros and third-party packages:

FXMASTER.api.presets
FXMASTER.api.effects

Tip: Call these after the world is ready (for example inside Hooks.once("ready", ...)) so FXMASTER and CONFIG.fxmaster are initialized.

Presets API

FXMaster’s Presets API applies curated, scene-wide environment effects by name. A preset can include multiple Particle Effects and Filter Effects, and FXMaster resolves the best available preset variant automatically:

  • If FXMaster+ is active and a preset has an FXMaster+ variant, that tier is preferred.
  • Otherwise, the core FXMaster variant is used when available.

Accessing the Presets API

FXMASTER.api.presets

Common preset operations

// Play or update a preset on the current scene
await FXMASTER.api.presets.play("sunshower", {
  direction: "north",
  density: "high",
  belowForeground: false,
});

// Toggle a preset on or off
await FXMASTER.api.presets.toggle("blizzard", {
  topDown: true,
  soundFx: true,
});

// Stop a preset
await FXMASTER.api.presets.stop("blizzard");

// Stop any active API preset, then play the requested preset
await FXMASTER.api.presets.switch("acid-rain");

// Introspection helpers
console.log(FXMASTER.api.presets.list());
console.log(FXMASTER.api.presets.listValid());
console.log(FXMASTER.api.presets.listActive());
console.log(FXMASTER.api.presets.listActive({ scene: "Scene.abc123" }));

Preset options

All preset methods accept an optional opts object.

Option Type Default Description
topDown boolean false Prefer the preset’s top-down variant when one exists.
direction string | number - Override the preset direction. Supports compass strings such as "n", "ne", "north", "southwest", plus "up", "down", "left", "right", or a numeric degree value.
color string - Hex color override such as #88ccff or #8cf. FXMaster only applies it when the preset effect supports a tint/color parameter.
speed "very-low" | "low" | "medium" | "high" | "very-high" | number - Relative speed override or explicit numeric multiplier.
density "very-low" | "low" | "medium" | "high" | "very-high" | number - Relative density override or explicit numeric multiplier.
belowTokens boolean - Override whether the preset renders below tokens.
belowTiles boolean false Override whether the preset renders below tiles.
belowForeground boolean false Override whether the preset renders below foreground coverage.
darknessActivationEnabled boolean - Explicitly enable or disable darkness activation.
darknessActivationMin number - Minimum scene darkness level for the preset’s activation range.
darknessActivationMax number - Maximum scene darkness level for the preset’s activation range.
soundFx boolean - Enable or disable preset-linked Sound FX when FXMaster+ is active.
levels string | number | Array<string | number> - Restrict the preset to one or more native Scene Levels by id or name. Invalid selections fall back to all levels.
scene Scene | string current scene Target Scene document or Scene UUID.
silent boolean true Suppress UI warning notifications for missing presets or invalid override values.

Notes

  • Presets created by this API are stored on the Scene using keys that start with apiPreset_.... They do not modify FXMaster’s core_* scene entries or effects created by other modules.
  • FXMASTER.api.presets.switch(name, opts) stops any active API-managed presets before playing the requested one. If name is omitted or falsy, it only stops active API presets.
  • FXMASTER.api.presets.hasFxmaster() and FXMASTER.api.presets.hasFxmasterPlus() are available when a macro needs to check the active module tier.
  • API-created preset rows can be inspected and removed from the API Effects UI Manager.

Effects API

FXMaster’s Effects API adds arbitrary scene-wide Particle Effects and Filter Effects without replacing FXMaster’s built-in scene manager state. API-created rows appear in the API Effects UI Manager, can be layered with the rest of the FX stack, and can be removed by id, by exact payload match, or through a toggle group.

Accessing the Effects API

FXMASTER.api.effects

Available methods:

FXMASTER.api.effects.play(...)
FXMASTER.api.effects.stop(...)
FXMASTER.api.effects.toggle(...)

FXMASTER.api.effects.particles.stop(...)
FXMASTER.api.effects.particles.toggle(...)
FXMASTER.api.effects.filters.stop(...)
FXMASTER.api.effects.filters.toggle(...)

Note: There is no scoped play helper. Use FXMASTER.api.effects.play({ particles: [...] }) or FXMASTER.api.effects.play({ filters: [...] }) when you only want one effect kind.

The easiest way to capture an exact options payload is to configure an effect in the FXMaster UI and save it as a macro, or inspect an API-created row in the API Effects UI Manager.

Effect entry shape

Use effects when you want a mixed, ordered list of particles and filters. Each entry in effects must include kind.

const mixedEffects = [
  {
    kind: "filter",
    type: "color",
    options: {
      belowTokens: false,
      color: { value: "#9cc8ff", apply: true },
      saturation: 0.1,
      contrast: 1.05,
    },
  },
  {
    kind: "particle",
    type: "rain",
    options: {
      direction: 90,
      density: 0.15,
      speed: 1,
    },
  },
];

Use particles or filters when you only want a single effect kind. In those arrays, kind is implied and can be omitted.

const particles = [
  { type: "snow", options: { direction: 110, density: 0.12, speed: 0.9 } },
];

const filters = [
  { type: "underwater", options: { speed: 0.5, scale: 1.2 } },
];

Each effect entry can also include id or effectId for a stable API-managed id. FXMaster preserves explicit ids only when they use the API id namespace (for example apiMacro_myStorm_p or apiMacro_myStorm_f); otherwise it generates a new id automatically. Saved FXMaster macros use this pattern for static stop samples.

Any effect options object may also include levels to restrict that effect to one or more native Scene Levels.

Effects API arguments

Field Used by Description
effects play, stop, toggle Ordered mixed array of effect entries. Use this when you want to mix particles and filters and preserve the requested FX stack order from top to bottom.
particles play, stop, toggle Particle-only array. For play and toggle, entries are particle definitions. For stop, entries may be ids, UIDs, or full particle payloads.
filters play, stop, toggle Filter-only array. For play and toggle, entries are filter definitions. For stop, entries may be ids, UIDs, or full filter payloads.
scene all methods Target Scene document or Scene UUID. Defaults to the current scene.
skipFading play, stop, toggle When true, FXMaster applies or removes particles and filters immediately instead of fading them in or out.
toggleKey toggle Stable key used to associate repeated toggle calls with the same API-managed group. Aliases key, id, and name are also accepted.

Play, stop, and toggle

Play a mixed, ordered set of effects and capture the ids that were created:

const ids = await FXMASTER.api.effects.play({
  effects: [
    {
      kind: "filter",
      type: "color",
      options: {
        color: { value: "#9cc8ff", apply: true },
        saturation: 0.1,
        contrast: 1.05,
      },
    },
    {
      kind: "particle",
      type: "rain",
      options: {
        direction: 90,
        density: 0.15,
        speed: 1,
      },
    },
  ],
  skipFading: true,
});

Play only particles:

await FXMASTER.api.effects.play({
  particles: [
    { type: "snow", options: { direction: 110, density: 0.12, speed: 0.9 } },
    { type: "fog", options: { scale: 1.2, density: 0.08, alpha: 0.6 } },
  ],
});

Play only filters on a specific Scene:

await FXMASTER.api.effects.play({
  filters: [
    {
      type: "underwater",
      options: { speed: 0.5, scale: 1.2 },
    },
  ],
  scene: "Scene.abc123",
});

Stop by the ids returned from play:

await FXMASTER.api.effects.stop({
  ...ids,
  skipFading: true,
});

Stop by exact payload match when ids are not available:

await FXMASTER.api.effects.stop({
  effects: [
    {
      kind: "filter",
      type: "color",
      options: {
        color: { value: "#9cc8ff", apply: true },
        saturation: 0.1,
        contrast: 1.05,
      },
    },
    {
      kind: "particle",
      type: "rain",
      options: {
        direction: 90,
        density: 0.15,
        speed: 1,
      },
    },
  ],
  skipFading: true,
});

Toggle a named effect group on or off:

await FXMASTER.api.effects.toggle({
  effects: [
    {
      kind: "particle",
      type: "fog",
      options: { scale: 1.25, density: 0.08, alpha: 0.6 },
    },
    {
      kind: "filter",
      type: "bloom",
      options: { blur: 2, bloomScale: 1.1, threshold: 0.4 },
    },
  ],
  toggleKey: "swamp-haze",
  skipFading: true,
});

When toggleKey is omitted, FXMaster derives a repeatable toggle key from the effect payload. Later calls with the same payload, or the same explicit toggleKey, toggle that group off.

play and stop return an object shaped like { particles: string[], filters: string[] }. toggle returns { active, action, particles, filters }.

Scoped helpers

Use the scoped helpers when you already know you only want one effect kind.

await FXMASTER.api.effects.particles.stop(ids.particles, { skipFading: true });
await FXMASTER.api.effects.filters.stop(ids.filters, { skipFading: true });

await FXMASTER.api.effects.particles.toggle(
  [{ type: "snow", options: { direction: 110, density: 0.12, speed: 0.9 } }],
  { toggleKey: "roof-snow", skipFading: true },
);

await FXMASTER.api.effects.filters.toggle(
  [
    {
      type: "color",
      options: { color: { value: "#88ccff", apply: true }, saturation: 0.15 },
    },
  ],
  { toggleKey: "cold-tint" },
);

Built-in filter effect types

Core FXMaster currently registers these filter types:

bloom, color, fog, lightning, oldfilm, predator, underwater

You can inspect the currently registered filter types in a running world with:

Object.keys(CONFIG.fxmaster.filterEffects ?? {})

Filter option names vary by effect. The most reliable way to get an exact filter payload is to configure the effect in the UI and save it as a macro, then reuse the generated options object inside FXMASTER.api.effects.

Built-in particle effect types

Core FXMaster currently registers these particle types:

autumnleaves, bats, birds, bubbles, clouds, crows, eagles, embers, fog, hail, rain, rats, snow, snowstorm, spiders, stars

FXMaster+ may register additional particle effect types.

You can inspect the currently registered particle types in a running world with:

Object.keys(CONFIG.fxmaster.particleEffects ?? {})

Common particle effect options

Most particle effects accept a subset of the following options. The exact option bag varies by effect type.

Option Type Description
scale number Scale factor applied relative to the effect’s base size.
direction number Effect direction in degrees.
speed number Speed multiplier relative to the effect’s base speed.
lifetime number Lifetime multiplier for the emitted particles.
density number Particle density for the effect.
alpha number Particle opacity from 0 to 1.
tint { value: string, apply: boolean } Tint the effect with a color when supported.
animations string[] Optional animation names used by effects that support multiple motion variants.

Contributing

Code and content contributions are accepted. Please feel free to submit issues to the issue tracker or submit pull requests for code changes.

Acknowledgement

Many thanks to:

  • U~man for the original work on this module.
  • ghost for maintaining functionality on this module for the past few years.
  • theripper93 for contributing his ideas regarding handling particle effect masking elegantly.
  • Wasp for providing the Sequencer module.
  • SecretFire for exchanging ideas, providing help, and shaders for the filter effects. Donate here.

Licensing

  • The software component of FXMaster is licensed under BSD 3-Clause.
  • The Seagull sprites used in the Birds particle effect are from whtdragon.
  • The control and tool icons are from Font Awesome, licensed under the CC BY-4.0.
  • The icons for particle effects are by Rexard and licensed under Rexard Game Dev Assets EULA.
  • The rat sprites used in the Rats particle effect by crymoonster are licensed under CC BY-4.0.

About

A module for Foundry Virtual Tabletop that adds various Particle and Filter environmental effects.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages

 
 
 

Contributors