From 4acd36124ea01c64932ae6cde438f4c56b5dbbd6 Mon Sep 17 00:00:00 2001 From: ygor_sena Date: Thu, 22 Jun 2023 16:06:29 -0300 Subject: [PATCH] docs(Doxygen): update miniRT docs to v3 --- documentation/html/annotated_dup.js | 6 +++--- ...home_ygorgsena_42_CURSUS_42_miniRT_README.html | 15 ++++++++------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/documentation/html/annotated_dup.js b/documentation/html/annotated_dup.js index f741be3..741acab 100644 --- a/documentation/html/annotated_dup.js +++ b/documentation/html/annotated_dup.js @@ -6,7 +6,7 @@ var annotated_dup = [ "πŸ“œ Requirements", "md__home_ygorgsena_42_CURSUS_42_miniRT_README.html#autotoc_md7", null ], [ "πŸ“ˆ About how we implemented the project", "md__home_ygorgsena_42_CURSUS_42_miniRT_README.html#autotoc_md8", null ], [ "πŸš€ Optimizations", "md__home_ygorgsena_42_CURSUS_42_miniRT_README.html#autotoc_md9", [ - [ "Memory Pool for Intersection Storage", "md__home_ygorgsena_42_CURSUS_42_miniRT_README.html#autotoc_md10", [ + [ "1) Memory Pool for Intersection Storage", "md__home_ygorgsena_42_CURSUS_42_miniRT_README.html#autotoc_md10", [ [ "1) Copy this repository to your local workstation", "md__home_ygorgsena_42_CURSUS_42_miniRT_README.html#autotoc_md2", null ], [ "2) Install the required libraries to run the project and the unit tests", "md__home_ygorgsena_42_CURSUS_42_miniRT_README.html#autotoc_md3", null ], [ "3) Compile the project with Makefile", "md__home_ygorgsena_42_CURSUS_42_miniRT_README.html#autotoc_md4", null ], @@ -15,13 +15,13 @@ var annotated_dup = [ "Solution", "md__home_ygorgsena_42_CURSUS_42_miniRT_README.html#autotoc_md12", null ], [ "Result", "md__home_ygorgsena_42_CURSUS_42_miniRT_README.html#autotoc_md13", null ] ] ], - [ "Matrix Cache for Object Transformations", "md__home_ygorgsena_42_CURSUS_42_miniRT_README.html#autotoc_md14", [ + [ "2) Matrix Cache for Object Transformations", "md__home_ygorgsena_42_CURSUS_42_miniRT_README.html#autotoc_md14", [ [ "Problem", "md__home_ygorgsena_42_CURSUS_42_miniRT_README.html#autotoc_md15", null ], [ "Solution", "md__home_ygorgsena_42_CURSUS_42_miniRT_README.html#autotoc_md16", null ], [ "Result", "md__home_ygorgsena_42_CURSUS_42_miniRT_README.html#autotoc_md17", null ] ] ] ] ], - [ "πŸ“– References:", "md__home_ygorgsena_42_CURSUS_42_miniRT_README.html#autotoc_md18", null ], + [ "πŸ“– References", "md__home_ygorgsena_42_CURSUS_42_miniRT_README.html#autotoc_md18", null ], [ "πŸ«‚ Acknowledgements", "md__home_ygorgsena_42_CURSUS_42_miniRT_README.html#autotoc_md19", null ], [ "s_camera", "structs__camera.html", "structs__camera" ], [ "s_canvas", "structs__canvas.html", "structs__canvas" ], diff --git a/documentation/html/md__home_ygorgsena_42_CURSUS_42_miniRT_README.html b/documentation/html/md__home_ygorgsena_42_CURSUS_42_miniRT_README.html index a91979a..5f86ef7 100644 --- a/documentation/html/md__home_ygorgsena_42_CURSUS_42_miniRT_README.html +++ b/documentation/html/md__home_ygorgsena_42_CURSUS_42_miniRT_README.html @@ -104,6 +104,7 @@

πŸ“£ Introduction

The 11th project of 42's curriculum is an introduction to the beautiful world of Raytracing and it asks students to render simple Computer-Generated-Images so that they will never be afraid of implementing mathematical formulas again. This project makes possible to create scenes such as the one below, an image of our beautiful pale blue bot called Earth.

🚨🚨 The detailed Doxygen documentation of this project can be read here. 🚨🚨

+

The aforementioned Doxygen documentation of this project was created with love and care. We hope that it can be a great asset to assist the 42 students currently working on this project. If you have any doubts, feel free to reach out to us!

βš’οΈ How to compile and run the project

@@ -122,8 +123,8 @@

If you want to run the scenes we've used to defend the project, it's possible to use any file between img00.rt and img19.rt located inside the folder images. For example:

./miniRT images/img18.rt

-βš™οΈ How to configure a .rt file to render an image

-

Every line will have an <id>, an <object_type> and one or more corresponding <parameters> to the given object type, in this order. The following table sums up how to build and render images and provides usage examples.

+βš™οΈ How to configure a <tt>.rt</tt> file to render an image +

Every line will have an <id>, an <object_type> and one or more corresponding <parameters> to the given object type, in this order. The following table sums up how to build and render images and it also provides usage examples.

@@ -176,7 +177,7 @@

ID Object type Parameter (arguments) Usage example
RGB color (red, green, blue)(0-255) 122,23,230
-

If the user wants to create a blue (0,0,255) light source (L) located at -10,10-10 with maximum brightness (1), the configuration as follows:

L -10,10,-10 1 0,0,255
+

If the user wants to create a blue (0,0,255) light source (L) located at -10,10-10 with maximum brightness (1), the configuration is as follows:

L -10,10,-10 1 0,0,255

‼️Important notes: after the mandatory parameters above, it's possible to pass some extra parameters to any given shape (sphere, cylinder, cone or plane) so that it can have a checkerboard pattern or a bumpmap applied to its surface. To assign a checkerboard pattern to a given shape, the extra parameters are:

@@ -195,7 +196,7 @@

For instance, to render a sphere with the same configurations and a bumpmap applied to its surface instead, the setting is:

sp 1.5,0.5,-0.5 1 255,255,255 bumpmap textures/earth.xpm

πŸ“œ Requirements

-

miniRT +

miniRT

πŸ“ˆ About how we implemented the project

To develop this project, we closely followed the book The Ray Tracer Challenge: a test-driven guide to your first 3D Renderer. The unit tests were created using Criterion, a dead-simple, yet extensible, C and C++ unit testing framework. Lastly, to generate an automated documentation we used Doxygen, which is the de facto standard tool for generating documentation from annotated C sources and many other languages.

@@ -227,7 +228,7 @@

πŸš€ Optimizations

The program underwent several optimizations to improve performance and efficiency. Two of these optimizations include:

-Memory Pool for Intersection Storage

+1) Memory Pool for Intersection Storage

Problem

Previously, the linked list of ray intersections with objects was dynamically allocated using malloc and freed with free when no longer needed. This approach resulted in repeated system calls, negatively impacting the program's performance.

@@ -238,7 +239,7 @@

Result

This optimization significantly reduced the time spent on memory allocation and deallocation. In a test using a standard image containing a sphere, ambient light, and a focal point light, the intersection recording was called an average of 149,000 times. Prior to the optimization, each call resulted in a malloc and free call for each node, negatively impacting the program's performance. With the implementation of the memory pool, the malloc and free calls were eliminated, resulting in a significant performance improvement.

-Matrix Cache for Object Transformations

+2) Matrix Cache for Object Transformations

Problem

Matrix operations, such as inverse and transpose calculations, accounted for a significant portion of the program's execution time, consuming approximately 40% of the total time. This resulted in a high performance cost, especially considering that the object transformation matrices remain constant during the rendering of static images.

@@ -249,7 +250,7 @@

Result

With the implementation of the matrix cache, the time spent on matrix calculations was significantly reduced. The calculations are now performed only once, and the results are stored in the cache, improving the efficiency of object transformation calculations. This optimization contributed to an overall improvement in program performance, especially in scenes with multiple transformations.

-πŸ“– References:

+πŸ“– References