Screenshot from KPAX coursework. Screenshot from KPAX coursework. Screenshot from KPAX coursework.

KPAX - Graphics and Game Tech Coursework.

The Game Technology Coursework showcases a basic physics engine designed from scratch. Along with it, it demonstrates the OpenGL pipeline implementation with programmable shaders and lighting calculations. Some of the features implemented are:

Physics :

  • Collision Detection - Axis Aligned Bounding Boxes, Sphere-Sphere, Sphere-Plane Collision.
  • Collision Response - Impulse and Penalty Methods.
  • Simple Artifical Intelligence(AI) Implementation.
  • Debug boxes.

Graphics :

  • Render Engine.
  • Programmable Shader.
  • Lighting calculation.
  • CubeMap / HeightMap / WaterMap.
  • Mesh Loading.

Description :

The program was created using C++ in Visual Studio 2010. It uses Open 3.3 graphical pipeline, using programmable shaders (Vertex / Geometry/ Fragment) written in GLSL.

  • Render Engine.
    • Starting framework provided by Richard Davison, TA, Newcastle University.
    • Movable camera – While updating the view matrix every frame based on pitch and yaw from Keyboard and Mouse.
    • Height Map generation with Mesh loading.
    • Index buffers and Face culling.
    • Scene Graphs with frustum culling.
    • Reloadable shader - Compling and attaching shaders at runtime.

  • Lighting Calculations.
    • Ambient Light.
    • Calculating/Setting diffuse, specular and attenuation of the light in the fragment shaders.
    • Calculating Normals to simulate scattering of light and loading predefined Bump maps for meshes to do the same.

  • Transparency – In order to render the transparent object correctly and employ frustum culling. I use node separation and before rendering all the nodes they are sorted into two separate vectors. Then we render the opaque objects first and on top if we render the transparent object.
  •                                     	if(frameFrustum.InsideFrustum(*from)) {
                                                if(from->GetColour().w < 1.0f) {

Physics :

The physics engine of the game is written completely by hand, employing all the calculations as done in any other commercial physic engine. No other third party software or libraries were used in the physics engine.Newtonian mechanics and Semi-Implicit Euler integration is used to calculate linear acceleration, velocity, position and Angular acceleration, velocity and orientation of the desired entity in the game at each frame.

                              V(n+1) = V(n) + Acc(n) * t
                              S(n+1) = S(n) + V(n+1) * t

A collision detections and response method is also employed using impulse and penalty methods.

  • Broad Phase Collision
    • Axis Aligned Bounding Box (AABB) Collision.
  • Narrow Phase Collision.
    • Sphere-Sphere Collision
    • Sphere-Plane Collision

CourseWorkGraphics and Game Tech.

Browse Code(GitHub)

Download Binaries(Dropbox)