1. Homepage
  2. Programming
  3. CS3451 Introduction to Computer Graphics Project 3: Distribution Ray Tracing

CS3451 Introduction to Computer Graphics Project 3: Distribution Ray Tracing

Engage in a Conversation
USGeorgia TechDistribution Ray Tracing

Project 3: Distribution Ray Tracing

Available Feb 18 at 9pm - Mar 9 at 11:59pm CourseNana.COM

Objective

For this project, you will add distribution ray tracing functionality to your ray tracer.  First, you will add spheres as a new kinds of primitive.  You will also create shading effects for shiny surfaces (highlights and reflection).  Then you will begin to cast more than one ray per pixel, at first just for anti-aliasing. Finally, you will build on this to achieve several distribution ray tracing effects:  soft shadows, motion blur, depth-of-field, and glossy reflection. CourseNana.COM

Project Description

This project will require you to implement a number of new effects: CourseNana.COM

  1. Add spheres as new geometric primitives
  2. Add specular terms to the surface material properties
  3. Perform recursive ray tracing for reflective surfaces
  4. Add anti-aliasing and soft shadows (using disk lights)
  5. Implement more soft effects: motion blur, glossy reflection, and depth of field After you implement these new capabilities, your results should appear almost exactly like the examples shown below in Results.

Begin with Your Project 2 Code

There is no provided code for this project.  Since this project builds on top of Project 1 and 2, you should start with your project 2 code and add the new capabilities to it. CourseNana.COM

Provided Scene Files

There are several SCENE FILES that are provided for this project.  Scene files are provided in pairs, with "a" and "b" versions. You should modify your code so that pressing one of the keys 1-9 will load in the appropriate "a" scene file.  When you press SHIFT and the digit 1-9, your code should read in the "b" version of the scene. CourseNana.COM

Scene Description Language

As in Projects 1 and 2, each scene is described by a text file with suffix ".cli".  Each of these .cli files are just plain text files, and you are encouraged to look at them.  Sometimes you may find it useful to modify a copy of these files to make debugging easier. CourseNana.COM

Below are the new commands that you will implement.  Your ray tracer should also keep the functionality of all of the commands from Projects 1 and 2. CourseNana.COM

sphere  radius  x y z CourseNana.COM

Create a sphere with a given radius and center location. CourseNana.COM

rays_per_pixel  num CourseNana.COM

Specify how many rays per pixel to shoot.  By default, this value should be set to one.  When the number of rays is larger than one, sub-pixel rays should be created in random positions within each pixel.  The colors of these rays should be averaged together to give the final color of the pixel. CourseNana.COM

moving_object    dx dy dz CourseNana.COM

Change the last object that was defined into a moving object.  The values (dx, dy, dz) specify the amount of translation this object undergoes during one frame.  Rays shot at such an object should assigned a random time in the range of 0 to 1.  The moving object should be translated by this random time amount times the displacement (dx, dy, dz).  When many rays per pixel are used, this should give the appearance of motion blur.  You can implement this in a manner similar to an instanced object, by translating the incoming ray's origin.  Remember that any shadow rays shot from this object should use the same random time! CourseNana.COM

disk_light   x y z  radius  dx dy dz  r g b CourseNana.COM

Create a disk light source, with center (x, y, z), a given radius, the direction that the light is facing (dx, dy, dz), and the light color (r, g, b).  Shadow rays should be shot to random locations on this disk.  When many rays per pixel are used, this should create soft shadows. CourseNana.COM

lens  radius  dist CourseNana.COM

When radius is non-zero, this command will create depth of field effects by shooting rays from a lens. The origin of the eye rays should not be exactly at (0, 0, 0), but from a random point on the lens.  The lens is a disk that is centered at the origin of the given radius, and that is perpendicular to the z-axis. The value dist gives the distance to the focal plane that is perpendicular to the z-axis.  All rays for a given pixel, no matter where they originate on the lens, should pass through the same point P on the focal plane. CourseNana.COM

glossy  dr dg db  sr sg sb  spec_pow  k_refl  gloss_radius CourseNana.COM

Create a shiny surface material.  The first three values (dr dg db) are the diffuse color coefficients, just as in the "surface" command.  The next three coefficients (sr sg sb) are the specular color coefficients, and should only affect the colors of the specular highlights.  The spec_pow value should affect the apparent roughness of the surface, with higher values giving tighter highlights.  (See section 10.2 of Fundamentals, equation 10.7).  A non-zero value for k_refl indicates the surface is shiny enough to shoot reflected rays and indicates how much they contribute to the surface color.  When gloss_radius is zero, the direction of the reflected rays should travel in the perfect mirror direction.  When gloss_radius is greater than zero, modify the perfect mirror direction by adding a "fuzz factor" taken from a random vector inside a sphere of the given radius.  When multiple rays per pixel are used, this will give the impression of glossy reflection. CourseNana.COM

Random Sampling and Filtering

Although jittered sampling is a very good way to create samples for pixel anti-aliasing, we will not be requiring the use of jittered sampling.  There are several reasons for this: 1) it is awkward to do jittered sampling for non powers of two (e.g. 50 samples), and 2) it is hard to do jittering correctly for multiple soft effects at once (pixel anti-aliasing, soft shadows, depth of field, etc.).  Instead of using jittered sampling, we recommend that you use random samples in the given sampling region for each soft effect.  For pixel anti-aliasing, pick a random fractional location for every eye ray within each square pixel.  For each shadow ray, pick a random location on the disk-shaped point light source (using rejection sampling).  For each motion blurred object, pick a random time in the range of zero to one.  For each lens sample for depth-of-field, pick a random point on the disk of the lens (again with rejection sampling).  For each glossy reflection, choose a random point in the "fuzzy" sphere (rejection sampling!) to make your reflections different than the ideal reflected direction. CourseNana.COM

During the lecture on anti-aliasing, we saw that a box filter is actually not the best filter for anti-aliasing. However, we want you to use a box filter for this project for pixel anti-aliasing.  Using a better filter, such as a triangle or Gaussian filter would be better, but would make the project overly complicated.  Please stick with box filter, that is, just average all of the pixel rays together without giving them different weights. CourseNana.COM

Results

The scenes for this project are given in pairs, and each filename contains either the letter a or b.  When you press any of the digits 1 to 9, this should cause the "a" version of the scene to be rendered.  When you press the SHIFT key and a digit 1 to 9 (characters !@#$%^&*(  ), this should cause the "b" scene to be rendered. Many (but not all) of the "b" scenes shoot more than one ray per pixel.  Below are the images that your program should generate for a given scene, and the "a" and "b" scene images are shown on the same row. CourseNana.COM

Get in Touch with Our Experts

WeChat (微信) WeChat (微信)
Whatsapp WhatsApp
US代写,Georgia Tech代写,Distribution Ray Tracing代写,US代编,Georgia Tech代编,Distribution Ray Tracing代编,US代考,Georgia Tech代考,Distribution Ray Tracing代考,UShelp,Georgia Techhelp,Distribution Ray Tracinghelp,US作业代写,Georgia Tech作业代写,Distribution Ray Tracing作业代写,US编程代写,Georgia Tech编程代写,Distribution Ray Tracing编程代写,USprogramming help,Georgia Techprogramming help,Distribution Ray Tracingprogramming help,USassignment help,Georgia Techassignment help,Distribution Ray Tracingassignment help,USsolution,Georgia Techsolution,Distribution Ray Tracingsolution,