Task 097: Orange peel

Your task is to implement continuous noise function and use it for approximation of orange peel appearance:

orange

Basis

Project 048rtmontecarlo-script (or 048rtmontecarlo) from the grcis repository will be used as a template. There is a form application able to select scene from a list-box, set various ray-tracing options, super-sampling, multi-thread comutation, etc.
If you want to define 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.

Sources

Oral description at the lecture & lab, noise function examples – texture examples, PDF slideshow about noise functions and textures.

Interface ITexture

Method Apply() modifies any data stored in an Intersection instance (after its completion using the Intersection.Complete() function). You are free to rewrite/change any data, in this case Normal and SurfaceColor are relevant. (keep the normal vector 'normalized' .. its length should be 1). Inspiration: existing texture implementation CheckerTexture.

Determinism

Attention: for a couple of reasons – animation rendering and parallelization – you have to use deterministic implementations of all algoritms (even the 'random' looking noise functions). This can be achieved by deriving random values from (deterministic) coordinates in 2D/3D space using appropriate hash functions.. (see the lecture). You must use the "object space" in case of 3D coordinates. This space is attached to individual objects and is animation-invariant. See Intersection.CoordObject.
You can use popular hashing function from cryptography or random-generator functions from the MathSupport.RandomStatic class.

What to change

You have to take MonteCarloRT.cs file, create a new classes in it (preferred approach: general noise function[s] plus specific orange-peel texture class), use some simple shape (class Sphere) and attach a texture object to it.

Ideas

See details of a orange peel: note the small red dots on the yellow backgroud and some micro bumps (able to be simulated by a normal map).

What to hand in

You must send the modified file MonteCarloRT.cs, optionally a couple of rendered images.

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: 30. 6. 2019

Points

Basis: 28 points, bonus points for approximation fidelity.

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) 2013-2019 J.Pelikán, last change: 2019-05-09 17:52:59 +0200 (Thu, 09 May 2019)