COMP 5822M: High-Performance Graphics 2019-2020
ASSIGNMENT 2: Phong Shading in Vulkan [10 marks]
For this assignment, you will build a small application that renders a duck. Yes, a duck:
https://free3d.com/3d-model/bird-v1–282209.html
Last term, you were provided with a small triangle-renderer application to look at models (and also in COMP 5821M). It used the fixed function OpenGL pipeline for the rendering. Now that we have the ability to build graphics pipelines in Vulkan, it is time to build the equivalent of the OpenGL fixed function pipeline.
Your code should read in the .obj file and the image (see notes below on the easy way to do this), then render it, with textures modulated by Phong lighting computations at each pixel (ie for each fragment), as shown in class.
Marks will be assessed as follows:
[2 marks] Code correctly reads in the vertices, normals & texture coordinates.
[2 marks] Surface renders at all.
[2 marks] Surface is correctly Phong shaded (with textures turned off)
[2 marks] Surface is textured correctly (with lighting modulation)
[1 mark] Application implements translation and arcball rotation
[1 mark] Stages of rendering can be (de-)activated while app is running
You are only allowed to use the following code resources:
vulkan-tutorial.com (except for the object loader code)
code handed out for COMP 5812M, COMP 5821M, COMP 5822M
GLM / GLFW
The standard ArcBall code
All other code must be written by you personally.
Penalties of up to 25% may be assessed for poor software engineering choices (makefiles, comments, structure, hardcoded input names, &c.)
Notes:
1. The texture for the model is a .jpg. The easy way to read it in is to convert it to PPM in a graphics editor such as gimp.
2. The .mtl file gives you details of rendering parameters: you may either read this in or set the values directly (in which case your code won’t work for other surfaces . . . )
3. For details of the .mtl parameters, see
http://paulbourke.net/dataformats/mtl/
4. It is probably easiest to get the pipeline up and running with no lighting or textures, then add the lighting & textures in afterwards.
5. We will use today’s lab to walk you through getting started with the model.
Handin:
Please hand in the following files to the VLE:
Any code or vertex shader files
The.mtl and texture files (in .jpg or .ppm) that you have used
A readme
Do NOT handin your Visual Studio project files or anything not listed above. This includes the duck itself (to save on download time for the marker)
Deadline: Monday, March 2, 10:00 am