3D Computer Graphics

Modern OpenGL GUI Application
Development Time: 1 Month
IDE: Visual Studio 2013
Middleware: Qt, SOIL, ASSIMP, GLEW, GLM
Tutorials/Sources: Jaime King LearnOpenGL
3D Models created by @amandasaenz
Crysis 2 Nanosuit created by foorestpl
Overall Goal: Become comfortable with a modern rendering API of video games Also, follow the rendering pipeline of 3D models from triangles to complex realistic scenes.
Description: The world of Ozil. I wanted to created a 3D scene of a video game and let anyone who sees this scene come up with their own description of what they think is happening

Implements these Concepts:
Surface Normals
GLSL Shader Programming
Vertex Buffer Objects
Vertex Array Objects
Environment Mapping (Refraction & Reflection)
Phong Illumination (ambient + specular + diffuse)
Blinn Phong Illumination (ambient + specular + diffuse using halfway vector)
Shadow Mapping
SkyBox via CubeMaps
Complex Mesh Loader (.OBJ)
2D Textures
CubeMap Textures
Multiple Frame Buffers (used in shadow mapping)

Game World Iteration 1

Showing of first iteration of the cubemap, texture shader, material shader, phong shader, and different primitives.

Game World User Interface with QT Toggles

Incorporates Blinn Phong Illumination Model + Shadow Mapping + Skybox + Reflection Cube(Environment Mapping)


Welcome to the application gallery. We will start from the most basic impementations to the most complex.

Materials + Phong Illumination Shading

Materials are being passed through a struct into a shapegenerator class. It generates shape data into a nice package so a user can handle the sending the data down the graphics pipeline.

Complex Mesh(.obj) + Blinn Phong Shading

A complex mesh (vertex data) is being loading through an Assimp loading .obj file loader and a simple blinn phong shader is hitting the vertex data.

Materials + Shadow Mapping + Blinn Phong Shading

An extra frame buffer is rendering before my main render gathering depth information then using that texture generated by the extra frame buffer to add shadows in the Blinn Phong Shader fragment shader. We are rending the texture from the View direction of the light in the scene.

Complex Mesh(.obj) + Blinn Phong + Shadow Mapping

A complex mesh (vertex data) is being loading through an Assimp loading .obj file loader to generate a crysis model. The same algorithm and process for shadow mapping is implemented.

Skybox + Complex Shading and Model Loading

Rendering the skybox last in my paintGL function because it is more efficient by filling th color and depth buffer first. Then loading in more complex models with more complex shading as seen before.

Skybox + Reflection Shader & Environment Mapping

Rendering of a cube using environment mapping. This is easily achieved due to the fact we are using the direction vector in rendering the texture of the skybox. No multiple frame buffers for each side of the cube are being used in this simple demo so it will not render the objects in the scene and just the skybox textures.

Texturing + Complex Vertex Data

Taking in complex vertex data and texturizing a object seperately by taking in a texture through GL_TEXTURE_2D.

Engineering with the OpenGL API

Camera Concepts (First Person flying through our scene)

Camera has two main instance variables. (Position and View Direction)

Our position of our camera will have a vector position variable + a vector view direction which will be one unit ahead of the position attribute.

Rotations (Horizontal)

Depending on mouse movements 90 px to the left will equal to a 90 degree angle rotation. We pass this in to the glm rotate function which takes in an angle, and the vector we are rotating around which will be our up vector(0,1,0). Then we multiply that rotation by our view direction because our position does not change. We are converting our Matrix 4 to Mat3 because we are multiplying a vec3 by a mat3.

Rotations (Vertical)

Cross Product gives us a perpindicular vector between two vectors. Order matters so we get a positive rotation since we are in a right handed coordinate system. Our strafe direction will be the perpindicular direction vector from our view direction and our up vector. This allows us to rotate along what would be our x axis of our camera.

Movements in 3D

Our position vector is a point in space where our camera is at. Our view vector is what point we are looking at from that position in the camera. If we want to move around in 3D space we scale the view vector down and add that vector to our position resulting in a new position.