You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*[Combining Multiple Effects in this Usermod](https://github.com/danewhero/WLED/blob/user_fx/usermods/user_fx/README.md#combining-multiple-effects-in-this-usermod)
| `SEGMENT.intensity / speed / custom1 etc.` | 8-bit | This syntax helps you utilize the UI sliders that can make certain elements of your running code editable by the user. (These can be controlled by the API as well.)
40
-
|`SEGENV.aux0`| ????| A temporary state variable to keep track of last position. (how does this relate to aux1?) |
41
-
|`SEGENV.call`|| A counter for how many times this effect function has been invoked since it started. |
42
-
|`strip.now`|| Current timestamp in milliseconds. |
43
-
|`SEGLEN / SEG_W / SEG_H`|??? | These variables are macros that help define the length and width of your LED strip/matrix segment. They can be changed at any time if the user sets new segment size(s). |
44
-
|`SEGCOLOR(x)`|??? | Gets user-selected colors from UI, where x is an integer 1, 2, or 3 fr primary, secondary, and tertiary colors, respectively. (and how it relates to meta string??) |
45
-
|`SEGMENT.setPixelColor`|||
46
-
|`SEGPALETTE`|||
47
-
|`SEGMENT.color_from_palette()`|??? | Easy way to specify a Palette. This function which should be favoured over `ColorFromPalette()`. |
40
+
|`SEGENV.aux0`| ???| A temporary state variable to keep track of last position. (how does this relate to aux1?) |
41
+
|`SEGENV.call`|???| A counter for how many times this effect function has been invoked since it started. |
42
+
|`strip.now`|???| Current timestamp in milliseconds. |
43
+
|`SEGLEN / SEG_W / SEG_H`| ???| These variables are macros that help define the length and width of your LED strip/matrix segment. They can be changed at any time if the user sets new segment size(s). |
44
+
|`SEGCOLOR(x)`|???| Gets user-selected colors from UI, where x is an integer 1, 2, or 3 fr primary, secondary, and tertiary colors, respectively. (and how it relates to meta string??) |
45
+
|`SEGMENT.setPixelColor`|???||
46
+
|`SEGPALETTE`|???||
47
+
|`SEGMENT.color_from_palette()`| ???| Easy way to specify a Palette. This function which should be favoured over `ColorFromPalette()`. |
48
48
|`hw_random8()`| 8-bit | Generates a random integer. |
49
-
50
-
explaining available functions for pixel drawing (the ones defined in FX_2Dfcn and FX_fcn, like move(), blur() etc.)
51
-
and MUST render the pixels each frame even if the frame did not change (this is acutally not really true anymore with segment layering but not doing so may still result in glitches)
52
-
53
-
49
+
|`FX_2Dfcn`| ??? ||
50
+
|`FX_fcn`| ??? ||
51
+
|`move()`| ??? ||
52
+
|`blur`| ??? ||
54
53
55
54
56
55
## Understanding 2D WLED Effects
@@ -249,7 +248,7 @@ return FRAMETIME;
249
248
* returning the frame time tells WLED how soon this effect wants to be called again.
250
249
*`FRAMETIME` is a predefined macro in WLED, typically set to ~16ms, corresponding to ~60 FPS (frames per second).
251
250
* Even though the effect logic itself controls when to update based on refresh_ms, WLED will still call this function at roughly FRAMETIME intervals to check whether an update is needed.
252
-
* ⚠️ Important: Because the actual frame logic is gated by strip.now - SEGENV.step, returning FRAMETIME here doesn’t cause excessive updates — it just keeps the engine responsive. Also note that an Effect should ALWAYS return FRAMETIME, and choosing a higher number can have negative side effects.
251
+
* ⚠️ Important: Because the actual frame logic is gated by strip.now - SEGENV.step, returning FRAMETIME here doesn’t cause excessive updates — it just keeps the engine responsive. **Also note that an Effect should ALWAYS return FRAMETIME. Not doing so can cause glitches.**
253
252
* The final bracket closes the `mode_diffusionfire()` function itself.
0 commit comments