Task 072: 3D noise-based texture

Your task is to implement a continuous noise function and use it in a 3D texture simulating inner structure of a material, for example wood or marble. Everything has to be used in our ray-based renderer (ray-tracer).

Texture samples

Sources

Oral explanation on the labs and on the lecture - samples (very old sample page), PDF slides about noise functions and 3D textures.

Interface ITexture

Function Apply() can modify data in the Intersection object (already completed using the Intersection.Complete()). You can alter any data, but recommended set of quantities is: SurfaceColor, Normal (you have to normalize the result vector). Inspiration: existing checker texture implementation CheckerTexture.

Determinism

Beware: you must keep the complete noise-function implementation deterministic - reasons are animation computation and paralelism. I. e. sources of the randomness must be derived (computed) from 3D coordinates of the function argument (using hash functions, bit swizzling, etc.). The apropriate coordinate system is the Object coordinate space (because it moves together with the animated object) - Intersection.CoordObject.
You can use various hashing functions from the class MathSupport.RandomStatic.

What to modify

You have to add your new classes (noise function, texture, ..) into the MonteCarloRT.cs file, scene definition is in the CustomScene.TestScene() function. If you will prepare more sample scenes, please create more scene-initializer functions and keep all of them accessible from the list-box (see the InitializeScenes() function). Scene-construction function is called with the string parameter Param: from the form.

If you want to define your scene using CS-script, you have to use the 048rtmontecarlo-script project instead and your scene-definition script will be in a separate .cs file (see the data/rtscenes/ for inspiration and scripting instructions). Scripts have access to the text paramter Param: as well.

What to hand in

You must send the modified file MonteCarloRT.cs. You can include a couple of nice pictures.

In case you will be using 048rtmontecarlo-script project, you must include your scene definition[s] in separate file[s]. Script format: see the data/rtscenes/ directory in the repository.

Deadline

Hand in the assignment before: 13. 5. 2018

Points

Basis: 25 points (functional 3D noise-based texture, at least one test scene),
additional points for invention, flexibility (parameters), nice scene, ..
Bonus points for interesting scene will be assigned via the task 061, the scene must be defined using a CSscript! Please leave a note in the mail body that you ask for bonus points for the scene.

Project

Visual Studio project: 048rtmontecarlo or 048rtmontecarlo-script

Source file

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


Copyright (C) 2013-2018 J.Pelikán, last change: 2019-05-09 17:52:59 +0200 (Thu, 09 May 2019)