A retro-styled video player featuring Bad Sandwich shadow art video with real-time old camera effects including chromatic aberration, noise, and lens distortion.
This project plays the "Bad Sandwich!!" video with a vintage camera shader effect. The video data and audio are embedded directly into the executable, making it a self-contained application.
- Full video playback of Bad Sandwich!! with synchronized audio
- Old camera shader effects:
- Chromatic aberration (RGB channel offset)
- Dynamic noise pattern
- Screen distortion (lens warp)
- Vignette frame effect
- Horizontal scanline interference
- Smooth logo intro with fade in/out animation
- Real-time frame synchronization with audio position
- Optimized rendering using render textures and GPU shaders
- ESC or close window - Exit the application
- Free Pascal / Object Pascal
- Raylib 5.5 - Graphics and audio library
- ray4laz - Pascal binding for Raylib
- OpenGL Shading Language (GLSL) - Fragment shader for visual effects
- Embedded compressed video data (ZIP compression)
- Audio streaming from embedded MP3 data
- Frame-accurate video sync using audio playback position
- GPU-accelerated shader effects
- Resolution: Original frame dimensions (embedded in data)
- Format: 1-bit per pixel (black/white)
- Frames: 30 FPS playback
Note: The unit is named
BadAppleDataPack.pasfor historical reasons, but the content is Bad Sandwich!! video.
- Free Pascal Compiler (FPC) 3.2.0 or higher
- Lazarus IDE (recommended) or FPC command line
- ray4laz - Pascal binding for Raylib 5.5
- Open Lazarus IDE
- Navigate to Package → Online Package Manager
- Search for
ray4laz - Click Install and rebuild the IDE
git clone https://github.com/GuvaCode/ray4laz.gitThen add the source path to your project or compiler options.
- Open the project in Lazarus IDE
- Ensure ray4laz package is installed (see installation above)
- Press Ctrl+F9 or go to Run → Build
fpc -MOBJFPC badsandwich.lpr -Fu"path/to/ray4laz/source"The old camera effect is achieved through a custom GLSL fragment shader that applies:
| Effect | Description |
|---|---|
| Chromatic Aberration | RGB channels are offset slightly |
| Film Noise | Dynamic random grain overlay |
| Lens Distortion | Barrel distortion effect |
| Vignette | Darkened edges mimicking old lenses |
| Scanlines | Horizontal interference patterns |
- ray4laz GitHub Repository - Main binding repository
- Ray4Laz Examples - 180+ code examples
- Raylib Official Website - Documentation and references
- The video data is compressed using ZLib and decompressed at runtime
- Audio is streamed directly from memory (no temporary files)
- The shader runs in real-time on the GPU
- Logo intro duration: ~5.5 seconds total (0.5s fade in, 4s display, 1s fade out)
This project uses the "Bad Sandwich!!" video and audio content. All rights to the original content belong to their respective owners. The code implementation is provided for educational purposes.
- Original "Bad Sandwich!!" content
- Raylib by Ramon Santamaria
- ray4laz by GuvaCode - Pascal bindings for Raylib