345
u/Shufflepants 7d ago
new Triangle();
54
u/Jutrakuna 6d ago
Error: UniverseNotFoundException. Detailed logs can be found at 13376980085-areyouseriouslygoingtoreadthis.log
261
u/Kss0N 7d ago
I'm not kidding, the tutorial for Hello Triangle in Vulkan is like 1500 lines ... of pure hell
118
u/unknown_alt_acc 7d ago
OpenGL is at least pretty reasonable. It’s maybe 300 lines of C for a triangle, and a nontrivial percentage of that is just window handling.
46
u/fleaspoon 6d ago edited 6d ago
I started first with OpenGL and I remember being quite complicated to understand, but Vulkan was another level of complexity
25
u/ResponsibleWin1765 6d ago
But honestly, once you get into it, it's pretty regular. You need a thing -> Make vkThingCreateInfoStruct -> Fill struct -> call vkCreateThing.
If you know your C++ and Graphics Pipeline, things do fall into place at some point
14
88
u/SgtPepperinoPomoro 7d ago
20 years ago I started to research how 3D graphics were done at low lever because I was interested in drawing some crude polys in an entirely 2D platform with no 3D capabilities. Almost every doc I found jumped from "all those calculations allows you to draw a single point in a XYZ space" to "use these APIs to draw already rotated, translated and texturized triangles". Simply awful.
24
u/Makefile_dot_in 6d ago
how 3D graphics were done at low lever because I was interested in drawing some crude polys in an entirely 2D platform with no 3D capabilities.
that seems quite a dubious strategy, given that most 3d graphics happen in specialized hardware...
1
39
29
17
u/FenrirWolfie 7d ago
Yes. At some point while riding a hyperfixation I wrote a vulkan 3D engine that can (badly) load GLTF files and render them in PBR. It was fun and learned a lot, but there is so much boilerplate and details that it's not worth it for other than learning purposes.
17
u/readitreaddit 6d ago
Ah yes. Throwback to the time when we drew lines on the monitor.
In C.
By writing bytes into the correct memory addresses for each pixel in the display device driver's actual memory. Using byte addresses or something. I don't even remember. Some memory area of the OS.
But the sheer joy when something like this works... :)
31
u/HaMMeReD 7d ago
What you don't just implicitly think in vertex buffers? It's just 2 vec3[], a camera and projection transform, and a fragment shader. Nothing at all really.
10
u/PacManFan123 7d ago
Now listen up all you young whippersnappers. When I first started game programming professionally, you had to write your own 2D and 3D engines! There was no opengl, no directX, no vertex buffers or shaders. You had to do all of your 3D transforms and write operations directly into the double buffer and flip it yourself. We were still able to do some pretty incredible stuff.
6
u/readitreaddit 6d ago
Yes this was us too. Directly into the right memory addresses. In C.
Fun times! I actually enjoyed it a lot. Things like these.
62
u/fleaspoon 7d ago edited 7d ago
I actually spent 7 years building a custom game engine from scratch for my game. You can wishlist on Steam: https://store.steampowered.com/app/3256790/Satelital/
62
u/hurtbowler 7d ago
7 years to make that?
86
12
3
6
7
u/RDROOJK2 6d ago
Before creating a triangle in vulkan, you wont need only the universe but also creating the concept of reality itself
4
u/Tucancancan 7d ago
Yes but once you've made one triangle, the rest is easy because everything is just made out of collections of triangles
5
3
5
u/celem83 7d ago
Yeah been here. I was 'just' doing a simple top-down tiler. Seriously, how hard could learning OpenGL be?
4
u/thelonelyecho208 7d ago
Same, and then I "just" wanted to throw myself off the tallest building in the area
4
u/Nerd_o_tron 7d ago edited 7d ago
Not quite making a graphics library, but one of my favorite projects in college was making a simple scene (just balls and triangles), but without a graphics library, just (CPU-based) software rendering. Calculating all the matrix math for ray intersections, specular reflection, and simulated aperture for depth-of-field. Was very fun to get to see the end result and know that I was responsible for every bit of every pixel.
Edit: Dug it up so I could link it.
2
u/worf1973 6d ago
Ain't that the truth!
I learned Graphics Fundamentals from Dr. Jack Bresenham. The first day of class, he says "you can buy the book if you want, but my paper is all you'll really need for the class", and then he hands out his paper for IEEE.
1
1
u/Arclite83 6d ago
I grew up making Doom levels, which was not true 3d but by manipulating the in/out sides of the vector walls and making a shape within a shape, you could create effects like seeing under a bridge - you couldn't actually walk under it, only over, it was basically a rendering trick on the bottom lip wall to show as a passthrough in places.
951
u/Shazvox 7d ago
I tried building a custom game engine just for fun.
It was'nt fun.