How alicebaghunts/raytracer-minirt works
miniRT is a C ray tracer that turns a .rt scene into an interactive rendered image. The principal workflow is scene-file loading, validation, scene-object construction and normalization, then camera-ray generation, primitive intersection, shading and pixel display. Rendering is split across threads; documented surface features include checkerboards and bump/texture mapping. The main entry point also wires mouse and keyboard actions, including camera switching and object render-mode selection. README capabilities are retained, but links involving unsampled implementations are limited to documented behavior and visible subsystem paths.
Main entry points: main.c Application entry · intersect.c Pixel rendering · initialization.c Scene construction · thread.c Thread workers
Components 21
Scene setup
- Scene file input
source/validation/utils/file_handler.c - Scene validation
source/validation/validation.c - Scene construction
source/initialization/initialization.c - Object initialization
source/initialization/objects/init_cylinder.c - Vector normalization
source/initialization/utils/normalize.c - Texture loading
source/initialization/utils/init_texture.c - Scene state
includes/object_types.h
Ray rendering
- Render coordinator
source/ray_tracing/drawing/drawing.c - Thread workers
source/ray_tracing/thread/thread.c - Pixel rendering
source/ray_tracing/drawing/intersect.c - Camera ray math
source/formulas/formulas.c - Primitive intersections
source/formulas/formulas.c - Lighting and shadows
source/ray_tracing/shade/shade.c
Surface effects
- Checker patterns
source/ray_tracing/checkerboard/plane_checkerboard.c - Bump and texture
source/ray_tracing/bump/bump.c
Display and interaction
- Application entry
source/main.c - Image buffer
includes/rendering.h - Input and selection
source/main.c
Other components
- User
- RT scene
- miniLibX
Connections 24
- User → RT scene: provides
- RT scene → Scene file input: read
- Application entry → Scene file input: loads scene
- Application entry → Scene validation: validates
- Application entry → Scene construction: constructs
- Application entry → Vector normalization: normalizes
- Scene construction → Object initialization: dispatches objects
- Scene construction → Scene state: populates
- Application entry → Texture loading: loads textures
- Application entry → Render coordinator: starts rendering
- Render coordinator → Thread workers: starts workers
- Thread workers → Pixel rendering: renders pixels
- Pixel rendering → Camera ray math: computes rays
- Pixel rendering → Primitive intersections: finds hits
- Pixel rendering → Lighting and shadows: shades hits
- Lighting and shadows → Checker patterns: applies patterns
- Lighting and shadows → Bump and texture: perturbs surfaces
- Thread workers → Image buffer: writes pixels
- Application entry → miniLibX: creates window
- Image buffer → miniLibX: displays image
- User → Input and selection: sends input
- Input and selection → Application entry: invokes hooks
- Input and selection → Scene state: updates selection
- Application entry → miniLibX: runs event loop