Collection of the 4 assignments I completed for the Intro to Computer Graphics course (Computer Science 453 at the University of Calgary) I took in fall 2017.
Links to additional pictures on my ArtStation
- Hilbert curve in OpenGL
- Image manipulation in OpenGL
- Basic 3D model viewer in OpenGL
- Whitted ray tracer
Source code
Hilbert Curve
Features
- Rendering done with OpenGL.
- Draws first to tenth order Hilbert Curves using OpenGL’s lines as well as by using thin triangles.
7th order Hilbert Curve
Credits
- Regarding the software implementation the following resources were invaluable:
- LearnOpenGL for figuring out OpenGL.
- GLFW documentation for figuring out the window and input.
Image Manipulation
Features
- Rendering done with OpenGL.
- Draw multi-colored Catmull-Rom curves and loops.
- Apply image filters (grayscale and 2-bit quantization).
- Grayscale filter uses NTSC conversion weights.
- Move and scale the image.
All effects active
Original image
Grayscale
2-bit image quantization
Credits
- Original image is by realdreadstar/Natty Dread and he made it by setting up a custom scene in The Witcher 3 and taking a screenshot of it.
- Link to realdreadstar’s version on the Nexus
- Link to Natty Dread’s version on Flickr
- Regarding the software implementation the following resources were invaluable:
- LearnOpenGL for figuring out OpenGL.
- GLFW documentation for figuring out the window and input.
- Lines drawn using Victoria Rudakova’s tutorial.
Model Viewer and Editor
Features
- Rendering done with OpenGL.
- Models can be selected by mouse clicking on them.
- Selected models can be modified by rotating, scaling, translating, duplicating, or turning various textures on or off.
- Powerful enough to build the demo scene by hand.
- Supports basic OBJ features and models/textures can be imported with a config file or command-line arguments.
- Phong lighting model using diffuse, specular and ambient occlusion textures.
Scene demoing model viewer
Credits
- All models and textures shown in the image were provided to us by the TA as part of the course.
- Regarding the software implementation the following resources were invaluable:
- LearnOpenGL for figuring out OpenGL.
- GLFW documentation for figuring out the window and input.
- Object selection for figuring out how select objects by clicking on them.
Whitted Ray Tracer
Features
- CPU only and thus does not make use of OpenGL in any way.
- Ray intersection test for spheres and triangles.
- Functional shadow, reflection, refraction, and diffuse bounces.
- Gamma correction.
- Procedural textures.
- Directional and point lights.
- Supports basic OBJ features and models can be loaded with a config file.
My custom scene
Default Cornell box
Credits
- All models either made by me or specified in the assignment description.
- Most of the ray tracer code was based on Scratchapixel.