LedFx / LedFx

LedFx is a network based LED effect engine designed to deliver advanced real-time audio effects to a wide variety of devices.
https://ledfx.app
GNU General Public License v3.0
1.3k stars 157 forks source link

Scan Multi with Mirror #1005

Open Andro-Marian opened 2 months ago

Andro-Marian commented 2 months ago

Describe the bug The effect is not ok when the mirror is activated. Have 117 leds.

To Reproduce Steps to reproduce the behavior:

  1. Add the Scan Multi effect to a light strip with 117 leds.

Expected behavior The mirror to consistent on both sides.

Screenshots firefox_PDHaBgsA50

LedFx Host Information (please complete the following information):

bigredfrog commented 2 months ago

Hmm unexpected

Thanks for the thorough issue details will scratch in due course.

First step will be attempt to reproduce.

Are other effects good for you with mirror? It should be an independent layer of behavior, but maybe I have an odd / even dependency in there.

bigredfrog commented 2 months ago

Basic sanity looks good, now looking to reproduce your specific led count etc

bigredfrog commented 2 months ago

Cannot reproduce, this is a dummy device with 117 leds, switching between mirror and no mirror in scan multi effect.

Can you please screen shot your full effect configuration and / or share your config.json from .ledfx directory

Will add "working" capture momentarily

multiscan

bigredfrog commented 2 months ago

If you watch your actual led strip does it look more sane?

If you share you config by screen shot or file, I suspect you have a 1 scan width and what you are then seeing is just aliasing of the render into the browser pane simulation, which is not necessarily going to look correct when handling single pixel width inputs.

Try hitting reset, then mirror, does it look sane then?

Andro-Marian commented 2 months ago

The strip looks like the preview one. Any way to disable that Anti-Aliasing, not sure why is the on the first place? You can change the width to 10 too. But I noticed that weird flicker because the leds are turning on and off like the Width 1.

image

bigredfrog commented 1 month ago

Noting I said aliasing. Not anti aliasing. Whenever you map from one resolution to another. Aliasing occurs and may or may not have artifacts.

For very low scan width, I am not surprised with a odd number strip length, as the layout of left and right for the way mirror works Will not be equal. The effect is rendered to a full strip, and then a nother layer post processes tbe mirror.

One side has an extra pixel. Therefore in scenarios with high detail will have artifacts. They just don't alias the same.

I will look at the width 10 and see if there is something else going on, but right now this looks like a limit of render against odd strips. I also need to check if even is different or similar for reasons.

bigredfrog commented 1 month ago

noting your comment of

"You can change the width to 10 too. But I noticed that weird flicker because the leds are turning on and off like the Width 1."

bigredfrog commented 1 month ago

Noting your comment of

"You can change the width to 10 too. But I noticed that weird flicker because the leds are turning on and off like the Width 1."

Then I set to 10 on a 117 strip with mirror, it looks fine as below, are you seeing something else?

multiscan10

Andro-Marian commented 1 month ago

Would be good if the middle led to be considered the center one. Should be not on left or right.

bigredfrog commented 1 month ago

The artifacting / flashing is also present in the 118 even strip case, but it is aliasing of the render where there are single pixels that may or may not get rendered. If I slide scan width to 2 which is just a percentage of physical pixels, then it becomes stable which also lines up with expectation.

This is just the limit of the configuration against a relatively short strip. I don't want to remove the option as larger strips take advantage. See how in this capture of a 117 vs 118 vs a 401 pixel strip, all

with same configuration, the 401 looks fine.

multiscanX

Andro-Marian commented 1 month ago

Still in 401 is not perfect. Has some light intensity differences and some leds are off on left when on right is on. I see the green one.

Not sure how would be in reality. I will try when I arrive home with 500 leds strip.

bigredfrog commented 1 month ago

This is the extreme of a slider option and expression of following layers that give high reusability. Its all trade offs. Be aware that what renders in the browser is its own down sampling, compared to what renders in memory for update to the strip.

bigredfrog commented 1 month ago

Noting you will likely see this aliasing issue on any effect if you get down to single pixels as consistent objects through time. All effects render into device virtual resolution, so 1 to 1, then mirror and other tweaks work on top, so any single pixel is at risk of getting mangled. I went looking to see if I had a specific bug in multi scan, but I see this as just edge of the envelope performance at a generic level and a reasonable cost for having access to sliders against unconstrained physicals. Rather than locking everything down to guaranteed working as desired.

Andro-Marian commented 2 weeks ago

Still with 6 leds on the device, the mirror is not really a mirror. Look more like just cutting the strip in half and make different animation for both.