Skip to content

GuvaCode/BadSandwich

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bad Sandwich!! - Old Camera Effect Player

A retro-styled video player featuring Bad Sandwich shadow art video with real-time old camera effects including chromatic aberration, noise, and lens distortion.

🎬 Overview

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.

✨ Features

  • 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

🎮 Controls

  • ESC or close window - Exit the application

🛠️ Technical Details

Built With

  • 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

Architecture

  • Embedded compressed video data (ZIP compression)
  • Audio streaming from embedded MP3 data
  • Frame-accurate video sync using audio playback position
  • GPU-accelerated shader effects

Video Format

  • Resolution: Original frame dimensions (embedded in data)
  • Format: 1-bit per pixel (black/white)
  • Frames: 30 FPS playback

Note: The unit is named BadAppleDataPack.pas for historical reasons, but the content is Bad Sandwich!! video.

🚀 Building with ray4laz

Prerequisites

  • Free Pascal Compiler (FPC) 3.2.0 or higher
  • Lazarus IDE (recommended) or FPC command line
  • ray4laz - Pascal binding for Raylib 5.5

Installation

Option 1: Using Lazarus Online Package Manager (OPM)

  1. Open Lazarus IDE
  2. Navigate to PackageOnline Package Manager
  3. Search for ray4laz
  4. Click Install and rebuild the IDE

Option 2: Manual Installation

git clone https://github.com/GuvaCode/ray4laz.git

Then add the source path to your project or compiler options.

Compilation

Using Lazarus IDE

  1. Open the project in Lazarus IDE
  2. Ensure ray4laz package is installed (see installation above)
  3. Press Ctrl+F9 or go to RunBuild

Using FPC Command Line

fpc -MOBJFPC badsandwich.lpr -Fu"path/to/ray4laz/source"

🎨 Shader Details

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

📚 Learning Resources

📝 Notes

  • 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)

📄 License

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.

🙏 Credits

  • Original "Bad Sandwich!!" content
  • Raylib by Ramon Santamaria
  • ray4laz by GuvaCode - Pascal bindings for Raylib

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages