pouët.net

Go to bottom

how do i get started with opengl and shader coding?

category: code [glöplog]
I wanted to join in demoscene ever since I found out about it through a person named fms_cat and the NotITG community. I'm not sure how to set up what I want to use or where to start. I'm on Windows 10 64-bit, and I'll use Msys2 UCRT64 for gcc and other packages, since I want to code in C++ and Python (focus on C++. python is an afterthought), but I'll start off with C. My code editor is a mix of VScode and NotePad++. I also have CMake on board. Most tutorials I found didn't really get me anywhere
Knowing C/C++ is a pretty good start already.

The two resources I recommend are https://alain.xyz/blog/raw-opengl and https://learnopengl.com/, and I think you should leave shaders to a bit later until you've gotten a few meshes on screen first, gotten to figure out matrices, cameras, interpolations, that sort of stuff.
added on the 2024-07-25 22:05:43 by Gargaj Gargaj
And just for future reference, https://github.com/mackron/miniaudio is also pretty good for getting sound out of the machine.
added on the 2024-07-25 22:09:08 by Gargaj Gargaj
Thanks! I'll be using them. also, i plan on using opengl for more legitamate things as well, like game engine dev.
Sure, there's definitely an overlap between a game engine and a demo engine - ultimately in both cases, you're just setting resources to feed drawcalls, it's just that in a game engine there's a tick phase where you deal with game logic updates, input, physics, animation graphs / state machines, that sort of stuff, whereas in a demo it's "start music, render, render, render, render, render, render, stop music, exit".
added on the 2024-07-25 22:19:51 by Gargaj Gargaj
You can also take a look at this. ;)
added on the 2024-07-25 22:37:55 by Defiance Defiance
Quote:
You can also take a look at this. ;)

No, you should avoid it like the plague.
added on the 2024-07-25 22:50:23 by Gargaj Gargaj
tl;dr Gargaj disapproved the way it was written originally and decided to make it a huge deal.

It's safe, don't listen to him.

Gargaj: Yeah, tell them what and how they should think, it's something you are pretty good at. :)
added on the 2024-07-25 23:03:55 by Defiance Defiance
you can find a few additional reference links here
added on the 2024-07-25 23:08:02 by psenough psenough
Since OpenGL is quite convoluted after 25 years of people adding multiple ways to do everything, and development stopped 7 years ago, aren't there better places to start these days? I get that not everyone wants to dive into low-level APIs like Vulkan and its Windows and Mac equivalents, but surely there are higher-level libraries built on top of them that are easier for beginners to wrap their heads around than OpenGL?
added on the 2024-07-26 00:52:21 by absence absence
Good point, absence. I've recently been made aware of this library: https://www.raylib.com/
I haven't tried it myself yet but there are some games that have been implemented with it, so it seems to be working.
added on the 2024-07-26 08:43:38 by Adok Adok
or you could buy unity
added on the 2024-07-26 09:43:54 by NR4 NR4
nah srsly, as coder : I use OpenGL from C and Python, and its quite frustrating to learn and it keeps being in your way at every other opportunity. stuff works different than expected in subtle ways. useful debug information is annoyingly hard to obtain.

it's great for sizecoders, but for artists tooll.io notch, or cables.gl are a better choice
added on the 2024-07-26 09:49:47 by NR4 NR4
also most opengl info on the internet is condensed antipatterns in its purest form, "fricklerscheiss"
added on the 2024-07-26 09:51:02 by NR4 NR4
www.learnopengl.com will get you modernish OpenGL basics. The rest is just standard programming.
added on the 2024-07-26 12:06:35 by Preacher Preacher
It's Friday.. it's hot.. I guess I'm feeling tetchy enough to bite..

Quote:
tl;dr Gargaj disapproved the way it was written originally and decided to make it a huge deal.

It's safe, don't listen to him.

Well that piqued my interest so I took a look at the code. Um.. yeah.. it is terrible as example code. It's terrible on other levels too.

Quote:

Gargaj: Yeah, tell them what and how they should think, it's something you are pretty good at. :)

The advice in this thread is all solid apart from your combo-breaker.
added on the 2024-07-26 12:25:25 by evilpaul evilpaul
TheCherno's youtube channel and his Hazel Engine is also nice for C++/OpenGL game engine dev. His recent updates (ECS, C# scripting, vulkan port, etc) are Patreon-sub based but you can ignore that. especially if you're into sizecoding then none of that is useful.
I'm with NR4 in this one, as well. OpenGL will get in your way eventually no matter the lib you use. It just draws stuff and the feedback is indeed minimum, you will find yourself many times asking why this or that bug happens without much info. The drawing library isn't binding, as well, maybe you could take a look at this D3D tutorial which is not as difficult for a newbie imho.

evilpaul: The 'advice' in the demosystem thread mostly comprises of bold sentences meant to scare off newbies, and sadly it worked pretty well.
added on the 2024-07-26 12:47:25 by Defiance Defiance
Quote:
sadly it worked pretty well

You do realise there's such a thing as giving bad advice and leading people astray? There's more than enough low-quality content online, so you can't fault experienced developers for trying to point beginners in the right direction.
added on the 2024-07-26 13:50:15 by absence absence
Quote:
...so you can't fault experienced developers for trying to point beginners in the right direction.


No I can't, nor do I hold a grudge against them, but I do consider them responsible for not actually helping begginers release something in their first steps. Where is that tutorial that helps you make a demo...? (an actual demo, not a renderer!)
added on the 2024-07-26 14:19:25 by Defiance Defiance
your constant nagging and demeanor in threads like these is a bigger scare off for newbies, i reckon
Scapegoating isn't going to help you this time. Something this 'community' has done multiple times in the past. Newbies are scared because they don't have a single place to start, a single example to experiment on. And then the attitude of some sceners... What would someone expect by a lynching mob behaviour? The elites vs lamers attitude? The ad hominem attacks? No, they are better off to places that accept them for what they are. Begginers. :)
added on the 2024-07-26 14:42:30 by Defiance Defiance
QED
You've done enough damage. Goodbye.
added on the 2024-07-26 15:11:10 by Gargaj Gargaj
When your code is so bad, it gets you banned from Pouët!
added on the 2024-07-27 00:24:06 by Sesse Sesse

login

Go to top