In this first project, you will create a sandbox for experimenting with fragment shaders and the OpenGL Shading Language (GLSL). You will render a single, screen-filling quadrilateral and paint designs on it using only algorithms that can be expressed in the fragment shader. This project is inspired by Shadertoy.
Each assignment in this course has two stages of requirements: later-week submission and full credit. To receive credit for the assignment you must meet all requirements. However, time is somewhat flexible. If you meet the later-week submission requirements by the due date, then you may take as much time as you need to meet the full credit requirements.
However, to prevent work from piling up at the end of the semester, only one assignment can be turned in per week. If another assignment has a due date in a given week, then you cannot turn in an earlier assignment.
Partial credit is not given. Assignments must meet all requirements. This system is meant to accommodate life's disruptions without sacrificing your learning and achievement.
You must complete these requirements by the assignment's due date:
rastercaster
in the single Git repository that you are using for all your projects.f
with this interface:vec3 f() {
// TODO: define a vec3 named color.
return color;
}
The comment will be replaced by one or more statements that define the color. Call this function from main
and use its return value to set the fragmentColor
variable.If you meet these requirements, you are eligible for later-week submission.
You must complete these requirements in addition to the later-week submission requirements to receive credit for the assignment:
gl_FragCoords
.f
. Expect the user to only enter the code that replaces the comment in the snippet above. They will not enter the function signature or return statement.vec2
uniform named dimensions
that holds the viewport's width and height in pixels.vec2
uniform named mouse
that holds the mouse's position in pixels.float
uniform named time
that holds the number of seconds that have elapsed since the page was loaded.f
. Use any builtin GLSL functions or your own helper functions. Art is a subjective term. In general, each piece should be interesting in some aesthetic or algorithmic way and feel like it was crafted by a human artist.mouse
and be interactive.time
and animate.discard
instruction.f
in a text format that others can copy and paste. Each design must be unique amongst both your own designs and others' designs.
_ Ensure that you can paste others' designs into your renderer to reproduce their results.When you are ready to claim your credit, send your instructor a direct message. Ensure that all requirements have been met. If they have not, you will not receive credit and will have to submit again some other week.