dilevin / computer-graphics-ray-tracing

Computer Graphics Assignment about Ray Tracing
1 stars 5 forks source link

Few advices for A3 #49

Open SCOU7 opened 1 year ago

SCOU7 commented 1 year ago

I am writing this as I felt the documentation for A3 was overall insufficient compared to A1 and A2, thus thought there would be friends in need of some help.

Skim all five steps below as they also affect each other and are not chronological advice.

  1. For this assignment, the textbook helps a lot. Indeed, I think quite a lot of the variable, field names in A3 are from the textbook. Please take a look at pg 83~87.


  2. Implement raycolor.cpp in the end. For A1 and A2, following the order of how the files were listed in Git Hub worked for me, but in A3, although raycolor.cpp is listed third, it is impossible to implement it without the other 4 files.

So I think the order of implementation should be 
1) DirectionalLight.cpp, ProjectLight.cpp
2) blinn_phong_shading.cpp, reflect.cpp
3) raycolor.cpp 


  3. There are some implicit changes in the provided files.
There are new header files in the Include/ directory. Also, the JSON elements have slightly changed in data/ even for the files you’ve seen in A2. 


  4. In the Include/ directory. There are new files named Light.h and Material.h. 
Light.h is the base class for DirectionalLight.h, ProjectLight.h. Note that, I variable in Light.h exists in both DirectionalLight.h and ProjectLight.h and it is necessary to use it in blinn_phong_shading.cpp. 


  5. For Material.h, I recommend looking at it with other JSON files in data/. Unlike A2, the objects are now linked to a specific material. material has 5 fields, ka, kd, ks, km, and phong_exponent. km has to do with mirror reflection (pg 87). The other 4 fields have to do with blinn_phong_shading (pg 84)



Good Luck!