portfolio/content/posts/graphics-nothing-to-pbr.md
2024-05-10 10:28:44 +01:00

27 lines
2 KiB
Markdown

---
title: "Graphics: Nothing to PBR"
date: 2023-11-07T15:17:49Z
thumbnail: /thumbnails/graphics.png
tags: ["c++", "opengl", "glsl","cmake", "3d maths","games"]
---
I am someone who is fascinated by graphics programming, the creation of game engines and all things low-level. Here I've taken the time to create a proper graphics pipeline in order to create a PBR rendering system. I'll likely reuse the shaders and model loading classes in future projects but for my next personal graphics project I'm tempted to pick up some Vulkan and make greater use of namespaces and more modern general C++ programming paradigms to make something more robust to build on top of.
{{< video "/projects/videos/pbr-norm.mp4" >}}
## What steps did I take.
I'm writing what I did up a little while after the fact, but he major steps I took were:
- Setting up CMake/SDL/Opengl Boilerplate.
- Implementing Camera Movement
- Giving objects their own classes and world space
- Loading in models and textures
- Implementing PBR (Physically Based Rendering)
- Implementing Normal Maps.
Much of what I implemented here was made possible by [LearnOpenGL.com](https://learnopengl.com/) and [3Blue1Brown's series on Linear Algebra](https://www.3blue1brown.com/topics/linear-algebra), as well as my time as an undergrad at falmouth.
### Setting up SDL/Opengl Boilerplate.
So back in the second year of my undergrad in computing for games I had worked with SDL and OpenGL to render some terrain in C++. The only problem being is that in my time since then I've come to hate my reliance on Visual Studio and undergrad levels of programming style at the time.
This pushed me to finally get some C++ build system knowledge and go through the initial stages of LearnOpneGL.com's tutorial using the libraries I prefered. At the time I wanted to keep to one library ecosystem and using SDL-image with SDL made more sense than using a separate header library stb_image with glfw3. Before long I had a simple textured square.
![Textured square](/posts/graphics-nothing-to-pbr/gl-boilerplate.png)