This repository contains an attempt to write a game engine with OpenGL with C++. I barely know C++ and OpenGL, so with this project I'm learning those things too.
To learn OpenGL the following tutorial is used: https://learnopengl.com.
The following functionality has currently been implemented.
- Set up for OpenGL where the render pipeline is set up, and rendering triangles.
- Custom shaders that are compiled and used, with error messaging.
- Support for loading and rendering textures.
- A view-model-projection matrix in the vertex shader.
- A camera model based on a position, target, and up vector.
- Key handling to move the camera (WASD, Shift, Space, Esc).
- Mouse handling for a 'FPS style' camera.
- Mouse scrolling for zooming.
- A single light with Phong shading.
- Materials with an ambient, diffuse, and specular color.
It currently renders 10 different cubes, which come from the same geometry, which is changed with the model matrix before rendering.
Implemented another shader to render the light source, and altered the original shader to use a Phong lighting model. The shading is based on the light and object color.
Implemented materials which can be used to set the ambient, diffuse, and specular components of the Phong model.
If you set this up with Visual Studio:
- Open project settings
- VC++ Directories
- Add the
lib
andincludes
folder to theInclude Directories
andLibrary Directories
. - Goto to Linker Input
- Add the following additional dependencies:
glfw2.lib
,opengl32.lib
.