Assignment 4

Color Picking (20/25)

This will be the final project for this class.
Now that you have a checker/chess board, wouldn't it be fun to move any of the pieces? To do this you will need to "pick" a piece with the mouse. The easiest way I know is by making a color picker.

Extra: Use the pick to move any piece with the mouse.

Step 1: Create the shaders. The vertex shader is very simple.

The fragment shader you need to write. Pass into the fragment shader an unsigned int containing the ID number for each piece. Convert that uint in to RGB-like values. Here's a hint:



Step 2: Make a method to do the pick.

Step 3: Call Pick() from HandleEvents.