Task 021: Layered reflectance model Weidlich-Wilkie

Your task is to implement a layered reflectance model (interface IReflectanceModel) for our ray-based renderer. Your implementation should be tested in at least one sample scene. In addition to the reflectance formulae you have to declare a specific material object as well (IMaterial).

Weidlich-Wilkie © A.Weidlich, A.Wilkie

Theory

Read the article Weidlich & Wilkie: Arbitrarily layered microfacet surfaces and implement described layered reflectance model. Authors focused on a general layered surface model and introduced a couple of simplifications for convenience and higher efficiency. They cover sampling methods for Monte-Carlo rendering as well, but this is not necessary for our task (feel free to skip all the sampling-related parts).
To simplify the situation, you can restrict your implementation to two surfaces (interfaces). This means: one thin semi-transparent layer (clear or tinted varnish), two material boundaries, see the illustration (or Figure 6 in the article – all materials except for the last one).

Basis

You will work in the template application 048rtmontecarlo-script (or 048rtmontecarlo) from the repository grcis. There is the form capable of choosing a scene from a list-box, setting up various options.. After pressing the "Render" button, the scene will be rendered and the result image will be displayed in the form window.
Use the MonteCarloRT.cs source file for your implementation, you will send me this file as a solution of the assignment. You can create new classes (you actually will to implement at least twho new classes – a new reflectance model and a material property class), data structures, etc. Definition of your scene (CustomScene.TestScene()) is in this file as well. Text parameter Param: will be passed to the construction function.
If you want to test our new feature – definition of a R-T scene using CSharpScript, please use the 048rtmontecarlo-script project and put your scene definition into a new .cs file (be inspired by builtin scenes in the directory data/rtscenes/). Scripts have access to the text parameter Param: as well.

Details

You have to implement a reflectance model in a new class compatible with the interface IReflectanceModel. In sync with it you will need to define a new material class compatible with interface IMaterial. You can take inspiration from the builtin classes PhongModel and PhongMaterial.
It is necessary to implement functions: DefaultMaterial() and ColorReflection() in two variants. You should pay attention to the argument ReflectionComponent comp defining which reflection components you have to include into the result (core ray-tracing algorithm requires this functionality).

For your convenience, there is a function InitializeScenes(). You can put there default/initial values of image resolution, anti-aliasing, scene selection, etc. The function is called only once, in the form setup phase.

Survey of relevant concepts and components of our ray-tracer architecture can be found in this PDF presentation.

What to hand in

You must send the modified file MonteCarloRT.cs. Please include interesting material settings to show your reflectance model, use the scene-list-box to select your new scenes.

There is an option to define your scene in a CS-script file (see the 048rtmontecarlo-script project), you have to hand in a script file together with your source file. Script format: see the data/rtscenes/ directory in the repository.

Deadline

Hand in the assignment until: 12. 5. 2019

Points

Basis: 28 points (layered model, functional in all common contexts),
up to additional 8 points: bonus for interesting demo scenes..

Project

Visual Studio project: 048rtmontecarlo-script or 048rtmontecarlo

Source file

Modify and hand in the source file: MonteCarloRT.cs
Edit your name in the InitializeScenes() function!


Copyright (C) 2011-2019 J.Pelikán, last change: 2020-02-17 00:43:03 +0100 (Mon, 17 Feb 2020)