Procedural Graphics in C (Voronoi Ep.01)

  Рет қаралды 46,527

Tsoding Daily

Tsoding Daily

Күн бұрын

References:
- Wikipedia Article: en.wikipedia.org/wiki/Voronoi...
- Old Voronoi Diagram project: github.com/tsoding/voronoi-di...
- PPM Image Format: en.wikipedia.org/wiki/Netpbm

Пікірлер: 64
@wijiler5834
@wijiler5834 Жыл бұрын
Zozing zession 😊
@alpers.2123
@alpers.2123 Жыл бұрын
Haw abaut dat
@alpers.2123
@alpers.2123 Жыл бұрын
Rather interesting
@loryon
@loryon Жыл бұрын
@@alpers.2123 I bet you didn't expect that sh*t to happen!
@alpers.2123
@alpers.2123 Жыл бұрын
@@loryon Welcome to the epic coding club
@rubensrensen197
@rubensrensen197 Жыл бұрын
Very interesting way to generate Voronoi diagrams, looking forward to the shader implementation. To get the encoding and decoding of positions and colors essentially for free, you could maybe put them in a union, something like this: typedef union { struct { uint16_t x, y; }; uint32_t color; } Point32;
@stewartzayat7526
@stewartzayat7526 Жыл бұрын
1:26:40 I think it's probably because of cache locality actually. With the 'interesting' approach you keep iterating over the whole image, whereas in the 'naive' one you iterate over the seeds array instead. The seeds array fits into the cache no problem, so that's the better solution in terms of cache hits.
@modolief
@modolief Жыл бұрын
Tsoding: Outside of Linus, you are my favorite hacker on the planet.
@mrdixioner
@mrdixioner Жыл бұрын
Долго искал информацию по программированию графики на Си, наконец то нашёл!!! Подписался, будем посмотреть :)
@cyanmargh
@cyanmargh Жыл бұрын
Когда-нибудь я смогу попасть на стрим вовремя...
@alexandrohdez3982
@alexandrohdez3982 Жыл бұрын
Love your videos I learn a lot 👏👏👏👏. Regards.
@Mozartenhimer
@Mozartenhimer Жыл бұрын
The traditional method could be done in fragment shader with a shader storage buffer. Nonetheless, this is a very interesting method.
@matthias916
@matthias916 Жыл бұрын
Is there a specific reason you chose to store the the seeds' x and y position in the color as opposed to its index into the seeds array? Storing it's color would take less space which might leave space to store it's distance the current pixel so you wouldn't have to recalculate that as often
@koktszfung
@koktszfung Жыл бұрын
It is indeed interesting
@hahamartin6595
@hahamartin6595 Жыл бұрын
wonderful,can u pack the series of olive.c into playlist ? that is also popular and interesting
@zhvrnkov6842
@zhvrnkov6842 Жыл бұрын
It would be interesting if you’ll try compute shaders that are available even in webgl as far as I know
@BalintCsala
@BalintCsala Жыл бұрын
Compute shaders aren't in webgl, they were going to add them but decided to move back on that idea when they realized it's better to define webgpu
@unmeinks5907
@unmeinks5907 Жыл бұрын
this man is speed incarnate
@Moe_Mega
@Moe_Mega Жыл бұрын
You are an epic programmer
@c4llv07e
@c4llv07e Жыл бұрын
tscoding, have you heard about the farbfeld image format? It's similar to pbm, but with more colors and without EOLs.
@superscatboy
@superscatboy Жыл бұрын
The P6 variant of PPM supports up to 16 bits per channel (although very few applications can read it). IIRC in the ASCII version the newlines aren't required - only a whitespace character is required, and by convention people use spaces between values and newlines (which are a valid whitespace character) at the end of each scanline. This simplifies reading the file one scanline at a time, and on occasion I've found it useful for debugging as it's quite human-readable. The binary format doesn't require any padding between values and is generally preferable as it produces significantly smaller files anyway
@CD4017BE
@CD4017BE Жыл бұрын
You can actually use for loops and ifs inside fragment shaders. And as long as all control flow only depends on constants and uniforms (so all pixels will go through the same control flow path), they won't even cause performance penalties. Branching in shaders is only a problem when nearby pixels that run on the same SIMD unit need to go through different paths of the branch. Then the GPU has to go through both paths in sequence and do complicated SIMD lane masking to perform the computations only on the pixels that need it.
@RenderDragon
@RenderDragon Жыл бұрын
1:09 I am actually doing like that, bc I love your content :) Привет
@leffivanov3127
@leffivanov3127 Жыл бұрын
Btw try out Odin, if you like C, very interested if you like it or not.
@drygordspellweaver8761
@drygordspellweaver8761 Жыл бұрын
he tried, says it's not his style
@Forbiiden
@Forbiiden Жыл бұрын
Tsoding are you still working on porth?
@DuskyDaily
@DuskyDaily Жыл бұрын
Last commit on 4th Feb 2022. I'm taking about the gitlab repo.
@Bobbias
@Bobbias Жыл бұрын
@@DuskyDaily he stopped updating the repo, but he did say he was going to work on it in private.
@bigmistqke
@bigmistqke Жыл бұрын
🙏 porth 😇
@juanmacias5922
@juanmacias5922 Жыл бұрын
1:21:30 what do you mean by branches? Thanks for the video. :)
@AlexxxMurkin
@AlexxxMurkin Жыл бұрын
It's 'branchless' (computing/programming).
@wiktorwektor123
@wiktorwektor123 Жыл бұрын
This means there are no assembly jump instructions in code that can cause cache misses in CPU. CPU can safely assume which part of code will be executed next and have it preloaded to the lowest level of cache.
@stewartzayat7526
@stewartzayat7526 Жыл бұрын
0:30 tv actually stands for Tuvalu
@dokerb3d60
@dokerb3d60 Жыл бұрын
moreover, Tuvalu lives on the money paid by companies that wants to use their domain space because it looks like an abbreviation for television
@Dududuqwe
@Dududuqwe Жыл бұрын
Is all this crazy editing/multiwindowing etc just Emacs functionalities?
@tissuepaper9962
@tissuepaper9962 Жыл бұрын
You can do this many ways. Emacs is one. Neovim is another. A tiling window manager could give you the same thing.
@mobod6822
@mobod6822 Жыл бұрын
when is using farbfeld instead of ppm?
@smuecke
@smuecke Жыл бұрын
Which font are you using in your terminal?
@c4llv07e
@c4llv07e Жыл бұрын
It is Iosevka
@obitouchiha-fl7od
@obitouchiha-fl7od Жыл бұрын
23:35 won't uint8_t bytes auto shift
@petecoleman5748
@petecoleman5748 Жыл бұрын
Maybe next time get a dedicated mic for the keyboard as it was still possible to hear some of what you said above the key bashing. Is it a normal keyboard or is each key 25cm2, and you type with fists not fingers like a sort of coding whack-a- mole?
@atlantic_love
@atlantic_love Жыл бұрын
Any books that teach graphic programming in C or even C++?
@tissuepaper9962
@tissuepaper9962 Жыл бұрын
"3D Game Engine Design" by David Eberly
@atlantic_love
@atlantic_love Жыл бұрын
@@tissuepaper9962 I'm talking about GUI programming, building GUI apps and games. Not interested in graphic engine building.
@tissuepaper9962
@tissuepaper9962 Жыл бұрын
@@atlantic_love then you're looking for "UI programming", not "graphics programming". The most common way people write GUI in C and C++ is to use an external windowing library like Qt. Qt is super powerful and there are tons of people using it online so you should be able to find information about it easily. If you want to make really beautiful UI then you're better off writing an Electron-based app in JavaScript.
@atlantic_love
@atlantic_love Жыл бұрын
@@tissuepaper9962 Okay. I'll check them out.
@bunpasi
@bunpasi Жыл бұрын
I'm enjoying the video so far. You can use `std::numeric_limits` for checking the ranges of numeric types. This way you don't need to remember those macros. Whatever you prefer.
@wiktorwektor123
@wiktorwektor123 Жыл бұрын
Yeah, in C++, this is C
@bunpasi
@bunpasi Жыл бұрын
@@wiktorwektor123 I watched the video in multiple parts and completely forgot about that 😅. I realized it while watching part 2 and came to remove the comment but you beat me to it.
@wiktorwektor123
@wiktorwektor123 Жыл бұрын
@@bunpasi No problem m8, everyone can make mistake. It was just friendly reminder :)
@mohamedamineayadi7290
@mohamedamineayadi7290 Жыл бұрын
your emacs config?
@c4llv07e
@c4llv07e Жыл бұрын
Remix on github
@muhanadissa
@muhanadissa Жыл бұрын
it dose not work ???
@sruffolo9303
@sruffolo9303 Жыл бұрын
what editor is tsoding using?
@ryonagana
@ryonagana Жыл бұрын
based emacs
@etbilu6265
@etbilu6265 Жыл бұрын
i don´t undertand .what is procedural graphics ? i program in c ,i am interested. please make a video basics of basics.
@puniat
@puniat Жыл бұрын
Impossible. Nobody writes c in 2022. You are a maniac.
@superscatboy
@superscatboy Жыл бұрын
@_lapys
@_lapys Жыл бұрын
Firstn't
@c4llv07e
@c4llv07e Жыл бұрын
firstn't
@temporaryaccounts8812
@temporaryaccounts8812 7 ай бұрын
7
@markow5062
@markow5062 Жыл бұрын
ты русский
@jonasbadstubner2905
@jonasbadstubner2905 Жыл бұрын
0:30 *nerd-mode-on* '.tv' does not actually stand for "television", if that is what you wanted to say. It is the country specific TLD (Top Level Domain) of Tuvalu. TV itself stands for television, of course, but the domain ending is only a*used for representing this. *nerd-mode-standby*
@DommageCollateral
@DommageCollateral Жыл бұрын
hey, do you hvaew discord, or are you part of poimandres?
Adding Triangles to my Graphics Library in C (Olive.c Ep.02)
1:27:10
Tsoding Daily
Рет қаралды 22 М.
Programming in OpenGL be Like (Voronoi Ep.02)
1:45:58
Tsoding Daily
Рет қаралды 20 М.
[실시간] 전철에서 찍힌 기생생물 감염 장면 | 기생수: 더 그레이
00:15
Netflix Korea 넷플릭스 코리아
Рет қаралды 31 МЛН
NO NO NO YES! (40 MLN SUBSCRIBERS CHALLENGE!) #shorts
00:27
PANDA BOI
Рет қаралды 54 МЛН
M3GAN’s ARMY got my finger! 😱🦾 #shorts
00:10
Adam B
Рет қаралды 15 МЛН
Иран ударил по израильскому аэропорту
00:14
TRT на русском
Рет қаралды 3,7 МЛН
Hot Code Reloading in C
2:16:18
Tsoding Daily
Рет қаралды 57 М.
I made the same game in Assembly, C and C++
4:20
Nathan Baggs
Рет қаралды 608 М.
Why is Raylib becoming so popular?
9:24
Chris_PHP
Рет қаралды 7 М.
Porting my C Graphics Library to Web (Olive.c Ep.03)
33:38
Tsoding Daily
Рет қаралды 16 М.
Hiding Data Inside of Executable Files
1:55:14
Tsoding Daily
Рет қаралды 23 М.
Control Your Dependencies
1:45:07
Tsoding Daily
Рет қаралды 22 М.
What is Relative Pointers?
1:51:27
Tsoding Daily
Рет қаралды 31 М.
Giving Personality to Procedural Animations using Math
15:30
t3ssel8r
Рет қаралды 2,3 МЛН
I Made A Physics Engine
6:59
Zyger
Рет қаралды 137 М.
Fast Inverse Square Root - A Quake III Algorithm
20:08
Nemean
Рет қаралды 4,8 МЛН
All New Atlas | Boston Dynamics
0:40
Boston Dynamics
Рет қаралды 4,7 МЛН
Ох и ПАЛАС! Как я полетал на фанере с ONEPLUS 12R
15:04