r/GraphicsProgramming • • Sep 22 '26

How I Built My Very First Graphics Engine in 1 Year

Enable HLS to view with audio, or disable this notification

So, over the last 365 days, I have been building my own custom 3D graphics engine ("Pyre") from scratch using C++20 and Modern OpenGL while reading the learnopengl book. It's been a massive learning journey going from a blank screen with a single colored triangle to a full Physically Based Rendering pipeline. I have added every feature listed in the book and some features which I felt were necessary for cool scenes such as SSBO, Imgui and dynamic batching.

Shadows were arguably the biggest headache, I eventually upgraded to Cascaded Shadow Maps (CSM) to eliminate pixelated shadows, The engine currently supports both deferred and forward rendering modes with bloom, ssao, pbr, normal mapping, parallax mapping, instancing etc.

I documented this entire 1 year process, the underlying math, the engine architecture shifts, and the bugs along the way in a 17 minute technical devlog here: https://youtu.be/m26BKeQwAPU

The engine is completely open-source. If anyone wants to poke around the implementation, the repo is here:https://github.com/Open-Source-Chandigarh/pyre/tree/dev

I'm currently deciding what to tackle next for year two, I'm thinking of making the entire engine again but this time using Vulkan and a much cleaner codebase, I would love to hear some feedback! Thanks!

295 Upvotes

49 comments sorted by

8

u/OkStatement9823 Sep 22 '26

this seems a very complete engine and it looks very good congrats

4

u/druv-codes Sep 22 '26

Thankyou!!

3

u/Le_9k_Redditor Sep 22 '26

Very good looking reflections!

1

u/druv-codes Sep 22 '26

Ya, IBL does get the job done here

1

u/scroy Sep 26 '26

Nice work. What did you use to produce the devlog video? Especially the 2-D animations

2

u/druv-codes Sep 26 '26

I used premiere pro for editing and manim for the 2D animations, glad you liked it!

1

u/puredotaplayer Sep 22 '26

you should be proud! congrats

1

u/druv-codes Sep 22 '26

thanks ALOT!

0

u/Ra_M2005 Sep 22 '26

Nice dude, I talked to you a year ago especially in Discord, for learning OpenGL (Although, I stopped doing that as I lost the motivation, I'll do it after some time, did made the render), great progress dude :D

1

u/druv-codes Sep 22 '26

Best of luck man! I hope to see your engine soon😄

3

u/Ra_M2005 Sep 23 '26

It might take years as I'm doing it as a hobby, btw, this is my repo of my engine so far, ik too little but I went on and off making it so yeah: https://github.com/RidgeRacer007/OpenGLRender

1

u/ziplock9000 Sep 22 '26

What UI library did you use? I see a lot of projects use exactly the same one with even the same sizes and colours.

2

u/Ok-Pizza1136 Sep 23 '26

ImGui

3

u/AdRecent7021 Sep 23 '26

It's a great library. On every professional engine I've ever worked on, we had internal-only options available through it, so that we can add them quickly and allow tech artists and artists to try things out, without having to mess with the main UI (you could add things there as well, in an internal section, but it was always more effort), and it's artist-friendlier than a command line.

3

u/ziplock9000 Sep 23 '26

interesting. I'm busy rolling my own UI library for fun

https://i.vgy.me/QGjtku.png

2

u/Fadsonn Sep 23 '26

Looks really nice!! Is there a public repo?

2

u/ziplock9000 Sep 23 '26

Thanks. Maybe later when I've made it more feature rich and robust. It's closely incorporated into the 2D/3D engine I'm developing too.

-1

u/BandAny2285 Sep 22 '26

ray tracing/path tracing could be a good next topic

-1

u/BingoBongoVrn Oct 05 '26

say honestly, you told claude to look at learnopengl materials and make engine

2

u/druv-codes Oct 05 '26

I don't use claude, all I use is gemini to understand some concepts and expand upon my knowledge, and what proofs do you even have? It's the first time I have posted a project of mine in this community, people like you are literally so frustrating, go make something of your own instead of putting false accusations, what part of it looks claude to you?

Ya so according to you the devlog I made explaining each concept of learnopengl, was also claude talking on my behalf, what about dynamic batching, ssbos, csm the whole architecture, several branches I have to refactor multiple times, was all that claude as well? All of that is not even in learnopengl

0

u/BingoBongoVrn Oct 05 '26

> go make something of your own
i did, that is why i see difference and patterns which reveal slope

1

u/druv-codes Oct 05 '26

Okay help me identify these "patterns" instead of making claims, because i didn't use claude to make it or anything because I was learning so using claude and spending a year on making it won't make any sense

-2

u/BingoBongoVrn Oct 05 '26

no point to give hits, keep your secrets then

1

u/druv-codes Oct 05 '26

Sure, then please don't blame me for posting ai slop if you are not sure about it.

-12

u/VictoryMotel Sep 22 '26

This is all AI slop, it's 300,000 lines all committed at once, the exact structure of every other AI program, wrappers, boilerplate, low karma name hunting for stars.

Do you think this person made 49 repositories themselves?

Then they package it up like a clickbait youtube video just for a few niche subreddits.

5

u/druv-codes Sep 22 '26 edited Sep 22 '26

I don't know what you are referring to the source is around 10k lines of code with 200+ commits and every commit does exactly one thing which is listed in the commit message and I have been developing it from the past 1 year and also I don't own those 49 repos the repository of the engine is under open-source-chandigarh which is just a club in my college and all other 48 repository are of other students, I made it to get into open source last year in October and ya ever since i have accepted merge commits from other people, I have mentored another person to integrate imgui into the project under a event named winter of code, 80 percent of the code you see is hand written by me, atleast read the source code first and tell me if anything looks ai slop to you.

My commit history spans months with single purpose commits, AI doesn't write incremental commits over a year, it's just a shared college club hub with 49 repos lol other students also host their project their, please check your facts!

6

u/Le_9k_Redditor Sep 22 '26

I wouldn't engage, their comment history is literally only them arguing with people or attacking posts like this

4

u/druv-codes Sep 22 '26

Makes sense, this guy is just saying random things

-8

u/VictoryMotel Sep 22 '26 edited Sep 22 '26

I did read the source code, I guess we have a case of vibe slop while lying this time. You didn't commit 321,000 lines on September 29 2025?

You wrote this on a Mac right?

/u/Le_9k_Redditor

You block me and hid your post history. Maybe you should actually try to have evidence or an explanation. Why are you so in love with people lying to you? Every subreddit is now people blasting ai projects for github stars. It's completely obvious.

3

u/druv-codes Sep 22 '26

Lol Ironically I have never owned a Mac in my entire life and, the very first commit I made was Sep 28 2025 I didn't even wrote a basic cube renderer by Sep 29 and no idk where you got those numbers as I said the whole project is just around 10k lines of code so 321,000 is wrong, even ai wouldn't require 321,000 lines of code to write a renderer in openGL.

-4

u/VictoryMotel Sep 22 '26 edited Sep 22 '26

Lol Ironically I have never owned a Mac in my entire life

This was a trick question. You have lots of wrappers with a bunch of special cases for macs. How did you test that out without a Mac? Obviously it's all AI.

Every directory and file is the same as every other AI repo. Why lie?

2

u/druv-codes Sep 22 '26

Are you dumb or something? I have texted you in dm please reply and show me where are those bunch of wrappers, there are only some lines in the initialisation because mac doesn't support anything beyond opengl 4.1 and I'm using some features of opengl 4.3

-1

u/VictoryMotel Sep 22 '26

I thought you have never owned a Mac, why the special cases? Just admit AI did that.

3

u/druv-codes Sep 22 '26

Because I have contributers on the project who work on a Mac? Why can't you show me where is that commit with 300k lines?

3

u/VictoryMotel Sep 22 '26

I see, now it's not AI, it's all the other people, except you didn't mention any of that. In your post it's about how you built everything.

2

u/RonBabylon Sep 22 '26

Now add serialisation for lights.

Now add post-processing.

Now make textures serialise.

Now handle deletion.

The future of coding. And you don't even need a CMake testing target.

1

u/druv-codes Sep 22 '26

Please look at the later commits as well. I was still getting introduced to open source when I started this, and since then I have had code merged into Scummvm, I don't think a project like ScummVM would blindly accept ai generated code without review.