In Episode 7 of the Snake Rewind devlog we step into post processing territory and bring our retro grid to life with a glowing bloom shader. Based on LearnOpenGL’s bloom effect tutorial, we implement a multi pass blur system that highlights bright pixels and makes every move feel just a bit more cinematic.
What We Covered
- Implemented a multi pass bloom/glow shader:
- Brightness threshold
- Horizontal blur
- Vertical blur
- Applied additive blending to layer the glow over the original scene
- Used flipped source rectangles to correct Y-axis rendering (Raylib/OpenGL quirk)
- Tuned glow strength with opacity and blur spread
With this effect in place Snake Rewind now looks like an arcade game in a neon dream and the groundwork is laid for more shader polish to come.
Design Insights
- Raylib’s render textures are vertically flipped by default: fix with
src.height = -HEIGHT - Threshold pass helps isolate which pixels should glow (based on luminance)
- Separable Gaussian blur (horizontal + vertical) is performant and visually clean
- Applying Gaussian blur multiple times gives a more defined and spread blur
Implementation Highlights
- Custom
threshold.glslandblur.glslshaders in GLSL 330 - Multiple
RenderTexture2Dbuffers:target,tmpA,tmpBandblurred - Ping pong render strategy to apply blur passes cleanly
Why This Matters
Visuals matter and even a simple game like Snake gains impact and atmosphere when it glows in the right places. Our glow shader sets the tone for future effects like scanlines and chromasep.
External Resources
- LearnOpenGL.com: Bloom - our main source for implemetation of bloom/glow shader
What’s Next?
In Episode 8 we’ll dial in the retro feel even further with animated scanlines giving our game the look of a vintage CRT arcade screen.