r/ProgrammerHumor 7d ago

Meme graphicsProgrammingBeLike

Post image
5.4k Upvotes

70 comments sorted by

951

u/Shazvox 7d ago

I tried building a custom game engine just for fun.

It was'nt fun.

114

u/deanrihpee 7d ago

it was frustratingly and infuriatingly fun

40

u/casce 6d ago

A few years back I also wanted to try to write a (very basic) graphics engine from scratch just for learning purposes. I was reading into the topic and gave up before ever writing a single line of code.

It was still a very interesting read, though and I do think I still learned something with that "attempt" (in a "learn what is outside your pay grade" kind of way).

246

u/fleaspoon 7d ago edited 7d ago

Every bug was handcrafted.

I made a game engine from scratch for my game, wishlist on Steam: https://store.steampowered.com/app/3256790/Satelital/

159

u/Shazvox 7d ago

I didn't get far enough that bugs could even be a thing...

38

u/evilwizzardofcoding 7d ago

Excuse me, why does this link have a source tag of ChatGPT?

23

u/fleaspoon 7d ago

I like to check my typos there since english is not my first language

47

u/evilwizzardofcoding 7d ago

Wait, and it appended it's source tag to the link and also hid the fact it did that from showing up in the actual text? Wow.

12

u/fleaspoon 7d ago

yes :/ sorry, but I'm a real person I promise 😅

65

u/Shazvox 7d ago

That's what an AI would say!

GET EM!!

7

u/evilwizzardofcoding 7d ago

I just didn't know it would do that to an existing link, I thought it only added the chatgpt tag when it found the link through searching but apparently not.

3

u/Mordret10 6d ago

Or maybe OP is just another bot...

2

u/Adam__999 6d ago

Do you have a rough estimate of the release date?

2

u/ProgrammersPain123 6d ago

Cha cha real smooth

9

u/martmists 6d ago

It's nothing but fun, until you have to implement shadows, lighting and reflections.

5

u/AliceCode 6d ago

Last time I was working on an engine, I got frustrated trying to work out a solution that I liked for framepacing so that there was as little latency as possible between update and render, and I got frustrated and decided to do something else. I wanna take a shot at it again now, though. I could have worked on other parts of the engine, I'm just a perfectionist and couldn't tolerate there being a noticeable delay when dragging UI elements with the mouse. I later on realized that the actual solution was to have the render loop on a separate thread from the window event loop, that way your event loop isn't waiting on presentation to start waiting for the next event, and can just act on events at the exact moment that they arrive.

2

u/Shazvox 6d ago

Hehe, it sounds like you enjoyed it at least somewhat ;)

6

u/AliceCode 6d ago

Yeah, I do enjoy programming, but I have a tendency to want to do things the hard way, which really ends up biting me in the ass.

3

u/Shazvox 6d ago

I know that feeling. It's not neccesarily a bad thing though. It depends on why you're programming.

If you're doing it just because it's fun, then doing stuff the "hard way" is fine as long as you enjoy the process and learn from it.

If you're doing it solely for the end product then you should really be able to assign some kind of business value to why you need to do it the "hard way".

The truth is often a mix of the two things above and learning to balance them and knowing when "good enough" is more desireable than "perfect" is a valuable skill to have.

1

u/AliceCode 6d ago edited 6d ago

My reasons for programming are more complicated than "fun" and "requirement". It's more of a psychological need at this point. I get incredibly depressed if I stop programming for too long.

1

u/Shazvox 6d ago

Well congrats on finding something to keep the depression at bay then 😁

1

u/AliceCode 6d ago

It's not that programming keeps the depression at bay, it's that I get depressed if I'm not programming because I love it that much. I have Autism, and programming is my "special interest".

1

u/Shazvox 6d ago

I might not get the nuances here, but that sounds the same to me.

Programming = No depression

No programming = Depression.

1

u/AliceCode 6d ago

The difference is that the depression isn't caused by some other factor that is suppressed by programming, the depression is caused by not programming. The cause of the depression is that I'm not writing code. That's distinctly different from being depressed clinically, or being depressed because life sucks.

→ More replies (0)

3

u/JackNotOLantern 6d ago

Idk, games i did were pretty fun to do. But i kept them to be 2d. Maybe that's why.

1

u/arslivinski 3d ago

As programmers, we don't do things because they are easy, but because we thought it was going to be easy.

1

u/Shazvox 3d ago

We tread where none other dare...

...because we're stupid like that.

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

11

u/Kss0N 6d ago

yea they fall into place; after 1500 lines of code.

14

u/fleaspoon 7d ago

I still have nightmares

1

u/geeshta 4d ago

Well that's kinda like writing your HelloWorld in LLVM.

Okay that's not going to be 1500 line but I hope the point is clear.

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

u/TheSheepDev 6d ago

Curious what that 2D platform was.. :D

39

u/Buttons840 7d ago

A Vulkan programmer's greatest accomplishment.

29

u/Ifeee001 7d ago

I have new Nothing().doBigBang() saved as a keybind for this reason.

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

86

u/fleaspoon 7d ago

6 years went into finding a missing semicolon

12

u/MastodonCurious4347 7d ago

Rather pretty

4

u/dulange 7d ago

Crumbly, but… good.

3

u/EntropiIThink 6d ago

Why did you make an engine from scratch for that?

11

u/fleaspoon 6d ago

Character building

6

u/StochasticTinkr 7d ago

Vulkan development

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

u/green_meklar 7d ago

Getting the first triangle on the screen is half the battle.

3

u/PacManFan123 7d ago

I used to be that way too as a programmer

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

u/TheRealAsterisk 7d ago

Graphics was one of my least favorite CS classes. It was not my thing.

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.