Assignment 6: Lighting the Virtual World
- Due Nov 18, 2018 by 11:59pm
- Points 10
- Submitting a file upload
Objectives
To have a single directional light that illuminates your entire world.
Description
Extend your code for Assignment 5 in order to support a single directional source of light that will illuminate the objects of your world using the Phong Shader. Moreover, your application has to support Normal Shader to help you debug the normals of the object's vertices.Your application is required to have the following features:
- A world were one can navigate through moving a camera controlled with the keyboard (as specified in Assignment 5).
-
A single directional light source that rotates over time.
- This light source will be passed as input to a Phong Shader, that will be used to render each object of your scene.
- This light should constantly rotate by 5 degrees around it's x axis.
-
Each object of the scene is illuminated using the Phong Shader
- Phong Shader models a combination of ambient, diffuse and specular lighting.
- Specular and Diffuse lighting calculations require the normal of the vertices. So you will have to calculate the normal of each vertex and pass this as input to the shader as well.
-
Map the key "N" to toggle between Phong Shader and Normal Shader.
- The normal shader does not model illumination. Instead, it simply colors the fragment with the surface normal.
Resources
Readings: Matsuda/Lea Ch8, (Chp 6 and Appendix B are GLSL reference)
What to Turn in
1. Canvas Submission
Zip your entire project and submit it to Canvas under the appropriate assignment. Name your zip file "[FirstName]_[LastName]_Assignment_6.zip" (e.g. "Lucas_Ferreira_Assignment_6.zip").
2. Live Hosted Submission
Host your assignment on your UCSC portal. This can be achieved by just putting your entire project directory into the 'public_html' folder which you can access via the UCSC Unix timeshare. Your site link is 'https://people.ucsc.edu/~ucsc_user_name/'.
WHEN SUBMITTING YOUR PROJECT ON CANVAS, PLACE YOUR SITE LINK AS A COMMENT OF THE SUBMISSION.
Read the SubmissionGuide.txt file for further explanation on how to submit your assignment.
Rubric
Criteria | Ratings | Pts |
---|---|---|
Have a world made with a ground and walls where one can navigate with a camera as specified in Assignment 5.
This doesnt have to be your full world as required in lab 5. It is acceptable to have a simplified world with some objects to look at. You do need camera controls so we can look around your world.
threshold:
pts
|
pts
--
|
|
Have a directional light source that rotates over time around it's own x axis.
Its also ok to have a point light that moves its position back and forth in the X direction.
threshold:
pts
|
pts
--
|
|
Ground and walls are illuminated with ambient light.
threshold:
pts
|
pts
--
|
|
Ground and walls are illuminated with diffuse light.
There are two parts to this:
1) Create normals on your cube and pass them into the shaders correctly.
2) Use these normals correctly in your lighting equation (N dot L for diffuse)
threshold:
pts
|
pts
--
|
|
Ground and walls are illuminated with specular light.
Again two parts: 1) Calculating reflection vector correctly 2) Using this correctly in the specular part of the lighting equation (V dot R for specular).
threshold:
pts
|
pts
--
|
|
Ground and walls illuminated are rendered with Normal Shader when key N is pressed.
I dont care if you switch shaders in the correct way, or you have a single shader and a uniform variable that triggers and "if" statement with two parts.
threshold:
pts
|
pts
--
|