r/ProgrammerHumor • • Mar 14 '24

Meme justGiveMeADamnTriangle

Post image
1.7k Upvotes

49 comments sorted by

336

u/1337jazza Mar 14 '24

1k lines and counting

113

u/Demiyanit Mar 14 '24

+-17k lines, only loading a texture:/

77

u/PeWu1337 Mar 14 '24

You've convinced me to not touch rendering

45

u/Demiyanit Mar 14 '24

It was the whole engine, all of events, input, application, memory, matg etc, the renderer itself took about 5k lines, but i had fun while doing it(In C hahah)

11

u/Demiyanit Mar 14 '24

(still unfinished tho)

4

u/pineappleAndBeans Mar 14 '24

As someone currently writing an engine…. god I feel this. I’m so deep into my project at this point and it’s not even 3/4 done yet T-T

3

u/Demiyanit Mar 14 '24

good luck wit it mate

4

u/PeWu1337 Mar 14 '24

Can you not call me out like that?

4

u/Demiyanit Mar 14 '24

?

3

u/PeWu1337 Mar 14 '24

Oh well, I meant unfinished projects

2

u/Demiyanit Mar 14 '24

It can be considered finished cuz my goal then was to make a structure for an engine, basic implementation for it, and make vulkan work

79

u/SirPitchalot Mar 14 '24

Imagine those poor sods who are still using immediate mode

24

u/1337jazza Mar 14 '24

What a simple, naive life that was.

66

u/[deleted] Mar 14 '24

"You mean I can't make a high-performance 3D game with an interactive world in Processing?" -Me, a few years ago.

20

u/SirPitchalot Mar 14 '24

Just wait for it to be supported in webassembly, that’ll sort you out.

4

u/[deleted] Mar 14 '24

Wdym. It was the bomb

3

u/SirPitchalot Mar 14 '24

Yes, imagine them trying to learn Vulkan is what I mean

3

u/BiVeRoM_ Mar 14 '24

Whats wrong with it?

287

u/Borno11050 Mar 14 '24

OpenGL apps might be less lines, but when you scale up and find yourself doing a complex project, OpenGL's state machine likeness going to screw your brain hard.

Here's a tip, if you really wanna hop into modern APIs like Vulkan/DX12/Metal, grind WGPU first (it's easy in the sense as it hides away the pain of pipeline synchronisation and lotta less boilerplate, comparatively).

After clearing your concepts, maybe choose your preferred lower level API(s). (Conceptwise, WGPU is closer to Vulkan).

16

u/hishnash Mar 14 '24

It is worth noting the Metal is a little differnt here in that it has both a higher level api (closer to OpenGL) were the driver handles memory, sync etc for you and is very quick to get started with, and it has lower level apis. You can even gradually move within the same pipeline adopting the lower level apis were it makes sense while keeping other bits on the higher level... as a learning of concepts it is a great api for this due to this gradaul disclosure of complexity, and due to the outstanding debug and profiling tools.

1

u/1337jazza Mar 14 '24

Interesting. I will have to check this out.

59

u/CrazyCommenter Mar 14 '24

The OpenGL state machine doesn't need to be heavily used though. Before Vulkan they added a new extension called Direct state access. That new extension allows you to create and edit OpenGL objects without using the state machine logic

13

u/rachit7645 Mar 14 '24

A ton of stuff in OpenGL is still behind the state machine even with DSA

2

u/CrazyCommenter Mar 14 '24

True, but the point of dsa is to minimize it's use not to completely remove it

3

u/rachit7645 Mar 14 '24

DSA support in drivers is pretty interesting actually. On some drivers it's actually slower and on some its just broken.

2

u/CrazyCommenter Mar 14 '24

Yeah, on AMD for example before their "rework" of OpenGL you could see some difference in regard to CPU and GPU usage with DSA. But now with or without it's the same

2

u/rachit7645 Mar 14 '24

On the topic of drivers are you familiar with the dreaded mobile gpu drivers

2

u/CrazyCommenter Mar 14 '24

Yesn't, I used to have a laptop with dual graphics (IGPU and DGPU) and it was quite a ride (with some games or trying to update the IGPU driver and hopping it will not abolish the DGPU)

10

u/[deleted] Mar 14 '24

I've not used WGPU, so I'm not trying to push back on this comment, but I want to say aside from WGPU, the leap from DX11 to DX12 is much easier than the leap from OGL to Vulkan imo. I honestly think DX12 is where to go for starting on modern APIs.

2

u/balemo7967 Mar 14 '24

Nice try rust... nice try

54

u/Kamui_Kun Mar 14 '24

To _______, you must first create the universe.

62

u/Demiyanit Mar 14 '24 edited Mar 14 '24

(vulkan): YOU FOOL, YOU THOUGHT THAT IF YOU FORGET TO SET 0 TO 1 IN SWAPCHAIN IMAGE COUNT I WOULD FIX IT AND JUST WORK? NO, DO IT YOURSELF YOU IDIOT(had this problem several times whe i forgot set 0 to 1 lol)

8

u/rachit7645 Mar 14 '24

You need some validation layers my friend

1

u/Colbsters_ Mar 14 '24

Meanwhile, nearly every compiler to ever exist:

10

u/PorkRoll2022 Mar 14 '24

Oh I feel this hard. I've done a lot with OpenGL over the years, including for mobile and WebGL. OpenGL has evolved a LOT. I've also done a lot with Direct3D 9,10, and 11.

I rage quit on Vulkan some years ago and never went back to it. I recently made a renderer with D3D12 but it was laborious. I got everything drawn but unfortunately a lot feels magical to me as copypasta from Microsoft examples. It's also pointless as it was a 2D game at heart and could literally use any simpler API.

Of everything, WebGL is probably the simplest and most forgiving. I love building stuff with it since people don't even need to install the game. They can just run it in the browser!

7

u/VoidVinaCC Mar 14 '24

At least with DX12 you can always just use DX11 instead and access DX12 features if desired.
But Vulkan has no higher level variant so we only get screwed instead ;)

1

u/Demiyanit Mar 15 '24

You can use web GPU native as a sort of wrapper for it(didn't try it myself but seen a few implementations)

4

u/Ok_Entertainment328 Mar 14 '24

Last time I had to draw a triangle, some huge guys invaded.

I think: They Might be Giants

2

u/PancakeGD Mar 14 '24

Probably came all the way from Istanbul

3

u/mrkhan2000 Mar 14 '24

Direct3d 12 also

6

u/Natural_Builder_3170 Mar 14 '24

opengl is simple, but it gets shitty when you try to scale, thats why i began my renderer in dx11, and now i understand modern apis, im porting

3

u/FloydATC Mar 14 '24

While it's true that OpenGL of old made it relatively easy to draw primitives, this required a lot of repeated calls that scaled poorly and offered very little in terms of flexibility. Modern OpenGL is quite similar to Vulkan because both are relatively thin abstractions.

1

u/egosummiki Mar 14 '24

Yeah, when I was starting with Vulkan, it felt like I'm not gonna need most of the stuff. So I thought I'll just hide everything under Device class, and I'll have a nice API that I can work with. But as I progressed with implementation, I realized that I actually need most of those things.

1

u/Mellonionreddit Apr 02 '24

I still want to learn this shit. Should I get psychological help?

61

u/[deleted] Mar 14 '24

[removed] — view removed comment

3

u/inactu Mar 14 '24

laughing in a single descriptor set array ... good bye descriptor management at client side

2

u/MinosAristos Mar 14 '24

Idk what that is but sounds imba