Skip to content

A repository for the coursework completed at my University's Graphics module

Notifications You must be signed in to change notification settings

MattRoyle/Graphics-Courswork

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

98 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Graphics-Coursework

The Coursework for a 3rd year module I took in Graphics while studing at the University of Nottingham. The project is written in C++, using OpenGL and demonstrates the graphics programming techniques we learnt in the module. My coursework includes 3D object rendering, animations, interactive objects, text rendering and a raytracer. The scene is related to underwater exploration, such as a submarine and a transparent diving helmet. This project also allowed me to apply concepts from the LearnOpenGL book that in this repository, such as the Cubemap Skybox and using Framebuffers. The scene includes loaded OBJ files for the submarine, fish, window, and a diving helmet. There is also a marching cubes generated rotating rock object.

Key Features and Techniques

The full report for the project is found in Final-Report.pdf and the Presentation-Notes.pdf. Some highlight features implemented and techniques used are below.

Objects

The project includes both procedurally generated objects and loaded OBJ files for which I wrote a obj parser that uses TinyOBJLoader to parse the obj before further processing that output. Some of the data is stored in the vertexes while others are in textures, so the parser can search for the materials before falling back on the vertex data. Due to the project only allowing for the obj file format, the scene is constructed from a JSON file which I wrote a basic parser for. The scene is constructed based off the json file, so the objects can have different transformations and other properties not stored in a obj file. Objects in the scene

Raytracing

I developed a compute shader ray tracer that can run in (somewhat) realtime. It uses a Top-Level Acceleration Structure (TLAS) and a Bounding Volume Hierarchy (BVH) to test the ray with each object before testing the intersection of the ray and the objects triangles. The BVH construction uses the Surface Area Heuristic (SAH) to optimize splits so that the boxes have a better split than a simple sorted split would. I was inspired by [Sebastian League's] videos as well as my previous Raytracing experience, along with a blog journal about BVHs by Jacco Bikker. The change from CPU raytracing to GPU raytracing meant that the traversal was done using a stack rather than the classic Whitted style recursive algorithm used in the first coursework and the Raytracing in One Weekend books. Raytraced Scene

Transparency

I implemented Blended Weighted Order-Independent Transparency to handle transparent objects like the diving helmet and the submarine windows. The technique uses a modulation color buffer and an accumulation buffer which it then composites to achieve a aproximation of transparency. Transparent Helmet

Text Rendering

The text rendering is achived using bezier curves to outline the glyphs parsed from a TrueType Font (TTF) file. In addition the the parser, I also wrote a manager for text, that means each glyph only is sent once the GPU while seperating the characters and spaces correctly. The goal was to use ear clipping to fill in the text outlines, however this was not finished. Text Rendering

Other Features and Techniques

The project also includes multisampled FBOs for antialiasing (only worked with opaque objects), bindless textures to allow the compute shader ray tracer to access all material textures at once, and a cubemap skybox.

About

A repository for the coursework completed at my University's Graphics module

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published