$30
TASK 1: Whitted Ray Tracing
You are to complete a Shadertoy GLSL fragment shader that implements the Whitted Ray Tracing algorithm. Your completed shader is to be run at https://www.shadertoy.com/new. The following images show sample views of the result that your program is expected to produce:
Figure 1
Figure 2
The scene consists of a silvery horizontal plane, a silvery vertical plane (in the background), a bouncing golden yellow ball, and a revolving shiny green ball. There are two point light sources. The images above were produced using 2 levels of ray tracing (recursion level = 2).
——————————
Please download the ZIP file cs4247_2021S2_assign3_todo.zip from the Assignments folder in LumiNUS Files.
You will find an incomplete Shadertoy GLSL fragment shader in the file tasks_todo.frag. You need to complete only the parts relevant to Task 1 and save your completed shader in the file task1.frag. To run your shader, you need to copy-and-paste the shader source code to the source editing window at https://www.shadertoy.com/new. To run or rerun your shader, you just need to click the small black triangle at the bottom-left corner of the source editing window, and the result will be shown in the rendered image on the left of the page. You can do your coding and editing in the Shadertoy webpage, but make sure you copy the updated source code back to the file task1.frag.
The detailed instructions and requirements for completing the fragment shader can be found in the given source code. A brief introduction to how to write shaders for Shadertoy can be found at https://www.shadertoy.com/howto.
Run your completed shader in Shadertoy and screen-capture a frame of the rendered animation. The captured image must be at least of size 640x360. Save the image in PNG format as task1.png.
TASK 2: Distribution Ray Tracing
Based on your shader for Task 1, extend it by implementing the Distribution Ray Tracing algorithm to produce depth-of-field effect and image anti-aliasing (reduction of jaggies).
Note that it is not necessary to use stratified (jittered) sampling to generate random points on the lens and inside the pixel.
The detailed instructions and requirements for completing this task can be found in the given source code. Save your completed shader for Task 2 in the file task2.frag.
Run your completed shader in Shadertoy and screen-capture a frame of the rendered animation. The captured image must be at least of size 640x360. Save the image in PNG format as task2.png.
The following images show sample views of the result that your program is expected to produce:
Figure 3
Figure 4
TASK 3: Design Your New Scene
For this task, you are to model and render a new 3D scene by modifying the shader you have completed for Task 1 or Task 2. Your new scene should not look similar to the original scene. Moreover, at least one of the objects, and at least one of the light sources must be animated. The animation must be perpetual.
Put your completed shader code in the file task3.frag. Your work will be assessed by the aesthetics and creativeness of the new scene and the animation.
Run your completed shader in Shadertoy and screen-capture two frames of the rendered animation. The captured images must be at least of size 640x360. Save the images in PNG format as task3a.png and task3b.png.