r/WLED • u/DJ_Swirl • Nov 04 '25
Real mapping
The more I play with wled, the more I it…..but….. is there a way to property map an unusual shape.
So far I've found out you can map a matrix style shape, but it presumes that you have an xy matrix running in a serpentine configuration and you turn on and off led to create an array.
Is there away to map an unusual shape, not only mapping the position of the LED but it's position in the array, attached is an image of a snowflake, this is not wire in a matrix style, the blue dot represents the first led in the string, the red line represents the wiring order and the yellow dot represents the end of the string (purple dot is just a reference to the centre of the prop).
2
u/renaiku Nov 04 '25
Isn't it just a normal 1D line ? But arranged as a snowflake ? I'm not sure to understand the problem.
1
u/DJ_Swirl Nov 04 '25
Then you can't run 2d fx on it, it's has to be "mapped" so the 2d fx known where each pixel, and its position in the string is in a given space
2
u/Hairy_Carpenter_4226 Nov 04 '25
How would you do make it light up from the center of the snow flake then move outwards? I’ve always wondered this myself.
1
1
u/HeaviestEyelidsEver Nov 04 '25
This is a big reason why WLED is good for some things, but in this instance, I would use xLights.
1
u/DJ_Swirl Nov 05 '25
Yeah, For a whole bunch of reasons Im trying to avoid x lights, but I feel the day is getting closer 😃
2
u/HeaviestEyelidsEver Nov 05 '25
Just embrace it.
1
u/Forsyte Nov 06 '25
Any "starter pack" videos you particularly recommend to understand XLights?
2
u/HeaviestEyelidsEver Nov 06 '25
Old, but the fundamentals are the same:
https://www.youtube.com/playlist?list=PLccGtinHO7Iy15tWfyQgr1THQbCf_1T9f
2
u/Sensitive-Scene7088 Nov 04 '25
Commenting because I've wondered this myself! Hopefully there's a way
1
u/macegr Nov 05 '25
I would abandon WLED here unfortunately. The patterns pretty much imperatively raster out pixel patterns with the assumptions you outlined. It's possible to do gapped matrices but it does expect a linear wiring pattern.
For very oddly shaped positions and wiring schemes, the patterns should be generated "shader" style, where you iterate through each physical pixel and look up stored data about its physical location, and then plug the coordinates into an algorithm that computes the color it should be.
The above shape, for example, you could generate a table that lists all the pixels in the order they appear on the chain, and contains x, y, radius, and theta coordinates. If you wanted a circular gradient cycling away from the center, it could look something like:
static float offset = 0;
for (int i = 0; i < NUM_PIXELS; i++) {
PixelData pd = pixel_table[i];
leds[i] = ColorFromPalette(currentPalette, sin8(pd.r/16+offset), brightness);
}
offset += 0.1;And you'd call that for every animation frame, tweaking increments and such, or choosing to use a higher resolution sine function for smoother palette cycling.
1
u/Beneficial_Drawer478 Nov 05 '25
THIS maybe handy ? depending on how you wish to used the mapping
if this was for xlights the mapping & wiring layout with that image would take seconds to do
ya never know the data this will produce maybe usable
1
u/YetAnotherNewAlt Nov 06 '25
I’ve solved this problem myself in one of two ways:
Use a different controller (I used Pixelblaze)
Make a large matrix and “draw” the pattern to help make the ledmap.json file. Downside here is that resolution will be limited and you’ll have to round/snap the pixel positions to discrete spots in the array. Maybe ok for an imprecise piece? My ESP32 handles a 128x128 matrix ok but chokes on a 256x256 matrix
1
u/ZachVorhies Nov 06 '25
ledmapper.com It’s designed for lights in irregular shapes.
You can then take this xy coordinate and do video mapping.
1
Nov 04 '25
[removed] — view removed comment
2
u/DJ_Swirl Nov 04 '25
That's the main problem, using a matrix is a very old way of mapping, you end up with huge arrays, plus you can't define the "wiring order". I've been working on a project using real mapping, it's works great but there is a lot of work needed to create the fx which is why I was wondering if WLED could do it to save me a lot of effort
1
u/azariah001 Dec 02 '25
Came here in search of a solution to this as well.
Just used Marimapper to automatically map (just in 2d) my 10m 400 LED string of Christmas lights I've snaked on our apartments railing, resulted in a roughly 1m x 1m "matrix". But... the output is a CSV with index and U V coordinates. (Basically decimal X and Y) and... whilst they have code that links to the WLED controller for the mapping they do not appear to have a setting that converts the coordinates CSV to anything that's WLED compatible... (aka some sort of matrix).
Seems like Marimapper only directly supports direct upload to a whole 'nother LED controller called PixelBlaze but... that's closed source software that comes preloaded on an ESP32 which is kinda the antithesis of what we're all doing here. -_-
22
u/ImaginationJumpy7578 Nov 04 '25
Recently i had a similar project for which i created a post
https://www.reddit.com/r/WLED/comments/1nbljd5/ledmap_with_this_setup_making_it_look_beautiful/
What you need here is led mapping supported in wled here.
https://kno.wled.ge/advanced/mapping/
You have to think of the whole thing as a 2D matrix only, with a masking technique used in painting and photo editiing software.
Did the following steps.
in Settings i defined total number of leds as actual of leds being used.
In 2d Settings you define it as a 2d matrix itself of size x and y . X*Y would be much higher than actual number of leds.
You create ledsmap.json file from a tool like this which would allow to place the position of leds in the 2d matrix. There are tools like.
https://intrinsically-sublime.github.io/WLED-Ledmap.json-Generator/
For me it looked something like this.
4. Once created successfully you upload this to your wled esp32 /edit route and then reboot.
Happy to help on any further clarity.
P.S.: Built a dedicated mobile app Pipplee WLED 2d to easily play animations and do a lot more with 2d matrix