Assignments

The following 3 tasks should be implemented in OpenGL and presented. They can be implemented as 3 different programs or all in one. For more help and a project to start from see the Theory page.

Deadline is March 31st. Extensions can be given to students who has got at least one of the tasks approved before that date.

Task 1

Implement a pair of vertex/fragment shaders that shades a model by calculating the Diffuse part of the Phong reflection model using Phong shading.

Task 2

Draw a cube with a texture applied to each side. Use the same source texture for all sides but change the appearance of the texture depending on the normal direction for the cubes side or by sending different attribute values for each sides.

On one side of the cube:

  1. Convert the textures color value into greyscale.
  2. Implement a Gaussian blur of the texture.
  3. Invert the color. (White – color) = inverted color.
  4. Use the texture coordinates as red and green colors instead of sampling a value from the texture.
  5. Draw the texture at twice the frequency. So the image will show up 4 times on the side instead of once. It’s simply a multiplication of the texture coordinates with 2.0 and using repeat as texture parameter.
  6. Only render odd or even pixels from the texture. Use black color on the other pixels or skip rendering it totally.

Task 3

Implement a shader pair that can render several instances of an objects at different locations. Use matrices as uniform inputs for the vertex shader to define position and orientation of the objects. Use a special matrix called viewmatrix to specify the location of a camera.

Render at least 2 instances of the object (cube?) that are visible on the screen.

Welcome to CoursePress

en utav Linnéuniversitets lärplattformar. Som inloggad student kan du kommunicera, hålla koll på dina kurser och mycket mer. Du som är gäst kan nå de flesta kurser och dess innehåll utan att logga in.

Läs mer lärplattformar vid Linnéuniversitetet

Student account

To log in you need a student account at Linnaeus University.

Read more about collecting your account

Log in LNU