Skip to content

About

3D Vision Frustum Culling Debugger written from scratch in C++ and Raylib, compiled to WebAssembly

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

 

History

8 Commits

Folders and files

Repository files navigation

Vision Culling Debugger

An interactive 3D graphics showcase demonstrating real-time Frustum Culling mathematics, built from scratch with C++ and Raylib.

C++ Raylib Xmake

Watch the video

🎯 Overview

This project visualizes the "invisible" mathematics of 3D rendering. Instead of sending every object in a scene to the GPU, this engine mathematically extracts the 6 planes of the camera's View-Projection matrix and performs real-time intersection tests against Axis-Aligned Bounding Boxes (AABBs).

Objects outside the camera's vision are culled, optimizing rendering performance.

✨ Features

  • Real-Time Frustum Culling: Implements the positive/negative vertex trick for optimized AABB-to-Plane intersection testing.
  • Frustum Locking: Freeze the camera's projection matrix in world space to visually inspect the 3D culling pyramid.
  • Picture-in-Picture Minimap: A secondary top-down orthographic camera renders the scene layout and vision cone to an independent texture.
  • State Visualization: Color-coded rendering (Green = Inside, Yellow = Intersecting, Red = Culled).
  • Perspective Math Correction: Accurately visualizes clip-space bounds in world space using inverse matrices and the perspective divide (W).

🎮 Controls

Key/Input Action
W A S D Move Camera
Mouse Look Around
SPACE Lock/Unlock Frustum Wireframe

🚀 Getting Started

Prerequisites

You will need Xmake installed on your system to build the project. Xmake will automatically fetch Raylib for you.

Build and Run

  1. Clone the repository:

    git clone git@github.com:PauloRuan30/Frustum-Culling.git
    cd Frustum-Culling
  2. Curl the XMake, build it and run: (here the xmake quick start link if you need)

    curl -fsSL https://xmake.io/shget.text | bash
    xmake build
    xmake run

About

3D Vision Frustum Culling Debugger written from scratch in C++ and Raylib, compiled to WebAssembly

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages