HNHacker News
TopNewBestAskShowJobs

ggambetta

6,991 karma · joined August 12, 2013

Member of Technical Staff at prometheus.ai. Ex-Google, ex-Synthesia, ex-Improbable. Author of "Computer Graphics from Scratch" (http://gabrielgambetta.com/computer-graphics-from-scratch). Used to run a game development studio and teach Computer Graphics in university. Tech website: http://gabrielgambetta.com

Actor / filmmaker: http://gabrielgambetta.biz

submissionscomments
ggambetta··on Divide by depth for instant 3D
You can do rotations and translations "via linear algebra" without homogeneous coordinates (the 4-element tuple representing a 3d point or vector), since adding two vectors is linear algebra.

What this lets you do is composing multiple transforms into one matrix multiplication instead of a sequence of multiplications and additions; that's what dramatically increases performance, on modern computing devices but most especially on ancient ones, where we were fighting for every MUL.

More details: https://gabrielgambetta.com/computer-graphics-from-scratch/1...

ggambetta··on Grim Fandango Puzzle Document (1996) [pdf]
I hope a similar document surfaces about Monkey Island (or even MI2).
ggambetta··on English: A vs. An
Not a pirate but a Spanish speaker.

Interestingly,

He's a doctor [in general] -> el es médico

He's the ship's doctor [this specific ship] -> el es el médico del barco

He's a ship doctor [generally works in ships] -> el es médico de barco

ggambetta··on Coyote v. Acme (1990)
Can't wait for the movie. I grew up on Roadrunner cartoons (among others, most notably Top Cat and Scooby Doo), and some of my earliest childhood drawings are elaborate diagrams of traps to catch the Roadrunner, with detailed if implausible Rube Goldberg mechanics. The Coyote might have nudged me towards engineering, not even joking.
ggambetta··on Risk Engineering
Hence DiRT or whatever they call it these days
ggambetta··on Software rendering in 500 lines of bare C++
My book tries to be as accessible as possible; a high schooler with little to no knowledge of linear algebra should be able to understand all of it. So in every case I've chosen simplicity (code and/or conceptually) over performance, but without sacrificing correctness. Not always an easy balancing act!

I would not recommend anyone to write a production rasterizer using the algorithms in my book. This website seems more performance-focused (Bresenham is the obvious choice to draw lines, for example).

Specifically about clipping, you can ignore all the planes except the near plane, and everything will be fine. You'll try to draw more pixels outside the canvas but that's just slow, not problematic. The near plane does protect you from divisions by zero and from points with negative Z, which project upside down and mess things up.

ggambetta··on Software rendering in 500 lines of bare C++
Thanks for saying that :) Have you built something based on that idea? I still haven't, but I'm thinking on throwing some Claude at it for the most mechanical parts.
ggambetta··on Software rendering in 500 lines of bare C++
I have a whole chapter on that! https://gabrielgambetta.com/computer-graphics-from-scratch/1...
ggambetta··on How to stop Claude from saying load-bearing
Yes, and that actually sharpens my previous conclusions.
ggambetta··on How to stop Claude from saying load-bearing
That's the unlock!
ggambetta··on Agnes Callard’s theory of the uni-context
So it's not a one-word theory, it's a theory with a one-word name... shocking. What a clickbait title!
ggambetta··on What are Forward Deployed Engineers, and why are they so in demand? (2025)
They used to be called "Sales Engineers". They still are, but they used to, too.
ggambetta··on How we can reduce traffic congestion
I'm pretty sure I submitted this idea to the internal "file a patent" drive they were doing like 15 years ago. It was rejected. I thought it was either stupid or too obvious and they were already doing it...
ggambetta··on Why I Stopped Arguing with People
For me it was "There’s a clean exception to all of this, and it flips the entire logic." and "here’s the reframe". That's Claude-speak.
ggambetta··on Soccer Arcade Games Through the Years
No Striker? [0] Zero realism but incredibly fun to play. IIRC it had a two-player mode (sharing the keyboard) that was super fun.

[0] https://www.mobygames.com/game/12380/striker/

ggambetta··on How's Linear so fast? A technical breakdown
I was thinking exactly the same thing, this is CSP/SR. One of my favorite topics! https://gabrielgambetta.com/client-server-game-architecture....
ggambetta··on Delacroix's Entry of the Crusaders into Constantinople Restored
I've read that. I'm not part of the conservator community, I just really enjoy the videos.
ggambetta··on The Pentagon is running an AI propaganda mill targeting Latin America
I fully agree with you. However, when non-LatAm people talk about "socialism", they probably think of European-style socialism, which is awesome. LatAm socialism is a lot more extreme, and closer to full-on communism - my country still has people stuck in the 60s cold war era mentality and fully supporting the ideals of of the Soviet Union, still praising Cuba and Venezuela, reality notwithstanding.

European-style socialism would be better. Full 60s socialism would be significantly worse. It's quite likely that people ITT are using "socialism" to refer to either, and we're all talking past each other.

ggambetta··on Delacroix's Entry of the Crusaders into Constantinople Restored
They should just trap Julian Baumgartner inside for a month, with nothing but water, food, and conservation-grade varnish and reversible pigments, and the whole place would look like new!
ggambetta··on The Pentagon is running an AI propaganda mill targeting Latin America
It seems you're not from LatAm.
ggambetta··on Show HN: I reverse-engineered the world maps of Test Drive III (1990 DOS game)
That's a great idea! Just haven't gotten that far yet (that article is pre-LLM, and I'm very early in a new AI-driven reconstruction). But yeah, taking the original extracted sprites and having Nano Banana upscale or redraw them is a great idea.
ggambetta··on Show HN: I reverse-engineered the world maps of Test Drive III (1990 DOS game)
I'm very happy to see this! Not so much because of TDIII (which I played, although not nearly as much as Stunts), but because there seems to be some momentum building around recreating old games using AI agents, and I love that! I had explored some related ideas [0] but throwing Claude at the problem seems super promising. The recent Crimsonland thing [1] was great!

[0] https://www.gabrielgambetta.com/remakes.html

[1] https://banteg.xyz/posts/crimsonland/

ggambetta··on The four programming questions from my 1994 Microsoft internship interview (2023)
Fair, I wouldn't have been able to write Bresenham back then (or now, off the top of my head). I'd have written a simple trig-based one. Maybe I'd have failed the interview :D
ggambetta··on The four programming questions from my 1994 Microsoft internship interview (2023)
So at the end of each run increment the relevant pointer by (pitch - w) not pitch which I'm sure it's one of the bugs they saw all the time in this interview :)
ggambetta··on The four programming questions from my 1994 Microsoft internship interview (2023)
Thought the same. Reckless today, literally standard back then.
ggambetta··on The four programming questions from my 1994 Microsoft internship interview (2023)
This brings back memories! I could easily pass this interview today, because I used to write code like this all the time 25 years ago doing gamedev (and so did everyone else to some extent). But the really interesting thing is that I just realized I haven't written code like this in a long, long time.

Programming has changed over time, but the change has been so gradual I hadn't even realized this until this article. These days I'm pondering how the profession has changed in the last 2 years due to AI. Feels a lot more like a step change. And yet I'm having more fun than I've had in a long time, both at work and at home, throwing Claude at problems. I still don't fully understand why.

ggambetta··on Voxel Space (2017)
What I'm hearing is that the smoke in smoke tests comes from the oil tanks!
ggambetta··on The dead economy theory
> And the public funded the research that made it possible. The transformer architecture,

Errr pretty sure that was Google?

ggambetta··on Let's compile Quake like it's 1997
The whole thing compiles with 2 warnings. Incredible codebase. John Carmack definitely was/is on a different level.

Back when I was making videogames I followed a similar philosophy. No warnings (but in an orders-of-magnitude smaller and less complex codebase). Crash on failed asserts, used liberally, in debug builds. Not sure why but it seems that gamedev doesn't do this kind of rigorous engineering in general (or at least it didn't back then -- and admittedly I never worked in a big studio).

ggambetta··on Matrix Multiplications on GPUs Run Faster When Given “Predictable” Data (2024)
Thanks for the detailed explanation, I had no idea about any of this.
Page 1 of 34Next →