micheledallerive / raytracer

A C++ raytracer
0 stars 0 forks source link

Advanced Reflectance Model - 7 points #5

Open micheledallerive opened 7 months ago

micheledallerive commented 7 months ago

To go beyond what enables Phong lighting model, implement Ward reflectance model (https://en.wikipedia.org/wiki/Specular_highlight), and use it for at least one of the objects in your scene to get some interesting results. Note that this model allows for modeling anisotropic materials, e.g., the appearance changes as you rotate the object. The formulations you can find (including the Wikipedia source) often mentions only the specular term. This means that you can reuse the diffuse component from the Phong model, and replace only the specular component. The formulations mention two orthogonal vectors in the normal plane, which specify the anisotropic directions. To simplify the task, you can take a tangent and bitangent vectors (https://www.opengl-tutorial.org/intermediate-tutorials/tutorial-13-normal-mapping/). We will discuss these when we talk about normal mapping. The trick when defining the two vectors in the normal plane is to define them using UV texture coordinates. This allows for making them consistent across the entire object. It is ok if you use a simple object to demonstrate this feature. It is relatively easy to compute tangent and bitangent vectors, for example, for a sphere.

Please demonstrate the anisotropic capabilities in order to get the maximum number of points. You can, for example, include in your scene two instances of the same objects with the only difference being the values of parameters responsible for anisotropy.

Additional resources: https://cseweb.ucsd.edu/~ravir/6998/papers/p265-ward.pdf The original paper describes the model and provides examples of parameters for some materials https://people.csail.mit.edu/addy/research/brdf/ website of the project, which was measuring real materials; the supplemental materials provide parameters for real materials for different reflectance models, including Ward; unfortunately, there are not any anisotropic materials

=====================================================

Consider also refactoring the current light functions into a better modularized structure, maybe with a template-like usage in order to be able to easily switch between the different lighting models, like the Tracer classes.

micheledallerive commented 7 months ago

https://www.icorsi.ch/mod/book/view.php?id=1003388&chapterid=24727