Shaders Flashcards
What does a Vertex Shader do?
A Vertex Shader
is run on every vertex
processes the vertex
and determines where the vertex should be on the screen
This information is eventually passed on to the Fragment Shader for this vertex
What does a Fragment Shader do?
It must decide how to colour an object that has vertices
What are Uniforms?
These are variables sent to the Vertex and Fragment Shaders
They stay constant throughout the frame, though can be changed during the frame
What are Attributes?
Values applied to individual vertices
Only available to Vertex Shader
What are Varyings?
Variables that are declared in the Vertex Shader and are shared with the Fragment Shader.
This is a simple way of passing data between the shaders