Implementing a ray tracer in a fragment shader
In class we showed how to implement a simple ray tracer,
using the math that we developed in our previous class
to ray trace to a sphere.
Our ray tracer renders the sphere,
and also applies
simple lighting and
animated atmospheric effects, as well as
procedural textures using a
coherent noise function.
Homework
Due next Wednesday before the start of class
Create your own scene that
consists of ray tracing to spheres.
You can start with the code we implemented in class.
Have fun with it.
Here are some things you might try:
-
See if you can figure out how to
ray trace to two or more spheres.
Maybe you can create an interesting character.
-
Try to create other sorts of natural
materials using the noise-based
procedural texture.
How about wood, or water, or clouds?
-
See if you can figure out how to
create multiple light sources.
-
Create an alien planetscape.
-
Try anything else that inspires you.