Starting from:

$30

CS4247-Assignment 2 Solved

TASK
You are to complete an OpenGL program to render a scene as if it is lit by an image projected from a light projector. The following images show sample views of the result that your program is expected to produce:

 

 
Figure 1

 

 
Figure 2

 


The shadow must be produced using the shadow mapping technique described in Lecture Topic 6. Percentage-closer filtering (PCF), as described in Lecture Topic 6, must also be applied to smooth the shadow boundaries.  

 

——————————

 

Please download the ZIP file cs4247_2021S2_assign2_todo_(*).zip from the Assignments folder in LumiNUS Files.

 

You need to complete the C++ application program main.cpp and the fragment shader assign2.frag. In the fragment shader, all necessary uniform variables, and global input/output variables have already been declared, and you must not add new ones. You can add new functions in your shader. Note that you should adhere to the variable naming convention where the prefix “ec” is used to indicate that the entity is expressed in the eye space, the prefix “wc” to indicate world space, and the prefix “tan” to indicate tangent space.

 

A Visual Studio 2017 solution main.sln (or Xcode project assign2.xcodeproj on macOS) is provided for you to build the executable program. The application program loads the shader source files assign2.vert and assign2.frag, and use them in the rendering. It also provides the values for the vertex attributes and uniform variables to the shaders. In this assignment, you are not required and must not change any other C/C++ source files besides main.cpp.  

 

There are three tasks in this assignment:  

 

•  Task 1: Complete the function DrawSceneWithProjection() in assign2.frag.  

 

You can use the finished application program main_done.exe (or main_done on macOS) to test your fragment shader. The program does not produce correct rendering right now since it is using the incomplete fragment shader.

 

•  Task 2: Complete the function SetUpShadowMapAndFBO() in main.cpp.

 

•  Task 3: Complete the function RenderShadowMap() in main.cpp.

 

The detailed requirements for each task can be found in the source code.

More products