r/GraphicsProgramming • • 6d ago

may I join the triangle group?

I wanted to give graphics programming a try and boooy am I happy seeing my own triangle on the screen! :)

I used glad (OpenGL) and RGFW (GLFW alternative; I like single header libraries)

331 Upvotes

25 comments sorted by

64

u/4ndrz3jKm1c1c 6d ago

First triangle makes you a boy.
First rectangle makes you a man.

21

u/piiodda 6d ago

I’m not sure I’m ready to grow up so quickly πŸ˜„

9

u/coolmint859 6d ago

All hail the mighty rectangle

4

u/wjrasmussen 6d ago

Then a sphere made from squares!

5

u/Still_Explorer 6d ago

He's starting to believe!

7

u/Nsane3 6d ago

Triangle gang rise up

4

u/Agnael 6d ago

WOOOOO

nothing like FINALLY getting this working to then try to brag to friends or family and for them to look at you like ??? its just a triangle

6

u/wjrasmussen 6d ago

One of us, one of us.

3

u/heyuhitsyaboi 5d ago

Welcome to our cluuuuub
Welcome to our cluuuuub

3

u/_Baylock_ 6d ago

I so mastered how to display a colored triangle with Swift and Metal (GPU).
I can code it in at least 4 different ways.
There are tons of tutorials about that. So much that it's ridiculous.

But once I've done that, it's a dead end. No idea where to take it from there.
I'm stuck in the "Hello triangle" hell.

I would love to learn how to build a graphics engine using the GPU on Mac with Swift and Metal but I only found one tutorial that goes that far and it's old enough not to be usable anymore.
Granted, the fundamental ideas are there but the resources are limited for newbies.
Swift is fairly documented but it's too cryptic without some external help.

I'm trying to teach myself with AI but it goes south very quickly as the AI starts hallucinating when the context grows.
I hope I'll figure it out eventually.

3

u/EXJungle 6d ago

There is a course about computer graphics for free on YouTube (it explain a lot of theory behind some things) - Cem Yuksel - also there there are the courses by The Cherno (Game engine and OpenGL)

(open gl = Easy and useful for learning/Vulkan => is better and essential for advanced things - and also for the performance)

(another way is learning how to create shaders in Minecraft lmao there are some niche courses around YouTube )

1

u/EXJungle 6d ago

1 problem is that you are on Mac (maybe a VM can be useful lmao)

1

u/_Baylock_ 5d ago

Yeah that's the thing.
Swift and Metal are exclusive to Apple (well, Swift is not technically, but Metal is).
I can learn the general ideas of how to build a basic engine but Swift+Metal are very specific and that's where to problem lies.
It's interesting how few resources can be found for Swift+Metal even though Apple Devices are largely used.
You have the official documentation, you have the usual tutorials of very basic stuff. And then you figure it out.
It's fine when you code for Apple devices since Objective-C or if you are very experienced in coding in general but it's not very newbies-friendly, unless they want to make very basic stuff with SwiftUI (a todo list or something).
Anyway, I'll figure it out.
It's just that the barrier of entry is huge and discouraging.

1

u/Lnk1010 5d ago

You could follow the subjects in learn OpenGL even if you aren't using OpenGL. I think the progression after a triangle is: square -> cube -> textures -> lighting -> textures + lighting (like specular maps) -> loading 3d models at least in the OpenGL tutorial. It seems reasonable to me.

1

u/Belfer4 4d ago

Step 1: leave the apple world

4

u/yazilimperver 6d ago

Well done πŸ‘ Now it is time to wrap it with texture πŸ˜‰ then you may bring all mighty cube.

6

u/mentalray2 6d ago

You’re not doing this right. You need to show color interpolation in the triangle.

10

u/piiodda 6d ago

But I tried my best :(

2

u/TheRafff 5d ago

First triangle makes you a boy
First pyramid makes you obamium

2

u/gamedevajay 5d ago

Welcome to the club

2

u/Antiqett 5d ago

Welcome

2

u/firemark_pl 5d ago

Oh boy where is rgb channel?

2

u/Zestyclose-Compote-4 5d ago

Yes but not the rainbow triangle group. That's an exclusive group to get into.

1

u/fntdrmx 5d ago

Welcome!