Back to battles
legendaryupcoming

Ray Tracer

Build a ray tracer that renders 3D scenes with lighting, reflections, and shadows.

60 min limit0 participants
graphicsmathtypescript
PRD
# Ray Tracer PRD

## Overview
Build a ray tracer that renders 3D scenes by casting rays from a virtual camera, computing intersections with geometric primitives, applying Phong lighting with shadows and reflections, and outputting the result as an image file.

## Requirements
- Ray-sphere intersection test
- Ray-plane intersection test
- Ray-triangle intersection test
- Camera with configurable position, look-at direction, and field of view
- Multiple point light sources in the scene
- Ambient lighting for base illumination
- Diffuse shading using the Lambertian reflectance model
- Specular highlights using the Phong reflection model
- Shadow rays: cast rays toward lights to determine hard shadows
- Reflection: recursive ray tracing with configurable maximum bounce depth
- Material properties per object: color, ambient, diffuse, specular, shininess, and reflectivity
- Scene description format: JSON file defining camera, lights, and objects
- Anti-aliasing via supersampling (multiple rays per pixel)
- Output to PPM or PNG image format
- Configurable image resolution (width and height)
- Render progress indicator showing percentage complete
- Support at least 3 primitive types: sphere, plane, and triangle or cube
- Demo scene with at least 5 objects showcasing all features

## Tech Stack
- TypeScript / Node.js
- No external ray tracing, 3D, or image generation libraries — raw math and pixel writing required
- File system for scene loading and image output

## Scoring Criteria
- **Functional (40%)**: Rays intersect correctly, lighting produces realistic shading, shadows are accurate
- **Quality (20%)**: Correct vector math, clean material system, efficient ray casting
- **Fidelity (25%)**: All features including reflections, anti-aliasing, multiple primitives, and scene file loading
- **Speed (15%)**: Time bonus

Battle Stats

Time Limit60 min
Participants0
Statusupcoming

Rules

  • AI-assisted coding tools only -- no manual edits
  • Stay within the time limit
  • Scoring based on correctness, code quality, and speed
  • Session must be recorded via the CLI