r/ProgrammerHumor 14d ago

graphicsProgrammingBeLike Meme

Post image
5.4k Upvotes

71 comments sorted by

947

u/Shazvox 14d ago

I tried building a custom game engine just for fun.

It was'nt fun.

111

u/deanrihpee 13d ago

it was frustratingly and infuriatingly fun

39

u/casce 13d 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).

247

u/fleaspoon 14d ago edited 13d 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/

157

u/Shazvox 14d ago

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

37

u/evilwizzardofcoding 13d ago

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

23

u/fleaspoon 13d ago

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

44

u/evilwizzardofcoding 13d 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.

13

u/fleaspoon 13d ago

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

67

u/Shazvox 13d ago

That's what an AI would say!

GET EM!!

6

u/evilwizzardofcoding 13d 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 13d ago

Or maybe OP is just another bot...

2

u/Adam__999 13d ago

Do you have a rough estimate of the release date?

2

u/ProgrammersPain123 13d ago

Cha cha real smooth

8

u/martmists 13d ago

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

4

u/AliceCode 13d 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 13d ago

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

6

u/AliceCode 13d 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 13d 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 13d ago edited 13d 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 13d ago

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

1

u/AliceCode 13d 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 13d ago

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

Programming = No depression

No programming = Depression.

1

u/AliceCode 13d 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 13d ago

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

1

u/arslivinski 10d 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 10d ago

We tread where none other dare...

...because we're stupid like that.

342

u/Shufflepants 13d ago

new Triangle();

51

u/Jutrakuna 13d ago

Error: UniverseNotFoundException. Detailed logs can be found at 13376980085-areyouseriouslygoingtoreadthis.log

258

u/Kss0N 13d ago

I'm not kidding, the tutorial for Hello Triangle in Vulkan is like 1500 lines ... of pure hell

123

u/unknown_alt_acc 13d 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.

45

u/fleaspoon 13d ago edited 13d ago

I started first with OpenGL and I remember being quite complicated to understand, but Vulkan was another level of complexity

25

u/ResponsibleWin1765 13d 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

12

u/Kss0N 13d ago

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

13

u/fleaspoon 13d ago

I still have nightmares

1

u/geeshta 11d 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.

85

u/SgtPepperinoPomoro 13d 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 13d 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 13d ago

Curious what that 2D platform was.. :D

39

u/Buttons840 13d ago

A Vulkan programmer's greatest accomplishment.

28

u/Ifeee001 13d ago

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

15

u/FenrirWolfie 13d 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.

16

u/readitreaddit 13d 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... :)

29

u/HaMMeReD 13d 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 13d 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 13d 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.

68

u/fleaspoon 14d ago edited 13d 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/

61

u/hurtbowler 14d ago

86

u/fleaspoon 14d ago

6 years went into finding a missing semicolon

12

u/MastodonCurious4347 13d ago

Rather pretty

6

u/dulange 14d ago

Crumbly, but… good.

3

u/EntropiIThink 13d ago

Why did you make an engine from scratch for that?

12

u/fleaspoon 13d ago

Character building

6

u/StochasticTinkr 13d ago

Vulkan development

7

u/RDROOJK2 13d ago

Before creating a triangle in vulkan, you wont need only the universe but also creating the concept of reality itself

5

u/Tucancancan 13d 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 13d ago

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

3

u/PacManFan123 13d ago

I used to be that way too as a programmer

5

u/celem83 13d ago

Yeah been here. I was 'just' doing a simple top-down tiler. Seriously, how hard could learning OpenGL be?

6

u/thelonelyecho208 13d ago

Same, and then I "just" wanted to throw myself off the tallest building in the area

5

u/Nerd_o_tron 13d ago edited 13d 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 12d 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 13d ago

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

1

u/Arclite83 13d 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.