Shader Tester is a program that allows users to customize the fragment shader for a specific object. The synopsis of this program is as follows:
$ ./build/shader object [shader]-
object specifies the preset shape the program will be rendering. (
cube,square, andpolygonare currently available, you can make more by yourselves) -
shader is an optional argument that allows you to customize the coloring of the rendered object. Without this argument, the program will use
default.fragas its fragment shader.
For example, if you type ./build/shader cube in the terminal, you will get
this result:
To use a custom shader, run the program with a second argument that specifies the shader file.
$ ./build/shader cube examples/mouselight.fragWith issuing the above command, we obtain this result:
By using this shader, you can change the light source position by moving your mouse.
To increase portability, this project is built by cmake. Before running
cmake, you need to have glfw3 installed and OpenGL 3 configured. Then, type
the following command will help you.
$ mkdir build && cd build/
$ cmake ..
$ cmake --build .The current version of this program supports three uniforms.
time: This is a float variable that stores the seconds elapsed since the program started running.mouse: is a two-dimensional vector storing the normalized coordinates of mouse pointer.has_mouse: determines whether the mouse is in the render region.

