Skip to content

42Proton/miniAB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

285 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

miniRT

Grade: 125

miniRT project is about creating a simple raytracer to produce a realistic render.
implement such raytracer required us to learn linear algebra and calculus to understand how to perform calculation in 3D space properly and learning to the usage of matrices to transform the point in different spaces like World Space, Object Space, Tangent Space and the process of implementing cartesian coordinates system and converting a point in it to different coordinate systems and the usage of vectors to apply transformations and the process to solve implict and parametric equations and the process of differentiation.
Our raytracer supports wide ranges of features:

  • Primitives: Support of multiple primitives with full control of their transformations and their properties.
  • Light Managment: The managment of multiple point lights from specific position, intensity and color.
  • Shadows: The support of hard shadows by checking if an object is covering a light source.
  • Scene Management: Support for providing a file with information of the scene to render.
  • Phong shading: The simulation of light reflection and the distribution of light with phong shading model based on the normal vector.
  • UV Mapping: An accurate support for texture mapping on primitives.
  • Bump Mapping: The support for perturbing the normal vectors of a surface to simulate the look of uneven surface.
  • Reflection: The support of reflective surface with recursive ray intersections.
  • Field of view (FOV): Implementation of fov to control the focal length of the camera.
  • Gamma Correction: Ability to control the gamma in the shader
  • HDR: Ability to represent colors in high dynamic range then converted to LDR with ACES approximation
  • Supersampling: The ability to represent colors in the scene more accuratly by shooting multiple rays for each pixel

How to use:

First compile the project by running make then run the miniRT executable with an scene provided as argument.

Scenes

Scenes are defined with .rt extension which contains all the objects to render including their properties, the following is the objects which can be added in the scene and their properties:

Ambient Light

ID Intensity Color
A Float RGB

Camera

ID Position Normal Vector FOV
C Vec3 Vec3 Int

Point Light

ID Position Intensity Color
L Vec3 Int RGB

Plane

ID Position Normal Vector Color
pl Vec3 Vec3 RGB

Sphere

ID Position Radius Color
sp Vec3 Float RGB

Cylinder

ID Position Normal Vector Diameter Height Color
cy Vec3 Vec3 Float Float RGB

Hyperboloid of one sheet

ID Position Scale Normal Vector Coefficients Color
hy Vec3 Vec3 Vec3 Vec3 RGB

Misc

All primitvies has miscellaneous properties which can be provided after the required properities which are the following:

ID Datatype Info
color: String Color map to apply
bump: String Bump map to apply
reflect: Float Applies reflect with provided intensity
phong: Vec3 Control the phong shader properties

Resources:

Testing Tools:

About

miniAB is a project aimed to build a simple ray tracer!

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors