Advanced Graphics, Shaders homework

For this homework assignment, we will be writing some shader code.

You will need to download this program: ShadersHomework.zip (updated 1/31). In it you will find three files called "VertexShade.vfx", "PixelShade.pfx" and "PixelShadeTexture.pfx". In those functions you'll find a "main" function that is missing some stuff.

Basic assignment

The basic assignment is to implement the shaders such that the textures show and the ambient and the diffuse component of the directional light is implemented correctly.

Ambient light needs no calculation.

Diffuse light is calculated using Lambert's formula: color = dotproduct(Normal, LightDir) * LightColor. This should be multiplied to the texture's color in order to generate the correct output.

Contributions from multiple lights are additive. So are the specular contributions, but they must not be mixed with the texture color.

Program usage:

Submitting

You must send to JCAB your completed shader files according to the instructions.

Extra grade

Extra grade will help you compensate your grade if you don't manage to successfully complete one or more basic assignments.

I will be granting the following:

[an error occurred while processing this directive]

Solution available

Download the full source code of HWRenderer here.