Skip to content

tdameros/42-miniRT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MiniRT

MiniRT is a C-based mini raytracer that utilizes a minimal graphics library.

A raytracer is a computer graphics technique used to create highly realistic images by simulating the behavior of light in a virtual 3D environment. In ray tracing, the fundamental concept revolves around tracing the path of light rays as they interact with objects and surfaces within a scene.

📸 Renders

Some renders
Integrated post-processing effects
Interactive interface
Bounding Volume Hierarchy Debugger

🔨 Build

⚠️ Needs mlx prerequisites

make -j
./miniRT *.rt

Run default scene

make run

Run all renders

make render

🚀 Features

  • Basic Geometric Shapes:
    • Sphere
    • Cylinder
    • Cone
    • Plane
  • Interactive GUI with Object Manipulation
  • Font Rendering from scratch using .ttf files
  • Dynamic Camera Control with 3 Axes and Field of View (FOV)
  • Multiple Colored Light Management
  • Texture Mapping:
    • .ppm files
    • Checkerboard
    • Normal Maps for relief
  • Full Phong Lighting Model
  • Post-Production Effects:
    • Black & White
    • Color Inversion
  • Integrated Screenshot Export
  • 3D Mesh Import (.obj)
  • Bounding Volume Hierarchy (BVH)
  • Bilinear Interpolation for Resolution Adaptation while Maintaining 30 FPS
  • Anti-Aliasing for Smooth Rendering
  • Multi-Threading Support

🕹️ Controls

  • W - Move the camera forward
  • A - Move the camera left
  • S - Move the camera backward
  • D - Move the camera right
  • Q - Camera peaking left
  • E - Camera peaking right
  • Right Mouse Button - Switch between camera and GUI mode
  • Mouse Movement [GUI Mode] - Move object
  • Mouse Movement [Camera Mode] - Adjust camera view direction
  • Mouse Scroll [GUI Mode] - Increase or decrease value
  • Spacebar - Move the camera up
  • Shift - Move the camera down
  • H - Hide the GUI
  • B - Switch to the next post-processing effect
  • T - Take screenshot
  • R - Enable BVH debugger
  • DELETE - Deselect object
  • COMMAND + S [MacOS] - Save current scene
  • CTRL + S [Linux] - Save current scene
  • Esc - Exit the program

📚 Resources

📝 Authors