Due: Tue, 2023/3/28 23:59
In this assignment, you are asked to implement a simplest Ray Marching algorithm to render the “Classic” Mandelbulb and parallelize your program with MPI and OpenMP libraries. We hope this assignment helps you to learn the following concepts:
Please note that you are not allowed to use mathematical techniques to bypass or reduce the iteration process of calculating Mandelbulb sets.
For more information about Mandelbrot Set and Mandelbulb, please refer to Appendix A.
/home/ipc23/share/hw2/sample/hw2.cc
./home/ipc23/share/hw2/sample/Makefile
./home/ipc23/share/hw2/testcases
.The program is executed with the following command:
./executable $num_threads $x1 $y1 $z1 $x2 $y2 $z2 $width $height $filename
The types of the arguements and their meanings are listed in the table below:
Argument | type | explanation |
---|---|---|
$num_threads | int | Number of thread per process |
$x1 | double | camera position x |
$y1 | double | camera position y |
$z1 | double | camera position z |
$x2 | double | camera target position x |
$y2 | double | camera target position y |
$z2 | double | camera target position z |
$width | unsigned int | width of the image |
$height | unsigned int | height of the image |
$filename | string | file name of the output PNG image |
Please note that the output image should be a 32bit PNG image with RGBA channels.
The table below lists the parameters, along with their default values and explanations, in the sequential version. Please note that if you have a better set of parameters that can produce the same result as the sequential program given any input argument, please provide the parameters used and argue why yours are better.
Parameter | Default Value | explaination |
---|---|---|
power | 8.0 | Power of the equation |
md_iter | 24 | The mandelbulb's maximum iteration count |
ray_step | 10000 | The maximum step count of ray marching |
shadow_step | 1500 | The maximum step count of shadow casting |
step_limiter | 0.2 | The limit length of each step when casting shadow |
ray_multiplier | 0.1 | A multiplier for ray marching to prevent over-shooting |
bailout | 2.0 | The escape radius |
eps | 0.0005 | The precision of the rendering calculation |
FOV | 1.5 | Field of view |
far_plane | 100 | The maximum depth of the scene |
The following libraries are the ones used for the sequential version. All of them are already installed on Apollo. Please refer to TA’s sample code and Makefile.
A simple script is provided for you to test the correctness of the rendered image. Once invoked, it compares the two input images and outputs the percentage of matching pixels. This script can be invoked using the following command:
/home/ipc23/share/hw2/hw2-diff a.png b.png
You can also use hw2-judge
to check the correctness of your program on all testcases and submit your result to the scoreboard.
Please note that your homework is graded base on the code submitted to EEClass, the statistics on the scoreboard will not be considered
Your report must contain the following contents, and you can add more as you like. You can write in either English or Traditional Chinese.
(50%) Correctness:
(20%) Performance. Based on the total time you solve all the test cases. Note that you are required to produce the right answer to get the performance points.
(30%) Report.
Please submit the following files to EEClass:
hw2.cc
Makefile
(optional)report.pdf
spec