Elgen provides a lucid breakdown of PVS optimization that bridges the gap between classic BSP logic and modern engine development. His journey exemplifies how deep technical curiosity can transform complex spatial mathematics into elegant, high-performance systems.
Deep Dive
Prerequisite Knowledge
- No data available.
Where to go next
- No data available.
Deep Dive
Beyond The Source Engine, Part 3: Paving The WayAdded:
At the end of last year, my engine Chisel could make games. This year, it would become easier, smoother, and cleaner. Something I'd actually want to make games with. This will cover all of 2025. We ended off the last installment by installing the last few fundamental features of the engine, lighting, reactivity, light map improvements, AI, terrain, etc. There would be significantly less brand new features this year, but everything would be reworked from the hack together nonsense I'd written the year prior into a much more clean, usable state. Optimizations and many other improvements that finally turned it from just some hobby project to more of a full-blown engine. During this time, I'd also been working at a pizza shop just down the road from my house. Something to give me some spending money and let me build up some savings while I was still in high school. It wasn't exactly glamorous. I felt the constant tension of just how far removed it was from anything I'd actually want to be doing, which is fair enough for an entry-level line cook, I suppose. Seemingly out of nowhere, though, I did notice something on one of my then routine walks of taking the trash out. Obviously, everything we see is the light that bounces into our eyes.
But that means everything we see also illuminates things around it, even if dimly. As I was looking at the clouds, trying to determine if it would rain or not, I realized that the blue sky itself would have to be illuminating the ground as well. So, I looked at the building ahead of me, and sure enough, I realized why outdoor shadows had a beautiful tint and fill that my engine lacked.
Atmospheric lighting. I'd obviously been aware of it up to that point, but had never really consciously realized it until then. The next few hours of work were torturous, as I was eager to get home and implement it as soon as possible. The solution I came up with has remained largely untouched since. I decided to check for each luxil the amount of sky it could see by casting random rays in a hemisphere facing the direction of the luxil's normal. These would be accumulated, averaged, and multiplied by the ambient color and intensity defined by the directional light inside the map. My first test was a nice simple overcast look, and I think the results somewhat speak for themselves. After that, I was on a visual kick. The textures I had were subpar to say the least and lacked cohesion. After finding my legally obtained copy of Substance Designer, I followed some tutorials and gave it a shot. I recreated most of the existing textures in Substance and modified them further from there. Still not perfect and they definitely need to be redone again, but I was a lot happier with how they looked. Around this same time, I stumbled upon a paper by Valve covering a technique called radiosity normal mapping, a three basis light mapping technique that allowed normal maps to be used alongside baked lighting, adding visual fidelity to otherwise lowresolution light maps. I would later make a whole video about this, but we'll get to that. The paper also had some other interesting gems, like the half Lambert technique Valve used for character lighting to soften the effects of direct light. The three basis technique turned out to be a bit easier than I expected. I applied half Lambert globally to all models, not just characters, and finally added some specular lighting that was, I would later find out, extremely incorrectly written. With all of that done, the next time I booted up my work in progress game, things look substantially different in a much, much better way. It started to develop what is now Chisel's visual identity. Aside from the annoying seams and artifacts I'd spend most of the next year hunting down. What good is a game you can't touch, though? or rather that your mouse can't touch. For UI, I'd have been using a very old version of a project called Myra that worked fine, but I'd grown pretty tired of it. I stumbled upon a library called Squid, got it implemented, but it wouldn't take long to abandon it. I'd posted another tease of the engine in the Monogame Discord around this time and received a message from someone.
Turns out this someone had a UI framework of their own, Gum, and wanted it to be the deacto option for Monogame.
We chatted for a while about the framework and after a couple feature requests and some back and forth. I migrated everything over to Gum. I have to say that as it stands today, Gum is a very nice UI library. It's not for everyone or for everything. But for an engine like mine, it fits pretty well and the built-in editor is very helpful.
At this point, I decided that Chisel was at the best point it had ever been, which was true and 100% ready to start making a game with, which was maybe a little bit less true. Nevertheless, I threw together another prototype with bullets, bullet decals, and particles.
This was going to be a real FPS, I told myself. I even modeled my first human character, which I still think isn't all that bad considering the circumstances.
Unfortunately, around the point of adding enemies, I realized I'd jumped the gun a little. no pun intended. And maybe the engine wasn't quite ready for a project like that. The project wouldn't go entirely dead, though. The basic weapon systems would make their way into the FPS template I'd develop the next year, and the character model is still used as a test model for animation practice. Maybe at this point, it was time to breathe. And I thought so, too. I took a moment away from the hectic everywhere at Once work ethic I'd had for the past few weeks and recollected on everything that had been happening. With that time, I also tried to catch back up with school, which had sort of fallen by the wayside. I'd never really had bad grades before. Usually fine, sometimes honoral, but this year was a struggle. Not because the work was hard. It wasn't. I just had a much, much bigger project that I thought was more important. I felt it was wiser to spend my time on this than to worry about some stupid score for a class teaching me things I either already knew or could teach myself if I wanted to. As such, this was the first year I'd ever outright failed a class. I ended up picking up the pieces a little, but still struggled to balance my job, school, and this massive project all at once. Not to mention my social life, which had never really been all too strong. But I had a small group of close friends. I wondered if maybe I could repair that a little when I became aware of a certain movie's upcoming release.
We all agreed to go, mostly knowing it wasn't going to be any good. Luckily enough, we saw it early enough to dodge the chaos that apparently erupted in the theaters later in its run. Going with them made it enjoyable, and I remember having a blast that night. It felt good to get away from everything for a bit and just be a dork with my dork friends.
I maybe would have cherished it a bit more if I'd known this would end up being the last time I'd get to spend time with them like that. The guy on the left and I ended up doing a fun little gamedev thing among a couple other friends. We had set it up in the computer lab and we would go every day after school. The computer teacher even became part of it in a way, but all of that would fall through when, well, we'll get to that. The guy on the right got accepted to Harvard, which is absolutely phenomenal, and I'm happy for him. But he's become very removed from everyone else's lives, presumably from the stress, though it is still unfortunate, even if somewhat understandable. I missed them both a lot, along with the other friends from that period who I wouldn't end up seeing anymore. Snapping back into reality, I'd gotten mostly caught up with school enough to find myself in a very interesting group of people. There's a program that my high school participates in that's aimed at recognizing excellence within certain categories.
It's a relatively large competition that works its way up from school to region to state level. I'd caught wind of it and applied under the computer category.
And after maybe a week, they'd settled on who got in. It was a big event with a whole assembly. And as names kept getting called, I grew more anxious, pretty well convinced that mine wasn't on that list. And then they called my name. We spent the next few weeks talking about setup and how everything should work. Even went and did some tutoring at the local elementary school, which I swore had shrunk to a third of the size it was when I went there. I decided I needed a killer portfolio.
Maybe I wouldn't have a ton of different things to show, but I knew one big thing that I could, my engine. I wanted to level it up even further. and my determination was through the roof. This was when I went down possibly the single most important rabbit hole of the entire project. I embarked on the journey of PVS calling. PVS potentially visible set is the optimization technique largely responsible for how source and quake games run well at all. I highly recommend Matt's ramblings if you want to understand it in depth. PBS is incredibly hard to debug and so complex that I'm still finding and fixing bugs with it to this day, though they're much smaller and more niche than they used to be. In short, at compile time, the compiler figures out from each leaf of the BSP tree what other leaves are visible. A portal is created between the faces that touch on adjacent leaves. A polygon defining the boundary between them, like a doorway. Each portal contributes to a set of potentially visible leaves, which gets combined into the leaf's overall visible set for a solid understanding of how it actually works. I'd point you to the site 3dfps.net, which has a whole series on it with great visualizations. Of course, just because I understood it didn't mean it was easy. Error after error after error.
Why aren't these planes clipping after why are these planes clipping? The competition program was about the only thing pushing me through these early stages. So, of course, it couldn't just be that easy. Maybe a month in, after doing some events and planning more, I was asked to come speak with the program's leader. I sat down in the office, which had been a somewhat routine spot for me around this time for a different reason I'll get to in a moment, and more or less, they told me my GPA was a 2.9. They'd never had anyone else in the program below a three, and so they didn't want me to continue. It seems a bit silly to not have checked that beforehand, but I didn't want to argue about it. So, I went home that day. I was insufferable to everyone around me. Maybe a bit volatile. It was incredibly upsetting news, to put it lightly, but I'd come this far with PVS and with the engine at large, and I was determined to prove, even just to myself, that I could still accomplish this. I slaved away at the PVS system, eventually getting it to a good enough state, then shifted focus and worked on it on the side. I made some improvements to the lighting and did my first comparison in a long time of what it used to look like versus what it now was. It became very clear to me just how far I'd come with the engine and as a programmer. Still clearly a long way to go. I could point out plenty to change in a single screenshot. But remember what it looked like not even one year ago. I'm not John Carmarmac or John Romero or any other John. And in my lifetime I certainly never will be. But for the first time, I didn't really feel like I had to be. For once, maybe being Elgen was enough. PVS was getting to a good enough point. Still rough, but usable. So, I shifted gears before burning myself out. I decided to start focusing on other engine level things that needed to be taken care of. It was finally time for the depressed and decaying physics system to go. I tried to build my own first, but it never got far. So, I went looking for something engine agnostic and easy to integrate. I weighed Bullet, Beu, and Havoc. Bullet didn't impress me in testing, and Havoc had a license I wasn't happy about, so Beu it was. I guess building my own is something I still really want to do. It sounds really interesting, and I have ideas for how I could optimize it specifically for an engine like mine, but I just couldn't find the time and resources to do it. Beu stayed in for a long time before I eventually replaced it with Jolt the following year.
Regardless, having a real physics engine in made things feel dramatically more polished. During this time, I'd also grown tired of Monogame's abysmal audio system and decided to build my own with OpenAL. The after school project I mentioned earlier was built in OpenGL directly, so I was actually able to port most of the audio code from that over to the engine, which saved me a lot of time. It all came together pretty quickly. Then, yeah, it was time. I looked into the sad, desperate eyes of Rock Wall one and pulled the trigger. It had to be done. This was my chance to make Rock Wall 2, cleverly named, I'm a genius, I know, into the best editor I could, keeping in mind that Chisel was a long-term investment. I wanted this to be some of the cleanest, simplest code I'd ever written. I drifted a little from that over time, but Rock Wall 2 started and continues to be far simpler and easier to iterate on than Rock Wall 1 ever could have been. We'll take a moment of silence for what Rockwell One brought us.
Moment over. It only took a few days to get the new editor back to a similarly usable state, and I continued iterating on it from there. On the theme of rewrites, I had grown tired of working around FBX constantly. A reasonable person might have moved to something like GB or GLTF or whatever. I have long since proved that I am no reasonable person, and I decided to make my own model format and model editor. The motivation wasn't as hairbrained as it sounds. One of Rock Wall's greatest strengths is that I was able to completely cater it to my engine and my needs rather than needing to retrofit an existing format to what I already had like some people have suggested I do. A custom model format would do the same.
And future plans like ragdolls or animation handling could be built-in features of the format rather than codebased workarounds. It didn't take too long either. I largely took what already existed for importing FBX files, modified those data structures, and put together a simple interface to work with them. Just like Rock Wall, for a while, everything just felt like it was clicking. The engine was in the best shape it had ever been. The after school project was going well, and I was excited to sit down and work every day.
Map logic, buttons, quality of life things, solid forward momentum until I had to leave public school. Not something like moving away that might open other doors, but more like a pest that wouldn't leave me be no matter how much I tried to ignore it and move away.
There was a lot of drama that I don't really want to get into here. But it resulted in them telling me that I needed to pursue education elsewhere.
So, I went and set up an appointment with a different school about going online. I moved over and that was that.
But even if it happened in sort of an ass backwards way, it was nice to not deal with it anymore. Unfortunately, this did come with a cost. Within a few weeks, I'd lost my spot in that competition program, the afterchool gamedev group, and my role on the robotics team, and now I was losing the last reliable excuse to see my friends in person. I took all the equipment home from the computer lab. The teacher waved and shared his empathy with the situation. I don't think either of us really knew what to say, and that was the last time I spent any meaningful time with those guys. The free time was a bit hit or miss. I started working mornings now that I was able, which helped my sleep schedule, but cramming school into the rest of the morning, left me feeling drained by the end of the day. Progress slowed down for a while, not to nothing, but a lot slower.
I kept at the light mapper, improved my patches and patch blending, and chipped away at miscellaneous things. My parents and I also had more time to connect, which I value deeply, and we put together some new music equipment as an early birthday present. still very new with it compared to using just my computer to make music, but it was a real treat regardless. I did eventually find myself feeling a bit daring, though. Throughout my life, I'd always wanted to make something on YouTube, even just to a small audience. I'd made several channels before to very minimal success, largely from a lack of experience or time. I had a bit more of both now. So, I started making simpler videos on my channel, Jibo. some devlogs first that I would later private and then later a beta Minecraft series that found some marginal success. It was the first time I'd ever tasted any real traction on the platform. And it's really what sparked the idea that maybe YouTube was actually viable for me.
Unfortunately, I was feeling pretty crammed for time. Job, engine, school, and now a blossoming channel. So, I did something that you might think is pretty stupid. I quit my job. I told myself and everyone else that it was because of school, and to a degree it was, but maybe less so than I was willing to admit. There was a larger element. I could feel something in my gut about YouTube, something bigger waiting if I'd just give it the time and effort to find it. I kept making videos for Jibo and still continue to. I was having fun and accumulating a very small and close-knit community. One night, I went out for a very, very long walk. It was cold, but a beautiful cold. I'd left just as the sun had started to set. I'd usually leave my phone home on walks like that. But this time, I decided to bring it and record some footage. When I got home, I had a much clearer mind, which was normal. But I also had this newfound itch to just write down everything I was thinking. It was my first real-time scripting anything, and I decided to couple my writings with the footage from that walk. That became the first video on this channel. I had initially uploaded it to Jibo, but it clashed with the style too much. So, I created this channel to post it on instead. Why does any of that matter? Because even if I wasn't actively aware of it, my mind was now thinking about this new type of content. I liked it as well. The writing, the editing, all of it. So, I made another in a similar style about something a little bit nerdier. This is when I threw together the source lighting video, the video that would catapult my channel overnight and prove that YouTube was indeed viable for me.
It was the cherry on top of absolutely everything in my personal life over those past few months. And it acted as a light in the darkness. It showed me that the content I loved creating could be loved by others and is entirely responsible for you watching this video right now. Maybe that all seems a little tangential to the engine itself. And perhaps it is, but I think the background, all the personal clutter that usually gets left out of videos like this is far more influential on whatever's been documented than you expect. Life happens to all of us. Life shapes everything about us and what we do. And life shapes the conclusions we make about the world. I think about the night I went to see that movie with my friends. It felt like any other normal day. But every event in my life, including that one, seems to have connected to lead me right to where I am. None of that could have happened if any one of those minor events never did.
And that really is where 2025 left me.
My life had gotten flipped upside down a little toward the end. But somehow I still managed to find stable ground and still managed to set a good foundation for the next year. Everything in our time here may seem so isolated and linear. But in retrospect, it becomes clear that what drives our decision and opportunities tomorrow is the product of an interconnected web of all these seemingly disconnected events. I wouldn't be talking to you right now if I hadn't started working on Chisel, lost contact with those friends, left public school, or taken that walk.
And a special thank you to my godly raisins as usual. Spanospy Max not cool.
He is dirty weasel TV and Buzzfey. I really appreciate you guys supporting the channel even during my recent hiatus.
Related Videos
Agentforce NOW AMA: Build with React and Salesforce Multi-Framework
SalesforceDevs
490 viewsβ’2026-05-28
How agent o11y differs from traditional o11y β Phil Hetzel, Braintrust
aiDotEngineer
450 viewsβ’2026-05-28
Re: π£οΈπthepropheduπ2026 GST 103 CLASS (E-EXAM REVISION)
theprophedu
636 viewsβ’2026-06-04
WEB TECHNOLOGIES UNIT-2 | Degree 4th sem BCOM Computers web technologies unit-2 full explanationπ―β
LearnwithSahera
1K viewsβ’2026-05-29
More tests are always better? How to use AI to identify tests that bring little value
Alliance4Qualification
335 viewsβ’2026-05-29
Search Algorithms Explained in 60 Seconds! π€π¨
samarthtuliofficial
218 viewsβ’2026-06-01
People of Game of Thrones using JavaScript DOM
AltCampus
296 viewsβ’2026-05-30
Instagram accounts got PWNed
EricParker
13K viewsβ’2026-06-03











