PlummersSoftwareLLC / NightDriverStrip

NightDriver client for ESP32
https://plummerssoftwarellc.github.io/NightDriverStrip/
GNU General Public License v3.0
1.29k stars 210 forks source link

Smoke effect not working correctly on 64x64 Hub75 matrix. #534

Open mikejohnau opened 8 months ago

mikejohnau commented 8 months ago

I have a 64x64 Hub75 matrix hardwired to an ESP32-Wrover dev board. Most effects seem to work fine, Audiograph, Metaballs, Fireplace, SuperNova and Pnog Clock all work. The some effect appears to run but the frame is fractured and large diagonal lines appear accross the frame.

Sample video is at https://user-images.githubusercontent.com/26905608/284036081-3890110a-ef98-4420-9a42-e43d738cc517.mov

Bug report

64x64 Hub75 matrix not displaying Smoke effect correctly

Problem 64x64 Hub75 matrix not displaying Smoke effect correctly. I have tried different Matrix_Tye settings none have had any effect.

Steps

  1. Connect 64x64 Hub matrix
  2. Load Smoke effect.
robertlipe commented 8 months ago

Timely. In antoher window, I'd just stumbled across https://github.com/pixelmatix/SmartMatrix/issues/81 which makes a similar conclusion about the noise fill and noise traversal not actually matching as I made in earlier discussion https://github.com/PlummersSoftwareLLC/NightDriverStrip/discussions/526#discussioncomment-7609531 to someone about https://github.com/PlummersSoftwareLLC/NightDriverStrip/issues/486 and https://github.com/PlummersSoftwareLLC/NightDriverStrip/pull/525

I don't like the diagonal wipe, but the alternative we agreed was better was silently shouted down. I think the fundamental problem on the negative space is the fill and the traversal sizes not matching. It was the SetNoise inside the loop with the hardcoded constants (that I didn't at all understand) that was causing the black bars before.

As I wrote before, I wonder if rolling that file back to the original noise system makes it better or worse. Can you try that? I don't think you even have to roll back the whole project; just that file should do it, I think.

I'll admit I've seen videos of this author coding his effects on YouTube and I don't at all understand where his numerology is grounded. He's clearly not making up numbers, but he doesn't explain it in a way I understand it. My only discovery was that fillNoise and the code traversing it didn't match the sizes. It's likely that doubling the pixel space makes that worse and a root cause needs to be found.

mikejohnau commented 8 months ago

Going back to the previous build 9e1bf8f

Appears better. The panel now seems divided into quarters that float up and down and generally move around the screen. The wipers are also less slightly visible. I did have to remove the g()->Clear() line after the EVERY_N_MILLISECONDS line. With that in place I could only see the wipers.

latest video..

https://github.com/PlummersSoftwareLLC/NightDriverStrip/assets/26905608/a13e237e-4a7f-4b1b-afb0-f8ea2c5bf065

Just looking at the code and your comments above. Are we actually touching the smartmatrix include with this effect? It looks to my untrained eyes that this is all GFXbase.

Last part of code for reference.

EVERY_N_MILLISECONDS(100)
{
 // g()->Clear();
  g()->SetNoise(1000, 1000, 1000, 4000, 4000);
  // (orig) "speed of movement through the noise array"
  // Calling SetNoise() in here will index past what was
  // FillGetNoised, which returns slowly scrolling bars
  // of black along X and Y axes.
  g()->FillGetNoise();
}

// Lower number for thicker, more static fog. Higher for more wisp.
g()->MoveFractionalNoiseX(3);
g()->MoveFractionalNoiseY(3);

// Without this, we get tornadoes where the diagonals cross as there's
// an excess of set pixels there.
g()->BlurFrame(20);

}

robertlipe commented 8 months ago

That's what that CL does. It replaces its own code using noise32_[xyz] managed with inoise16* with the stuff in gfxbase. e.g, swapping

noise32_x[0] += 1000; // 1000;
    noise32_y[0] += 1000; // 1000;
    noise32_z[0] += 1000; // 1000;
    scale32_x[0] = 4000;
    scale32_y[0] = 4000;

with g()->SetNoise(1000, 1000, 1000, 4000, 4000);

I don't understand the noise stuff well enough to comment much further. It's all, well, noise to me.

On Tue, Nov 21, 2023 at 8:54 PM mikejohnau @.***> wrote:

Going back to the previous build 9e1bf8f https://github.com/PlummersSoftwareLLC/NightDriverStrip/commit/9e1bf8fa428a7945858fe48f60d3aeef0cc5357d

Appears better. The panel now seems divided into quarters that float up and down and generally move around the screen. The wipers are also less slightly visible. I did have to remove the g()->Clear() line after the EVERY_N_MILLISECONDS line. With that in place I could only see the wipers.

latest video..

https://github.com/PlummersSoftwareLLC/NightDriverStrip/assets/26905608/a13e237e-4a7f-4b1b-afb0-f8ea2c5bf065

Just looking at the code and your comments above. Are we actually touching the smartmatrix include with this effect? It looks to my untrained eyes that this is all GFXbase.

Last part of code for reference.

EVERY_N_MILLISECONDS(100) { // g()->Clear(); g()->SetNoise(1000, 1000, 1000, 4000, 4000); // (orig) "speed of movement through the noise array" // Calling SetNoise() in here will index past what was // FillGetNoised, which returns slowly scrolling bars // of black along X and Y axes. g()->FillGetNoise(); }

// Lower number for thicker, more static fog. Higher for more wisp. g()->MoveFractionalNoiseX(3); g()->MoveFractionalNoiseY(3);

// Without this, we get tornadoes where the diagonals cross as there's // an excess of set pixels there. g()->BlurFrame(20);

}

— Reply to this email directly, view it on GitHub https://github.com/PlummersSoftwareLLC/NightDriverStrip/issues/534#issuecomment-1821966954, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCSD364555D3Q3KZYNE43TYFVLPFAVCNFSM6AAAAAA7UCIVOCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMRRHE3DMOJVGQ . You are receiving this because you commented.Message ID: @.***>