Custom Graphics Renderer
Description
Here is some progress pictures from a graphics renderer project that I was working on a year ago while learning graphics programming. I was mainly focused on OpenGL, but the idea was to write a general graphics/game engine and add a Vulkan API support for it too.
Testing mesh repeater settings
Testing instancing ( copying all vertex data to GPU and drawing only once )
Mesh pointer
The grid can be navigated by moving around the pointer with keyboard.
Modifying individual mesh properties in a mesh grid
The idea here was that each mesh, or an object would have this 'repeater' setting built in, so that they could be copied to all directions, add padding, rotating and scaling them individually just changing the configs.
Multi select
Meshes can be multi-selected in the 'repeater' grid, and adjusting the transformations all at once.
Materials
Textures
Models
Lighting
Implemented the Phong lighting model, which consists of different components; ambient, specular and diffuse lighting. These are all calculated in the fragment shader.
Here are different types of lights:
Directional lights ( diffuse )
Ambient light is also present, otherwise the unlit side of the boxes would be completely black and the texture would not show up.
Specular maps
This adds the 'metal' effect to the texture
Pointlight fadeout
Spotlight
Multiple different lights
Multiple point lights
Physics
Testing the 'Bullet' real-time physics simulation engine
Terrain
Testing terrain generation with berlin noise
Something's not right
Refactoring
At this point the test code base structure was getting a bit out of hand and I decided to start designing a little bit how it would work better. I was thinking that the renderer would work as an 'engine' library, separately from the game or other use case. I also moved to a ECS ( Entity Component System ) based system, which optimizes the CPU cache for handling the data. I also started to think about how to abstract the graphics API so that Vulkan API could be added later on to the engine.