Programming in OpenGL be Like (Voronoi Ep.02)

  Рет қаралды 20,093

Tsoding Daily

Tsoding Daily

Жыл бұрын

References:
- en.wikipedia.org/wiki/Voronoi...
- en.wikipedia.org/wiki/Z-buffe...
- github.com/tsoding/opengl-tem...
- www.glfw.org/
- learnopengl.com/Advanced-Open...
- en.wikipedia.org/wiki/Z-fighting
- github.com/tsoding/voronoi-op...

Пікірлер: 45
@K4rmy
@K4rmy Жыл бұрын
I LITERALLY JUST WANTED TO START DOING OPENGL, Damn- Tsoding, Nice to see you again :3
@oaknottree
@oaknottree Жыл бұрын
Glad to see you on KZfaq again zozen :)
@MrKeebs
@MrKeebs Жыл бұрын
You know what would be cool? Have a game where you render the Voronoi diagram and let the user try to pin point where the seed actually is, and give points by how close to the target it gets.
@MrKeebs
@MrKeebs Жыл бұрын
@@mrdkaaa Yes
@j0rp
@j0rp Жыл бұрын
I'm impressed by how flexible opengl has made you.
@bigmistqke
@bigmistqke Жыл бұрын
I can almost reach my toes from just watching
@BenTzionZuckier
@BenTzionZuckier Жыл бұрын
27:49 to 28:52 epic rant
@NotMarkKnopfler
@NotMarkKnopfler Жыл бұрын
And he's 100% correct!
@craigcraig6248
@craigcraig6248 Жыл бұрын
Hello hello and welcome to another tsoding session
@roberthickman4092
@roberthickman4092 Жыл бұрын
Physics on gpu: Opengl has buffer feedback, you can take a buffer, write to it from the shader, then feed it back into the shader (there is a particle system for webgl using this technique). Alternately, compute shader.
@DeathSugar
@DeathSugar Жыл бұрын
How about trying do Vulkan version next?
@VinnyXL420
@VinnyXL420 Жыл бұрын
That is pretty awesome! A voronoi visualization! wow dude! Edit: not just a visualkization, rather a whole animation! damn!
@saidultima
@saidultima Жыл бұрын
Very good stream Tsoding, this type of shit is very interesting 👍 congrats with your channel
@bunpasi
@bunpasi Жыл бұрын
Great video again.
@DarkCookie586
@DarkCookie586 Жыл бұрын
I dont know how much it costs the gpu to compute the n-th root of a number, but since you dont need the actual distance but only compare which distance is greater, you should be able to leave out the n-th root and just compare the sum of the (integer) powers of dx and dy.
@creativity5155
@creativity5155 Жыл бұрын
"Reusable code is the one that you can take... And fucking reuse." - Tsoding, 2022
@cacheman
@cacheman Жыл бұрын
34:30 Arguably something like GLAD is equally simple as it just generates said header file for you (no install if using website).
@stephaneduhamel7706
@stephaneduhamel7706 Жыл бұрын
Please use vectors in your GLSL code, it makes the code look cleaner compared to spamming floats (in my humble opinion), and is often easier for the compiler to optimize.
@dnikhr6014
@dnikhr6014 Жыл бұрын
very cool :)
@Ryan-xq3kl
@Ryan-xq3kl Жыл бұрын
real brogramming moment
@nathanfranck5822
@nathanfranck5822 Жыл бұрын
43:30 - Great metaphor for GPU programming. Sucks we don't have all the tooling of web-developers considering it's a similar process. I want a schema standard for gpu-cpu communications that I can use to generate code snippets.
@wolfdesroyer8711
@wolfdesroyer8711 Жыл бұрын
26:14 comedy gold
@jgcooper
@jgcooper Жыл бұрын
The "seeds" are called "sites", for anyone interested.
@stomah9832
@stomah9832 Жыл бұрын
try vulkan
@wiktorwektor123
@wiktorwektor123 Жыл бұрын
You should try Vulkan and see how much code does it take to render anything. Open GL is very kind graphics API in that situation, just saying. Your 100 LoC multiply by 10 and then you will have something like this in Vulkan.
@mattewlefty991
@mattewlefty991 2 ай бұрын
so we don't even need glad? Fantastic
@imbicyl6667
@imbicyl6667 Жыл бұрын
фига ты похудел или это ракурс так влияет
@saidultima
@saidultima Жыл бұрын
1:19:27 the reason why things are slow there is you're doing 100 separate calls to glDrawArrays, you should do instanced rendering and generate the quads (or maybe triangles would be possible and be more efficient) in the vertex shader.
@saidultima
@saidultima Жыл бұрын
and use GL_DYNAMIC_DRAW as the vbo usage
@friendlygrass167
@friendlygrass167 Жыл бұрын
do consider watching the next three minutes lmao
@Ryan-xq3kl
@Ryan-xq3kl Жыл бұрын
why not Vulkan? you don't enjoy suffering?
@taba1950
@taba1950 Жыл бұрын
Well, you hit the nail on the head, opengl is a hot mess made for job security
@taba1950
@taba1950 Жыл бұрын
Opengl is what happens when you get paid by line of code
@AntonioNoack
@AntonioNoack Жыл бұрын
Have you taken a look at Vulkan? That one is insane!
@astroid-ws4py
@astroid-ws4py Жыл бұрын
Use WGPU or BGFX instead.
@viktable5955
@viktable5955 Жыл бұрын
dx × dx × dx × dx × dx × dx × dx × dx × dx × .... pssst, use pow(x,p)
@nathanfranck5822
@nathanfranck5822 Жыл бұрын
Now program it with AI autocomplete - you feel like a god, it's like copy-paste but with no Google -> Stack Overflow flow breaking, just some dude dumping code in your files on the mildest suggestion of graphics programming
@rogo7330
@rogo7330 Жыл бұрын
Reusable code is the one that can just be `#include "stuff.h"`
@cyanmargh
@cyanmargh Жыл бұрын
Ну либо который можно через макросы сделать
@hanqnero
@hanqnero Жыл бұрын
@@cyanmargh Same custom header can be used between many project but you'll need to copy your macros. В чём прикол отвечать русским языком на комментарий на английском :)?
@cyanmargh
@cyanmargh Жыл бұрын
@@hanqnero макрос можно хранить в заголовнике. отвечаю на каком хочу, потому что на ютубе есть прекрасная кнопочка "перевести комментарий".
@Bobbias
@Bobbias Жыл бұрын
@@km127pl agreed. It's nice to be able to understand what people are saying in a language in don't know.
@rogo7330
@rogo7330 Жыл бұрын
@@cyanmargh macroses != code. I generally don't trust them and use only as little hacks. For example I have my own eprint function that accepts the same stuff as fprintf, but also it have mandatory arguments for filename, line number and function name, all of which are passed to it with macroses like ERROR(), DEBUG() or INFO(). But those are just function calls with some string concatination magic and intended only for debugging. Static functions are the way to go I think.
Adding Transparency to My Graphics Library in C (Olive.c Ep.04)
1:13:33
My Own 3b1b Animation Engine but in C
2:06:44
Tsoding Daily
Рет қаралды 18 М.
Kitten has a slime in her diaper?! 🙀 #cat #kitten #cute
00:28
Procedural Graphics in C (Voronoi Ep.01)
1:31:43
Tsoding Daily
Рет қаралды 46 М.
Adding Triangles to my Graphics Library in C (Olive.c Ep.02)
1:27:10
Tsoding Daily
Рет қаралды 22 М.
Porting my C Graphics Library to Web (Olive.c Ep.03)
33:38
Tsoding Daily
Рет қаралды 16 М.
What is Relative Pointers?
1:51:27
Tsoding Daily
Рет қаралды 31 М.
I Made a Voxel Graphics Engine
10:33
Zyger
Рет қаралды 41 М.
Adding File Manager to My Text Editor
1:47:13
Tsoding Daily
Рет қаралды 16 М.
Delivering Safe C++ - Bjarne Stroustrup - CppCon 2023
1:29:16
I Designed My Own 16-bit CPU
15:46
AstroSam
Рет қаралды 1,8 МЛН
Интел подвинься, ARM уже в ПК!
14:06
PRO Hi-Tech
Рет қаралды 158 М.
Как часто вы чистите свой телефон
0:33
KINO KAIF
Рет қаралды 1,9 МЛН
iPhone 15 в реальной жизни
20:03
HUDAKOV
Рет қаралды 687 М.
🤯Самая КРУТАЯ Функция #shorts
0:58
YOLODROID
Рет қаралды 2 МЛН
Самый маленький игровой ПК
0:46
ITMania - Сборка ПК
Рет қаралды 569 М.
Почему сканер ставят так не удобно?
0:47
Не шарю!
Рет қаралды 779 М.