OpenGL Graphics Framework

 

As part of the Advanced Computer Graphics class at the DigiPen Institute of Technology, we are tasked with creating a graphics framework utilizing the OpenGL API.

My framework is built with C++, Glad, and GLFW.

GLM, STB, and Tiny OBJ Loader are also included for quality of life additions.

Additionally, ImGui is included to provide a user interface with which to change certain parameters of the graphics framework in real-time.

The Stanford Bunny surrounded by orbiting light spheres. The orbs light the scene as a point light, a spot light, or a directional light. The bunny is rendered using the Phong shading model.

The Stanford Bunny surrounded by orbiting light spheres. The orbs light the scene as a point light, a spot light, or a directional light. The bunny is rendered using the Phong shading model.

One of the first big tasks in getting this framework up and running is implementing the Phong shading model. OBJ files are loaded into memory and drawn to the screen with shaders written in GLSL. Features include:

  • support for 16 lights

  • Phong-Blinn shading

  • real-time parameter changes to the model’s ambient, diffuse, and specular terms

  • real-time parameter changes to light properties

Textures are loaded in with the stb-image library. UVs can be generated for the model on the CPU or on the GPU. The texture coordinates can be mapped with cylindrical, spherical, and planar mapping.

opengl_gfx_framework_02.jpg

Debugging and changing properties in real-time.

The ImGui interface allows for changing and viewing various parameters in real-time. Different models can be loaded in dynamically, material properties can be modified, and certain rendering features can be turned on and off.

This has been crucial in the development of the framework to ensure that work-in-progress features are rendering properly.

A skybox is rendered with depth testing turned off in order to appear in the background.

Cube mapping is implemented by rendering the scene 6 times to an FBO from the perspective of the object.

Reflection and Refraction sample from the generated cube map after appropriate reflection and refraction calculations for each fragment.

Rendering of the Power Plant model which consists of 12,748,510 triangles. 4 different render targets as part of deferred rendering are visualized at the bottom of the screen.

Rendering of the Power Plant model which consists of 12,748,510 triangles. 4 different render targets as part of deferred rendering are visualized at the bottom of the screen.

Previously much of the project has been rendered using forward rendering. Now the scene can be rendered with a combination of deferred rendering and forward rendering.

Objects such as these high poly power plant models are marked for deferred rendering. Various elements of the model are rendered to render targets part of a g-buffer. These targets are then combined for a final lighting pass.

More light-weight debug objects such as the light orbs and vertex normals are rendered after the deferred rendering pass using forward rendering.

More features to come:

  • Visualization of more debug objects such as model bounding volumes

  • Performance improvements utilizing bounding volumes and object culling

Previous
Previous

DeltaBlade 2700 Re:Create

Next
Next

Infinite Supernova