Author: Cheng-Yu, Fan
Check Github: https://github.com/fjordyo0707/RaytracingAndVisualize
Anti-aliasing: For one pixel, I sample four ray and interpolate with bicubic method.
Soft Shahow: I sample 1000 points on a disc within a light sphere, and instead of setting Id to zero, I set it with Id*(1-{ratioOfShadow})
The Runtime for this complicated image(mytest.txt) takes about 4 minutes on my laptop.
The simple image(input.txt) takes about 1~2 minutes.
$ brew install cmake
$ brew install opencv
$ brew install pkg-config
$ sudo apt-get update
$ sudo apt-get install cmake
$ sudo apt-get install libopencv-dev python-opencv
Go here Cmake to install cmake.
Install OpenCV depend on your IDE or compiler.
- This code does recursion until not hitting anything, so it may take some time if you have too many objects!
- This code isn't fully optimized, so may look a bit dirty!
- Runtime will take few minutes!
$ mkdir build
$ cd build
$ cmake ..
$ make
$ ./bin/output <path/to/input.txt> <path/to/output.png>
# For example : $ ./bin/output ../test/mytest.txt ../img/output.png
(Optional) Download the prebuild OpenCV and use Visual Studio
- Open your IDE
- Set OpenCV to your path environment
- Link