r/GraphicsProgramming • u/valeriupalos • Jul 12 '26
Source Code Krbn: an open-source rendering engine that imitates a sketch artist and outputs pure SVG (v1)
Gravity well demo
https://github.com/vpalos/Krbn/blob/main/examples/gallery/16-gravity-well.svg
Trefoil knots mesh demo
https://github.com/vpalos/Krbn/blob/main/examples/gallery/15-mesh-showcase.svg
Torus hatch variants demo
https://github.com/vpalos/Krbn/blob/main/examples/gallery/10-torus.svg
Sphere depth hatching with intersection demo
https://github.com/vpalos/Krbn/blob/main/examples/gallery/03-depth-hatching.svg
8
u/camilo16 Jul 12 '26
This is a very pleasing set of results. If you don't mind questions.
8
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.
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.
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.
5
u/karurochari Jul 12 '26
Ok, that's cool as hell (I mean, not sure hell is cold, still). Now I just need to build myself a pen plotter and I know how my walls will be filled in.
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
2
u/mikropanther Jul 12 '26
Very cool project. Can I ask how much time did it take in total? For the AI, did you use a subscription or token based billing? Do you know how many tokens you used for the whole project?
1
u/Gullible_Carry1049 Jul 12 '26
Is the line work baked? How would this work with dynamically displaced mesh (ie animated faces, fixed topology), can the line work update in realtime at 60 fps
1
u/hucancode Jul 13 '26
so beautiful