Skip to content

catenacciA/renderer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Real-Time Renderer with Metal

A (timid) real-time 3D renderer written in C++ with GPU acceleration via Metal.

Project Structure

Detailed File Breakdown
├── build/
│   └── renderer             # Compiled binary
├── include/
│   ├── AppDelegate.hpp
│   ├── Math.hpp              # Utility functions for vector and matrix math  
│   ├── Mesh.hpp            # Represents 3D models and geometry data
│   ├── MyMTKViewDelegate.hpp
│   └── Renderer.hpp
├── src/
│   ├── AppDelegate.cpp     # Manages the application
│   ├── Main.cpp
│   ├── MyMTKViewDelegate.cpp # Custom delegate for the MetalKit view
│   ├── Renderer.cpp        # Main rendering logic
│   └── shader.metal         # Metal shading code
├── third-party/
│   ├── metal-cpp/           # Metal C++ bindings
│   └── metal-cpp-extensions/

Features

  • Real-Time 3D Rendering using Metal
  • Custom Vertex & Fragment Shaders for lighting and materials
  • Dynamic Point Lights with attenuation and time-based pulsing
  • Modular Codebase for easy extension and reuse

Shader Overview

The Metal shader (shader.metal) includes:

  • Vertex Shader
    • Transforms vertices into clip space
    • Calculates per-vertex world positions, normals, and colors
  • Fragment Shader
    • Computes lighting using:
      • Ambient, diffuse, and specular components
      • Distance-based attenuation
      • Time-based pulsing effects

Getting Started

Prerequisites

  • macOS with Xcode and Metal support
  • make, clang installed

Build Instructions

Run the following from the root directory:

make -j8

The output binary will be located at ./build/renderer.

Run the Renderer

./build/renderer

📄 License

This project is licensed under the terms outlined in the LICENSE file.

Acknowledgments

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors