CSS552: Programming Assignment #1

Source code familiarization, Pixel Positions, and Visibility Sampling

Due Time: Refer to the course web-site.


Objective

The goals of this programming assignment are for us to get familiarize with our rather complicated source code base, verify simple vector math, and understand visibility sampling in image generation. Here are more details.

Approach

Please refer to my solution. Here are the command files (with sample rendered images). You should download and unzip both of these files, then double click on RTViewer to run the sample program. Notice that with my solution when you render:

  1. CommandFile/CommandFile_S1.xml: you observe
    1. rather fast rendering, with significant aliasing effects around silhouettes of objects.
    2. shading (or illumination) for geometries are rather boring (and incorrect), and yet, you can definitely differentiate between different objects in the scene.
  2. CommandFile/CommandFile.xml: you observe much slower rendering (about 8-times as slow), yet silhouettes around objects are much smoother.
  3. If you read the command files (they are xml files), you will see that there are commands not used in this assignment. Those commands are necessary for the interactive viewer to display and light the scene.

Our first programming assignment is to understand the starter project RayTracer Framework, integrate our understanding of pixel location computation into this framework, resolve visibility of objects, and perform super-sampling to alleviate spatial aliasing artifacts. You should download and unzip the starter project, open it with Visual Studio IDE (by double clicking on the RTWithViewer.sln file) and examine the source code while reading the following.  Please refer to the end of this document about Visual Studio and the graphics support for our framework.


The RTViewer Program

There are five projects in this program solution: RayTracer, 3DPreviewer, UWBGL_WinForms_Lib1, UWBGL_XNA_Lib, and UWBGL_XNA_LIBContent. You actually only need to pay attention to the very first project (RayTracer). We will/may look at other projects if we have time later.


The 3DPreviewer Project

This is an extremely simple bridge project that links the XNA-based libraries to the RayTracer project. If you examine the source code, you will only see one source file: Program.cs. Open this file and you will see that the Main() function only creates a RTViewer object. This object is defined in the 3DPreviewer.cs file where it creates the main application window, initializes 3D interactive graphics system, and then calls to create the RTWindow. RTWindow is defined in the RayTracer project (to be discussed below). We will not work with or modify this project in our class.


The RayTracer Project

This is the project that we will work with throughout this quarter. The source code in this project is organized into RTWindow.cs and three other folders.


In this programming assignment, you should pay attention to:

By modifying the above, you will implement visibility, super sampling, and simple approach to differentiate between objects. In my implementation I set the color for each object to be a function of their respective resource index.

 

Last note, the executable generated from the IDE is located in the ./RayTracerExe folder. You can run the executable without starting the IDE (you know this right? J).


Credit Distribution

Here is how the credits are distributed in this assignment:

  1. 25%: Pixel Locations: in the lower left sub-window, when Debug is turned on:
  2. 30%: Visibility Computation:
  3. 35%: Super Sampling
  4. 10%: Proper Submission

Extra Credits

WARNING: the source code based is rather large, and the math can be tricky! Please begin ASAP and bring questions to classes!!

This programming assignment will count 8% towards your final grade for this class.

 

A word about the IDE and graphics support:

·         IDE: Source code of our MPs and my solution projects are based on Visual Studio 2015 (Community edition). This system is free, you do need to get an account with Microsoft and register to use it. You can simply download, install, and run. You will note that our course project will not load. It’s ok, quick the IDE and follow the next instruction on graphics support.

·         Graphics support: The graphics support for real-time viewer is based on the now unsupported XNA 4.0. We are using this rather ancient support because the real-time viewer is independent from what we are learning and I cannot decide on what system I want to work with next. For now, you need to

o   Download a Visual Studio extension from here

o   Unzip the download, follow instructions and install steps 1 to 4, and remember to perform the final VS extension.

You now should be able to run Visual Studio and open the projects from this class. Let me know if you have any problems (via email, ASAP).

·         Some more information:

o   Monogame: This is the open source version of XNA. Looks like it is still being actively worked on.

o   Please come talk to me if you are interested in porting the 3D Viewer framework to another system. Depending on the actual scope of the project, this can be a perfect workload for CSS600, or CSS595.

§  For CSS600, you will investigate a new set of technologies, e.g., C++/OpenGL or C++/D3D, and port the current C#/XNA system.

§  For CSS595, in additional to the simple porting, you will also:

·         examine support for defining the ray tracing database from the real-time viewer

·         generalize the viewer to allow future students work with the shaders (E.g., to support shadow and reflection in the real-time viewer)

·         etc. etc. … the possibilities are quite literally limitless.