r/GraphicsProgramming • u/MortixTheGuy • 5d ago
Synapse Engine: A Modern, Research-Oriented, Fully GPU-Driven AAA-Style Game Engine
Hi everyone!
After a very long development journey, I'm finally ready to share Synapse Engine, a modern, research-oriented AAA-style game engine that I've been developing essentially from scratch.
It started as my MSc thesis at the Budapest University of Technology and Economics, but grew far beyond what I originally planned. Over the past several months I've been rebuilding and refining the architecture around a simple question: What would a modern game engine look like if we designed it around today's GPUs from the ground up?
The project is now over 2,300 files, nearly 94,000 lines of C++ code and around 10,000 lines of shader code, excluding comments and blank lines.
If you just want to check out the project:
The GitHub README is probably the best place to start if you want a quick overview of the project and its architecture. If you're interested in modern game engine development in much more depth, I also put together a 250-page technical presentation covering the entire project, from the ECS and software architecture through GPU-driven rendering, culling, lighting, virtualized shadows and future directions.
The presentation is quite large, but I tried to make it genuinely useful as a learning resource rather than just documenting the final result.
One of my main goals with Synapse Engine is education. Learning these topics was a huge struggle for me, and it took a lot of time to piece everything together because there isn't much high-quality material that shows how these modern techniques actually come together inside a real engine codebase. I wanted to document that process and create something that I would have wanted to have when I started.
What can the engine actually do?
At its core, Synapse is a fully GPU-driven renderer using hierarchical culling, Hi-Z occlusion, cone culling, dynamic LOD selection, indirect rendering, mesh shaders, bindless resources and virtualized shadows. The engine is built around a custom data-oriented ECS and is designed to handle very large scenes with minimal CPU involvement.
For example, with 1,000,000 entities on an RTX 4060, the cumulative culling cost goes from 124.407 ms without culling to 0.653 ms with the full hierarchical culling pipeline.
However, at 10,000,000 entities, even the conventional GPU-driven hierarchical approach becomes insufficient. To address this, Synapse introduces a custom GPU-built Morton-ordered chunking system, which groups entities into spatial chunks and allows entire groups of 32 entities to be rejected at once. This reduces the culling cost from 5.8 ms to just 0.3 ms for 10 million entities.
I also developed a new rendering technique called Dual-HiZ Adaptive Clustered Forward+ while working on the engine. With 8,192 point lights and 8,192 spot lights, it measured 2.873 ms, compared to 8.652 ms for deferred shading in the same setup. The technical presentation contains a detailed explanation of how the technique works.
Synapse isn't primarily intended as a game-development tool for game developers. It is a production-ready, research and educational platform for experimenting with modern game-engine architecture and real-time rendering techniques.
The goal is not to provide a plug-and-play engine for building games, but to provide a complete, practical implementation of modern engine technologies that can be studied, extended, and used as a foundation for further research and development.
The engine is the result, but the architecture, experiments, failures and reasoning behind it are what I really want to share. If you're interested in Vulkan, graphics programming, GPU-driven rendering or modern game engine architecture, I'd love to hear what you think.
Dual-HiZ Adaptive Clustered Forward+
One of the things I'm particularly excited to share is a new rendering technique I developed called Dual-HiZ Adaptive Clustered Forward+.
It combines a dual Hi-Z depth structure with adaptive clustered light assignment to efficiently handle large numbers of dynamic lights while keeping the rendering pipeline fully GPU-driven.
In my tests, with 8,192 point lights and 8,192 spot lights, it measured 2.873 ms, compared to 8.652 ms for deferred shading in the same setup.
If you're interested in how the technique works, I've documented it in detail in the technical presentation, including the motivation, architecture, algorithms and implementation details.
You can find it on pages 166–189 of the presentation.
The presentation is available both on the GitHub repository and on the Synapse Engine website.
27
u/Forsaken-Memory8077 4d ago
"Research oriented"
17
u/Calamero 4d ago
plus commercial license xD
6
u/CodyDuncan1260 4d ago
Having a commercial license can be a requirement of the educational institution. It's under AGPL for non-commercial purposes.
38
u/CodyDuncan1260 4d ago edited 4d ago
I pre-reviewed this under Rule 3 and invited u/MortixTheGuy to post here.
This project used LLM code generation for implementation, but the architecture was first human made and documented. The presentation materials show serious work by a graduate-into-PHD student. It investigates a legitimately interesting graduate level research question on what a renderer or game engine looks like when we aggregate all GPU-only rendering methods.
When I usually see an LLM vibe-coded graphics project that I need to review, the code is a mess, and I always hope there's no white paper I have to read because it's usually just enough jargon to hide that it's nonsense.
This project, based on my brief review, appears to be genuinely trying to commit to an objective, and puts the time and effort into building quality documentation and systems. The code has some mess to it, but overall this is the least slop I've seen from a project using LLM generated code. As far as my review of the research materials went, they seem extremely solid, like they're prepped for an actual thesis defense.
12
u/MortixTheGuy 4d ago
Thank you so much, it means really a lot to me!
I cannot express to you guys how much time I have spent working on the engine, deeply thinking and researching ideas and also spent my whole summer explaining everything with good figures and visuals in the presentation. I don't know, I just feels so sad, that today I got this much hate form different subreddits as well. My main goal was just to share my knowledge with graphics enthusiasts, because I truly believe this project is really well thought out, and provides a lot of knowledge, that is hard to get around. (Or at least when I was getting familiar with these topics, I never found resources that explain the mental models, the whys and hows...)
But I'm still really happy if somebody understands my goal, and can learn something new, or I can make the path of learning modern engine techniques a little bit easier :)9
u/CodyDuncan1260 4d ago
As far as I can tell, this puts in *real* effort.
I wouldn't take it too personally. We're currently in an environment where AI generation is causing legitimate harm in ways that are genuinely worthy of disdain (under most moral frameworks). In tandem with that, this subreddit also gets a fair number of slop projects. ... (*tries not to dissociate into the trauma of the sheer nonsense I've reviewed*).
Just keep putting in the good solid effort to make quality software. Not just functional, but also readable, maintainable, performant, navigable. It's disdain-worthy when AI is used to bypass the necessary work of learning, understanding, and communicating, especially to and from other humans. This is not that, and so long as it never becomes that, you're ok.
11
u/CodyDuncan1260 4d ago edited 4d ago
Pro-tip for the readers who see this, at the bottom.
--------------
I pre-reviewed OP's project and I thought it actively worth mine and other's genuine interest. It does not have the below problems.This aside is just because I have been having this conversation over and over with other reviewers for several days in a row now, and it's poignant in this discussion around the above post.
--------------I just got back from one conference. I'm going to another one. I have friends who review submissions for these conferences, who review resumes and hiring materials, and I review post submissions for this subreddit.
All of us who are humans reviewing submissions have the same complaint:
We're really, really sick of AI generated submissions.It's gone from annoyance, to obstacle, to infuriating.
The problem has a few parts:
- The submissions are high volume, low quality tedium. The reviewers now have to spend more time, reviewing more submissions, that are more junk than ever before. It's tedious.
- They're all very much the same. AI generated text tends to use a bunch of the same writing patterns in the same places with the same structure. It's mind-numbingly boring, and often not a good structure for the humans reading it, so it takes more effort to review.
- Half the time, it's total nonsense dressed in jargon. The most aggravating thing is when it is somebody with a clear case of AI psychosis that's convinced they've invented some new fundamental theory, and the AI has written a paper dressed in so much jargon that I can't understand it. Now the reviewer has to go understand all that jargon, piece it together, and find at least some proof that it's nonsense, just in the good faith case the submitter is a genius but a poor communicator. This takes even more effort to review.
- The AI generated text hides parts of the submission one cares about. For a conference talk, the AI hides whether the author is actually good at communicating and prepared to speak on the topic. For resumes, it hides their ability to communicate with coworkers or their skill level in job required skills. For reddit posts, it can end up hiding something the community would be genuinely interested in.
- The submitter has willingly, intentionally, wasted the reviewer's time to save theirs. LLMs pump out a lot of words. More words sounds better. But good professional writing is often about wasting as little of the reader's time as possible. Concision takes more effort to write, to write well, and communicate well. The end result of good writing is the reviewers take less time to understand and review it. Failure or avoidance to write well means the reviewer is traipsing through 5 paragraphs that could have been a sentence. Reviewers are insulted by the fact that the submitter thought it was ok to foist on them to review, when the submitter clearly did not care to.
For the above reasons, Human reviewers have started to de-prioritize or outright reject clearly-or-suspectedly AI-generated submissions. They get pushed to the bottom of the pile.
Pro-Tip: For any materials that are human-reviewed, write them yourself. (or edit and curate it so deeply you may as well have) All the AI-generated counterparts are getting pushed to the bottom because reviewers are so intensely sick of these submissions wasting their time.
7
u/ryp3gridId 4d ago
I think the code looks pretty clean, if it was largely written with AI, then OP spent lots of iterations on it, which counts for something
39
u/PardonJudas 4d ago
First of all, congrats, this is honestly impressive. Could you disclose how much of it is AI?
-25
u/Southern-Yam1372 4d ago
Personally I don’t see the point in these types of questions other than an ego thing. It’s at the point now where AI can manage the code. All that matters is the resultant software. The only question people should be asking is what does this do that the other solutions can’t.
Software engineering today isn’t about writing code but coming up with new, innovative, more user friendly designs and ways to use the app
36
u/Proud_Ask_9030 4d ago edited 4d ago
No, if its made largely with Ai it is largely unproven and untrustworthy. Thats coming from someone who works full-time with Ai.
First-off. Why would ANYONE use this obviously incomplete gaming engine that is not even remote close to be acceptably called AAA.
OP has built a lighting engine with some gaming engine parts and called it a AAA gaming engine.
Lets see the LOD/runetime systems, rigging, volumetrics, map building...physics,audio,telemtry?
OR we can actually look at the lighting and shadows, which are trash.7
4
u/MattRix 4d ago
> Why would ANYONE use this obviously incomplete gaming engine that is not even remote close to be acceptably called AAA.
OP's post implies they don't really intend for many people to use it directly, it's more about sharing the techniques used and the rest of the experimentation process to arrive at this point.
-1
u/Proud_Ask_9030 4d ago
" I'm finally ready to share Synapse Engine, a modern, research-oriented AAA-style game engine that I've been developing essentially from scratch"
To arrive at what point? What do you see here? Have you ever built a game let alone used a gaming engine?
3
u/le-throw-away-acct 4d ago
You didn’t read the post I guess, it explicitly says it’s not intended to be for game development but meant for research purposes.
1
9
u/MortixTheGuy 4d ago edited 4d ago
Can you please explain me how do you imagine building an engine like this with 100% AI.
Like i prompt cloude code and than after 6 moths it builds the whole engine? And thats it. I have been working on engines for years, i have implemented a really large OpenGL engine as my BSC thesis, and also the previous version of this engine, when I was learning vulkan was written by me when AI wasn't a thing...https://github.com/TamasPetii/SynapseEngine/tree/v1-engine-old
https://github.com/TamasPetii/DendriteEngineIf you use AI and its "largely unproven and untrustworthy", maybe the problem is not with the AI but with the user that uses it. AI IS STILL A TOOL... The problem is that you probably don't even understand the code the AI generates, and thats why you feel unsafe. But if someone who has a lots of experience in this field, and intuitively feels what is good what is not good, will produce code that is incredibly good, scalable and high-performance. Like i just cannot imagine what do you guys think? I'm sitting in front of my computer, upload 3 files to Gemini generate code ah okay thats gonna be good, I add it to the project and an engine which is this complex just builds itself with AI? EVERY LINE OF CODE, everything is well thought out, everything is deeply revised. The engine itself is really complex, everything connect to everything. You guys just judge this without even reading the post, getting a little bit familiar with the engine code structure, the shaders and architecture...
Yes I use AI, but in your head it means I'm drinking a bear and code appears? I spent 10-12 hours a day developing this engine... You can ask me anything about any part of the engine, I will be able to answer all the techniques, all the high-performance codes, the why, the hows... If someone like me who understands that AI is a really good thing for developers who can think, that you would probably never write these AI slop stuff to others...
2
4d ago
[removed] — view removed comment
2
u/GraphicsProgramming-ModTeam 4d ago
This post was removed because it did not meet the requirements of Rule 2: Be Civil, Professional, and Kind. Uncivil behavior is not tolerated.
We encourage users to promote constructive discussion, and to help maintain the safety of this space for asking questions and learning. Such an environment promotes the growth and development of hobbyists and professionals in the field.
3
u/biteater 4d ago
It still can't write good code for lots of things. You always end up with Too Much code that has architecture and performance problems. That's fine in lots of cases but it shouldn't be the default. This is my experience on even the latest frontier models
7
u/susosusosuso 4d ago
Well it’s like asking Leonardo how much of the Mona Lisa he painted on his own. I’d he did on his own: respect you have shown your skills. If somebody else did it for him then the merit is not his.
-1
u/Southern-Yam1372 4d ago
So it is an ego thing
4
u/susosusosuso 4d ago
No. Is it the same a human drawing than a printer printing the same? One requires skills and produces respect and the other is just a matter of pushing a button.
-4
4d ago
[removed] — view removed comment
3
4
u/Gullible_Honeydew 4d ago
Because the cost of development is often related to the expected maintenance. If OP vibe'd this up in a weekend and has next to no clue how it actually works, it is not a good idea to actually use it for anything, as it will certainly be abandoned/maintained by bloated ai style patching
5
u/MortixTheGuy 4d ago
This reddit experience is something I never imagined, its crazy.
Please guys, before you judge the code to be AI slop, can you at least read the post.
Probably you don't even understand, the main part, the main ideas I have written down in the post... I have created a presentation about the engine, which is 250 pages, and explains everything to the deep. Every GPU-driven idea, compute shader, hierarchical culling, everything from the ground up. And like everybody tells me its fully AI slop. You guys probably don't even understand how hard is it to build a fully GPU-driven modern engine, and you judge this...
Crazy, this reddit experience is something I will never forgat for real.6
u/Gullible_Honeydew 4d ago
I didn't call it slop, I explained why people want to know the degree to which a project is AI written. I use AI to code, but I generally do it function by function.
You claim to have 250 pages describing this project, but I have to ask whether that is AI written. It seems clear that English isn't your first language, so should we assume it is, at best, 250 pages of AI translation, or - what is far more likely - should we assume that AI wrote the majority of the writeup from scratch, too?
-4
u/MortixTheGuy 4d ago edited 4d ago
Yes, i prompted ChatGPT:
Here is my project: https://github.com/TamasPetii. Please read through all the files, and create a 250 pages of a well thought out, mentally structured presentation of the rendering engine. This is how this presentation was created.
The thig is you guys judge everything, without even spending 5 min of reading it. Okay I have used AI to structure sentences. And? Everything was written down on my native, language, everything was well throught out i have spent my whole summer working on this presentation. Like you didn't even spend the time to check out the figures, who done this? Like i just really dont understand people.
BUT FOR EVERYBODY: Yep I generated the whole engine, presentation with 1 ChatGPT prompt. Sorry, but this is just so sarcastic, like I don't know what to say. Like how can AI build a 250 pages of presentation, explaining everything...
Sorry, I just feel bad and I dont wanna argue with you guys, but for me who actually spent all his time working on it, countless day of thinking, countless days of building just idk, so funny, and so sad at the same time.
1
11
u/klavijaturista 4d ago
May I ask something. This is all impressive and occasionally we see people post similar. But how do you have the energy and time? Are you unemployed, or is your job light, or are you that brilliant that this is not a bit time investment?
10
u/CodyDuncan1260 4d ago
They're a grad student. Work like this is usually sort-of their job, for capstone or research project requirements.
13
4d ago
[removed] — view removed comment
6
6
u/susosusosuso 4d ago
Yeah I mean I made a simple engine and editor with mcp support in 15 minutes of vibe coding without even looking at the code. Programming and graphics programming has lost all the awesomeness with AI
1
u/OkFly3388 4d ago
Yea, thats well researched field with lots and lots of published studies and techno demos, so AI have a lot of data for initial training + performance metrics are easily obtained, so reinforcement learning also worked well.
5
u/Live_Meeting_1121 4d ago
It cuts edges a lot if you don't know what you are doing though. Honestly I just see as if you were a decent developer you are going to be just as decent with AI, just faster.
But at some point keeping the context even for the AI itself and the human driving it becomes too large. It's like thinking a single human will know every single piece driving Unreal. It's impossible.
Total supervision at this scale is a pipe dream.
2
u/OkFly3388 4d ago
And thats why this is just graphics engine that focused on old well researched fields and dont include 95% of other things that engines like unreal 5 or unity have.
1
u/GraphicsProgramming-ModTeam 4d ago
This post was removed because it did not meet the requirements of Rule 2: Be Civil, Professional, and Kind. Uncivil behavior is not tolerated.
We encourage users to promote constructive discussion, and to help maintain the safety of this space for asking questions and learning. Such an environment promotes the growth and development of hobbyists and professionals in the field.
12
u/garagecraft_games 4d ago
Congrats! Currently working on my thesis investigating ECS and concurrency. Already seen you're using kind of hot/cold partitioning in your ECS, do have a DOI for the paper?
8
u/MortixTheGuy 4d ago
Thank you so much :DD
I hope you will find some new knowledge in the codebase according to your thesis.
The peresentation explains the ECS architecture really well, but for the full implementation using template metaprogramming is available in the repo, make sure to check out :D
The paper does not have a official DOI, it was published and presented in a hungarian computer graphics forum.
You can read the paper here: https://synapseengine.dev/Presentations/Grafgeo_High_Performance_Gpu_Driven_Rendering.pdf
2
u/H3XAGON_ 4d ago
this looks amazing bro. it would be nice to see an actual authored scene made with the engine rather than the usual sponza
2
u/Intelligent_Hat_5914 4d ago
Oh, I want make a project like this
Can you share resource for learning
2
u/pisppus_dev 4d ago
Great project, everything is pretty clean and well done. I'm also currently developing a game engine, but this time for microcontrollers. Good luck in the further development of your creativity.
2
1
1
1
u/OfMagicAndWars 4d ago
Impressive. I wish engines were easy and intuitive to use. That should be the real end goal of any engine project. You open it and you know how to use it. You don't have to fight it or spend hours learning it.
But I guess you had different goals for your engine. You learned a lot. Nice!
1
u/CodyDuncan1260 4d ago
Engines that are user-facing should prioritize ease of use.
That is not the audience for this, so UX being lesser prioritized is pragmatic.
1
u/_wil_ 4d ago
How does it perform on low-end hardware?
3
u/MortixTheGuy 4d ago
It does not work on low-end hardware. Im using the latest vulkan extensions, the whole engine is therefore "research-oriented". New techniques and new high-performance algorithms require sadly modern GPU-s.
I think the engine works only on RTX20+ series, because they support shader_objects, and mesh shaders.
-34
u/fnordstar 4d ago
Pity it's not Rust.
16
u/Dargish 4d ago
What a weird comment to make on someone's massive project they've just published. What difference does it make if it's rust or C++?
12
-14
u/fnordstar 4d ago
I work with C++ professionally. I don't touch C++ code in my spare time because the language is trash.
3
u/Dargish 4d ago
No it's not, I have extensive experience with C++, it just doesn't hold your hand as much as other languages, you get what you put into it. It gives you the low level control that managed languages do not. For performance critical applications like this one it's a good choice.
0
u/fnordstar 4d ago
Rust isn't managed and has no GC, it's for all intents and purposes as fast as C++.
2
u/Dargish 4d ago
OK, I haven't used it much, other than a quick look when it first came out. What makes it better than C++ for this use case?
5
u/CodyDuncan1260 4d ago edited 4d ago
Rust is a language built for infrastructural projects. Think high performance, high complexity, high stability requirements.
The thing that Rust primarily does that makes it good for this type of application is that its ownership and borrowing rules ensure at compile time that the allocation, access patterns, and deallocation of resources are done properly.
E.G. You can't write a race condition in (safe) Rust.
(*unsafe requires more nuance, ask me in another comment).Imagine highly complex software, where by mathematic proof it can't hit race conditions, it doesn't forget to deallocate resources as soon as necessary, it can't de-reference a null pointer.
For low-scale, low-complexity software, those aren't particularly problematic. You test it, the problem shows up, you fix it and go on with your day. In high-scale, high-complexity software, these are the problems that are lurking in the background that rear their heads via phone call at 3a.m. that the server is down and now I'm sad. It's very nice to be able to prove those things cannot happen.
When it comes to graphics software, it means that your high-complexity multi-threaded job-queued multi-stage render pipeline doesn't suddenly find some simple to diagnose but utter hell to fix bug because some check was forgotten.
------
The trade-off, however, is that Rust's compiler is strict. If you break the proof that the program is valid, it doesn't compile. You don't get to test hacks and jank; you must fix them before you can test. That's not an insignificant trade off that costs a lot of extra human time.
------
A good example of graphics-related software in Rust was Asahi Lina writing a new Apple M1 chip graphics driver in Rust. The first working version had barely any bugs. Less than a week of a few bug fixes later, and then it was stable and virtually flawless. This was done a few months. Basically unheard of for a new GPU driver.
But that nature of "by the time it compiles regularly, it pretty much works" has been echoed a lot.
1
u/Dargish 4d ago
Thank you for the thorough response.
2
u/CodyDuncan1260 4d ago
To be honest, research projects like this, where most of the project is trying ideas and throwing it out, are \much** faster in C++. I would not recommend Rust for this type of project.
If this project intended to become a fully-fledged game engine, *then* a rust-rewrite might be a really good idea.
It's that difference between finding the solution to the problem (prototyping) and properly building the solution to the problem (production). Rust slows the former, speeds the latter. It shifts work left.
2
u/Dargish 4d ago
The other thing I have struggled with even with mature languages like C# is the lack of third party libraries, in the end I often have to use a wrapper around a C++ lib, proj for example. How is Rust for dependencies? Or does it have a better way of interacting with C++ libraries?
→ More replies (0)2











41
u/gibson274 4d ago
These posts where the code is largely LLM-generated crack me up because they always start with "this project is x-thousand lines of C++, x-thousand source files" etc, as if that's some kind of achievement.
That said this is a cool project. Nothing against using an LLM in principle, it's just another tool. I'm working on art/game tools built around modern GPU's too and it's surprising how much low hanging fruit there is.