Skip to content

Components

Valtteri Koskivuori edited this page May 30, 2018 · 2 revisions

This is a high-level overview of the different components of C-ray and what their purpose is.

In alphabetical order:

  • bbox - Bounding box data structures and logic. This is used for the k-d tree acceleration structure.
  • camera - Camera data structures and logic.
  • cJSON - 3rd party library for parsing JSON files.
  • color - Data structures and code for processing color information (C-ray uses 24-bit color)
  • converter - Code for converting the OBJ loader data structures to C-ray native ones.
  • errorhandler - Deprecated. Old way of handling errors in a central place.
  • filehandler - Code for reading/writing files and interacting with the PNG encoder.
  • includes - Central place for defining constants and including system libraries.
  • kdtree - Data structures and logic for creating k-d trees for 3D meshes. See Wikipedia
  • light - Data structure for lights. For now point lights with random distribution to emulate area lights.
  • lightRay - Data structure for light rays, including ray type information.
  • list - Used very sparingly at the moment, simple Cpp style vector implementation. Only used in kdtree
  • lodepng - 3rd party library for encoding PNG images
  • main - Main entry point. Prepares and manages threads and UI feedback.
  • material - Data structures for different material types.
  • obj_parser - 3rd party library that parses OBJ files. Will probably replace soon.
  • obj - C-ray native OBJ data structures.
  • poly - Data types for polygons, and logic for checking ray intersection with a polygon.
  • raytrace - Actual raytracing code (the math heavy part)
  • renderer - Manages render status, splits the render into tiles, and calls rayTrace functions in raytrace to get color information for a given pixel.
  • scene - JSON scene parsing.
  • sphere - Data structures for basic geometric spheres.
  • string_extra - extra string functions for some 3rd party library.
  • transforms - Matrix transform system for moving, rotating and scaling 3D meshes and other objects.
  • ui - Code that handles the SDL2 real-time render preview, SIGINT and keyboard input.
  • vector - Vector data types and operators.