Microsoft Word – proj4-1.docx
CS435 Computer Graphics
Spring 2017
Project #4
Spotlight
Due: Mar. 22 by 11:59 pm
The project is to investigate the difference between applying the light and material interaction in
the vertex shader and in the fragment shader, specifically the effect of a spot light on a stage
when the light and material interaction is applied in the vertex shader and in the fragment shader.
Modeling
• The scenario is a rectangular shaped stage. However, the rectangle could be divided into
many small sized rectangles either imaginarily (just for the aiming point to be described
later) or actually, depending on the input.
Lighting
• Set up a spotlight above the center of the stage. The position and the cutoff angle of the
spotlight are fixed. The spot light can be aimed at the center of each smaller rectangle,
and the user can change the aiming point using the four arrow buttons. The aiming point
cannot be moved out of the stage.
Viewing
• The viewer can be fixed. However, make sure the viewer can see the stage clearly.
Input
• There are two sliders to indicate how to divide the stage into many smaller equal-sized
rectangles horizontally and vertically. The smallest division is always 1×1 (no division).
You need to decide a good maximum division such that the spot light can be seen in the
Multiple and Vertex shading mode described below.
• Four arrow buttons (left, right, up, and down) to move the aiming point of the spot light.
• Three shading buttons.
o Single and Vertex: A single-piece stage and applying the light and material
interaction in the vertex shader.
o Multiple and Vertex: The stage is made of many smaller rectangles based on the
two slides and applying the light and material interaction in the vertex shader.
o Single and Fragment: A single-piece stage and applying the light and material
interaction in the fragment shader.
Create a directory called project4 under your cs435 home directory. Move into that directory,
and create two files: spotlight.html and spotlight.js to complete this project.
Submission Requirements:
• Make sure the project4 directory contain the two files: spotlight.html and spotlight.js.
(Here we assume the Common directory is located in the same directory as the project4
directory, and you do not need to submit the Common directory.)
• The title of spotlight.html should contain CS435, Project #4, your name
• The spotlight.js file should contain the following information at the beginning: CS435,
Project #4, your name, a description of the program. Add other necessary comments
whenever a part of the code is not obvious.
• Compress the project4 directory into project4.zip and submit the compressed file as an
attachment on Blackboard.
vagrant