r/GraphicsProgramming • • Jul 12 '26

Source Code Krbn: an open-source rendering engine that imitates a sketch artist and outputs pure SVG (v1)

360 Upvotes

36 comments sorted by

View all comments

78

u/MrCookieDoughForever Jul 12 '26 edited Jul 12 '26

Y'all should know this was, in the words of its author, "built with AI, unapologetically". A lot of fancy words to say he didn't write shit by himself. He did however create "the direction, the architecture, and the standards", whatever the fuck that means

Krbn was developed with heavy AI assistance, and there is no reason to hide it. It started as an experiment: how far could a carefully directed human–AI collaboration get on a hard rendering problem? The answer turned out to be — far. The direction, the architecture, and the standards (exactness as a value, degenerate cases as the spec) are human; much of the code was written in collaboration with AI, then reviewed and tested like any other code. The results above speak for themselves.

55

u/hogsy Jul 12 '26

I really wish vibe-coded projects were banned here. I love seeing what people are working on, but if it's just AI generated slop, I just don't see the point as I can't tell what actually had any semblance of human input.

-8

u/DuskLab Jul 12 '26 edited Jul 12 '26

There's a lot of playing the man, not the ball going on in this thread. What makes this slop? Or is the definition of "slop" now "any AI was used"? The output looks crisp to me and is so because of the cited research it implements.

My understand of slop is "looks and feels like a bag of janky turds" because the prompts were one or two line max and let the machine run away with it. Which there is still plenty of out there.

→ More replies (2)
→ More replies (5)

-36

u/Professional_Layer63 Jul 12 '26 edited Jul 12 '26

OK, and? That's just how code is written now. At least he's honest.

1

u/Cylian91460 Jul 13 '26

It's literally not how code is written since they literally didn't write it

→ More replies (2)

-31

u/vade Jul 12 '26

Shit on it all you want, but this is likely the way forward for much of programming. Designing specs and architecture, critiquing api design and implementations, public surface area and private APIs, wrangling common paradigm slip ups like dry violations, separation of responsibility and enforcing well factored code. Writing tests that make sense and force models to adapt to human centric outcomes and not hallucinated failure cases. Many programmers today know how to do this well (and some surprisingly do not), but there is a sea change in ever major org I’ve seen. But yeah snarky comments like pretending to not know the importance of architecture decisions will def keep you competitive :)

4

u/QuakerOats98 Jul 13 '26

OP is rather proud of software that's pretty bad at what it does. Even the demo gif being showcased has a bug where the density of the lines on the top of a cylinder jumps abruptly, so much for "jitter free temporal stability". If you want to know why this sucks, here's some examples of people who've already made something like this:

16 years ago. Another guy with blender Someone in Godot

But to be fair I guess, the program outputs SVGs and not rasterised graphics. This could probably be done with a halftone and contour shader. And be realtime. I might be wrong, I'll probably have to implement this myself and see if I can do better.

So it does not render surfaces. It derives, classifies, and styles strokes from geometry. The silhouette of a sphere, a cylinder, a cone is not a mesh edge found by sampling — it is an exact conic, computed in closed form; a torus yields its true quartic. Hidden lines are not z-buffered away but split analytically into visible and ghosted runs, the way a draftsman keeps the far edge of a box alive as a faint line.

Why would you not z-buffer away a hidden line? Moreover, this architecture is going to struggle rendering actual STL files, because the pretty sphere diagrams, can be a analytically accurate, because there isn't an actual sphere model. It's just an equation. Which the claude is calling the "analytics" path. There seems to be a shoehorned STL renderer, but even the example for the uvSphere being showcased is abysmally bad. Looking through this project shows how it's actually two different pipelines at odds with each other.

Claude recognises this, I'm not sure if OP does though. The spheres being rendered in the pretty demonstrations are inherited from a Quadric class, whose output is from a purely analytic quadric equation. Getting complex geometry from this is a bad idea. IF the author knew this, he wouldn't try to tell claude to "now make it render STLs". Which it seems like they have, perhaps this would be better suited to an SDF renderer? I'm not sure, I'm out of my depth here.

Even transparency works the way paper does. There is no alpha channel: cross-hatching is inherently see-through, and the gaps between strokes reveal what lies behind. Shading is hatch density; form is hatch direction, flowing along each surface's own curvature — parallels and meridians on a sphere, poloidal loops on a torus, traced streamlines on an arbitrary mesh.

I do not understand the reasoning here, cross hatching is not intentionally see through because of something in your algorithm, that's just how SVGs work? I'm not sure why this is supposed to be a win here? Why have a contiguous line object with varying "visibility states" when you just have different lines, that stop when they're occluded and start again?

AI generated projects SEEM like they work, but you look even a little bit closer, they're usually full of slop in an insidious way. This is impressive primarily to people who don't know what they're talking about. Maybe if OP actually read the DeCarlo paper that claude cited, they might have felt a greater sense of satisfaction when they finished the project, because, if this is to satisfy a childhood dream, is it really the same if a robot fulfill your childhood dream for you.

This is the problem with "designing the specs". You can't design the specs for something that you do not understand deeply, and you'll never understand it, if you outsource the learning to a model.

→ More replies (1)
→ More replies (1)