three-fenestra
Creator & Maintainer
A shader that puts a room behind a window that isn't there
It started with a post
Funny how many of these start on Twitter.
Somebody posted about interior mapping. It’s the trick where a flat window pane shows what looks like a real room behind it, with actual depth, and there’s nothing back there at all. Racing games have used it for years to fill city blocks with windows nobody will ever walk into.
It caught my eye immediately. That’s really the whole appeal, right? It’s eye candy first. You look at it and your brain says that’s a room, and then you find out it’s one flat surface and a bit of math, and the second thing is almost more satisfying than the first.
So I built my own version of it and put it up. And it did numbers I wasn’t expecting, around 3,600 likes, which for a shader demo is a lot. That’s when I figured I should keep the momentum going and turn it into something people could actually use.

Nobody had it for Three.js
That was the gap. The technique is old and it’s documented, but nobody had brought it over properly.
The replies to my post made that pretty clear. A lot of people said they’d never seen it done there, and the few examples floating around were exactly that: examples. Code you’d read and then reimplement yourself. Nothing you could install, point at a building, and get rooms out of.
So that became the goal. Something you drop into a scene that already works, that comes with rooms in the box, and that you can be using in about five minutes. Plenty of people had shown the technique. I wanted to hand over the thing itself.
It has to survive being used wrong
Here’s the philosophy, and it’s the part I care about most.
Nothing broke, exactly. But if you’re building something for other people, it shouldn’t get in the way no matter how they use it. It has to be ready to be abused. Somebody is going to point it at way more windows than you ever tested, apply it in a way you didn’t plan for, and never read the part of the docs where you explained the right approach.
If someone tried it and said “this is so slow,” I’d be straight back in there fixing it. That’s the whole idea of a shader that’s optimized properly. It shouldn’t be stealing resources from the rest of your scene. Point it at hundreds of windows, point it at thousands, and it should be smart enough to not take your machine down with it.
Which turned out to matter, because people immediately started building cities with it. There was a whole run of it on Twitter for a while, everyone making city blocks, and interior mapping was a big part of why those looked good. So the library grew in that direction. Thousands of windows out of a single draw call, each one with its own lit rooms, and detail that fades out gracefully as things get far enough away that you’d never notice.
I’ve got a separate procedural city project that uses it too. That one showcases something completely different, and building it shook out bugs I’d never have found otherwise.

The lights at night
The part I’m quietest about, and probably proudest of, is the night lighting.
I’ll be out walking sometimes and just get caught by the windows on a building. The depth in them, how each one is lit a little differently, the fact that every single one of those small warm rectangles is a person’s home and you’re seeing about four feet into it. It’s genuinely mesmerizing if you stop and look.
And when I see that same thing in my shader, that’s really cool. I took it from real buildings, and now real buildings are the thing I keep checking my work against. I think I nailed that particular glow, the one that makes a window feel like someone exists in there, instead of the boring black reflection most 3D buildings give you after dark.

What came back
Yeah, people showed up.
It’s sitting around 3,500 installs and just under 80 stars, which I’m happy with for something this specific. But the number I actually care about is the demos. People tried it, remixed it, built concepts with it, showed me things I hadn’t thought of.
That’s what open source is for me. You build in public, you show people what you’re doing while you’re doing it, and then they take it somewhere you wouldn’t have gone. That’s when the good ideas turn up.
It was my first time working that way, out in the open the whole time. And beyond the code, I made some really, really good friends out of it. That part I didn’t see coming at all.
Working on something similar?
I'd love to hear what you're building. For me, the best projects start with a good conversation, so feel free to reach out.
Let's Talk