summaryrefslogtreecommitdiff
path: root/src/main.cc
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-01-28 10:26:12 +0100
committerskal <pascal.massimino@gmail.com>2026-01-28 10:26:12 +0100
commitf12b5ebc74825817df54677e261b92200bfac84a (patch)
tree29c1c938b3aabac5a3825e09d6af7c6db3afe570 /src/main.cc
parent68015c1e326f78afa0637b99a9e3f755086f557e (diff)
feat(visuals): Enhance colors and add background flashes
Improves the audio-visual synchronization by increasing peak amplification and adding dynamic background flashes. - src/gpu/gpu.cc: Updated fragment shader with more vibrant hue calculation and implemented reactive clear color for flashes. - src/main.cc: Increased peak multiplier to 150x and added non-linear boost for strong peaks.
Diffstat (limited to 'src/main.cc')
-rw-r--r--src/main.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/main.cc b/src/main.cc
index f612868..d564de0 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -133,8 +133,14 @@ int main(int argc, char **argv) {
glfwGetFramebufferSize(platform_get_window(), &width, &height);
float aspect_ratio = (float)width / (float)height;
- float visual_peak = fminf(synth_get_output_peak() * 80.0f, 1.0f);
- gpu_draw(visual_peak, aspect_ratio);
+ // Stronger amplification for visuals
+ float raw_peak = synth_get_output_peak();
+ float visual_peak = raw_peak * 150.0f;
+
+ // Add a non-linear boost for loud peaks to make flashes pop
+ if (visual_peak > 0.5f) visual_peak += (visual_peak - 0.5f) * 0.5f;
+
+ gpu_draw(fminf(visual_peak, 1.0f), aspect_ratio);
audio_update();
}