Wallpaper Engine

Wallpaper Engine

Simple Audio Bars
Potential Off By One Error in Frag File
Hey, I don't know if other people have had this issue, but there is an off by one error in bottom placement. The low freq bar is all the way to the right (after the highest freqs). I have never coded a shader, but I guessed that there was a simple fix and opened up the shader files to tweak values. I changed line 143 to this.

uint barFreq1 = (frequency - 1) % RESOLUTION;

it seemed to fix it for me.
thanks again for making this, this shader stuff is black magic to me.
< >
Showing 1-3 of 3 comments
Psionic Titan 26 Jan, 2021 @ 1:21am 
Cctually, it didnt fix it. Hopefully you will have more of an idea why this is happening. thanks
Psionic Titan 26 Jan, 2021 @ 2:23am 
After some more messing around. I found a hacky workaround. This makes it line up a lot better at 16 freq resolution. line 140

// Get the frequency for this pixel float barDist = abs(((shapeCoord.x + 0.925) * g_BarCount % 1) * 2 - 1); float frequency = floor((shapeCoord.x + 0.925) * g_BarCount) / g_BarCount * RESOLUTION + 0.5; uint barFreq1 = frequency % RESOLUTION; uint barFreq2 = (barFreq1 + 1) % RESOLUTION;

I don't know why this magic number 0.925, but it works for 16 freq response, not quite lined up for other freq resolutions, but that could be done with an if statement or smething. thanks
OMGparticles  [developer] 28 Jan, 2021 @ 6:54pm 
I pushed a fix. I just removed the + 0.5 at the end of that frequency line, don't think it was necessary.

There will still be some bleed-through between low and high when you increase the number of bars beyond the frequency resolution since I interpolate between them to make the circle shapes look smooth. But if your bar count is low it shouldn't bleed anymore.

Thanks for noticing/reporting.
Last edited by OMGparticles; 28 Jan, 2021 @ 6:54pm
< >
Showing 1-3 of 3 comments
Per page: 1530 50