requirements for the 42 Singapore miniRT project
- Overview Article: Real-Time Ray Tracing Overview
- Video Series: NVIDIA’s Ray Tracing Essentials on YouTube
- Online Guidebook: Ray Tracing in One Weekend
- Project written in C, follows Norm.
- Create
Makefilewith these rules:all,clean,fclean,re,bonus. - Use only allowed functions:
open,close,read,write,printf,malloc,free,perror,strerror,exit. - Link
-lmformath.hand useMiniLibX. - Add
libftas subfolder and link properly.
The program must read and parse a .rt file with the following requirements:
-
.rtfile must be passed as a command-line argument. - Parse file ignoring blank lines and handling multiple spaces.
- Accept any order of elements.
- Only 1 of each: Ambient (A), Camera (C), Light (L).
- Validate ranges and format strictly.
-
Ambient light
A ratio R,G,B
e.g.A 0.2 255,255,255- Ratio [0.0, 1.0]
- RGB [0-255]
-
Camera
C x,y,z orientation FOV
e.g.C -50.0,0,20 0,0,1 70- FOV [0,180]
- Orientation vector normalized [-1.0, 1.0]
-
Light
L x,y,z brightness R,G,B
e.g.L -40,0,30 0.7 255,255,255- Brightness ratio [0.0, 1.0]
- Sphere
sp x,y,z diameter R,G,B - Plane
pl x,y,z normal R,G,B - Cylinder
cy x,y,z orientation diameter height R,G,B
- Error on invalid/missing values
- Error on duplicate A, C, L
- Error message:
Error\n+ clear explanation
- Implement ray casting engine
- Intersect functions:
- Sphere
- Plane
- Cylinder
- Compute:
- Ambient light
- Diffuse light
- Hard shadow
- Set up window with MiniLibX
- Draw rendered image
- Handle:
- ESC key to quit
- Red cross to quit
- Make sure app is responsive
- Exit cleanly on bad input
- Free all memory properly
- No memory leaks
- Handle null pointers, malloc fails
- Add
.rttest files toscenes/ - Test edge cases (e.g. zero FOV, bad RGB)
- Check performance/responsiveness
- Confirm Norm compliance
Only add these after the mandatory part is 100% working.
- Phong specular reflection
- Checkerboard pattern
- Colored multi-lights
- New shapes (cone, paraboloid)
- Bump mapping
- Textures or skybox
- Mouse/camera movement
miniRT/
├── src/
├── include/
├── scenes/
│ └── test_scene.rt
├── libft/
├── ft_gnl/
├── mlx/
├── Makefile
├── README.md