Tutorial 1
Notes :
1. Pleases use https://www.shadertoy.com/ editor to program the shaders
2. Please use linear algebra operations to optimize the codes
1. Figure 1 contains ellipse drawn with a fragment shader. The shape centered to the
screen midpoint and the border adjacent to the screen border. Write the fragment shader
program to draw this shape.
Figure 1
2. Load an image and wrap to the OpenGL screen using a shader program (Figure 2)
a. Write the fragment shader program to zoom the image 2x from centre. (Figure 3)
b. Turn the image into grayscale format (Figure 4)
Figure 2
Figure 3
Figure 4
3. Write a fragment shader program to wrap a video texture to opengl screen. Extend the
program to draw a grid over the video. A grid cell should be 10 pixels in size. (Figure 5)
Figure 5