- 2
- 190 772
Muukid
Приєднався 27 кві 2023
linktr.ee/muukid
Rendering 2D objects - Software from scratch
SECTIONS:
0:00 1. The GDI and graphics APIs
12:29 2. Finishing up muCOSA (mostly) (not really)
21:20 3. Clearing the screen: designing mug
33:45 4. Drawing a pixel: using OpenGL
58:37 5. Drawing triangles and rectangles
1:05:47 6. Drawing circles & squircles: fancy shaders & math
1:35:02 7. Drawing textures
1:45:07 8. Wrapping it up
Footnotes: pastebin.com/G4f1KUJf
Music: pastebin.com/Bmm8pdTV
0:00 1. The GDI and graphics APIs
12:29 2. Finishing up muCOSA (mostly) (not really)
21:20 3. Clearing the screen: designing mug
33:45 4. Drawing a pixel: using OpenGL
58:37 5. Drawing triangles and rectangles
1:05:47 6. Drawing circles & squircles: fancy shaders & math
1:35:02 7. Drawing textures
1:45:07 8. Wrapping it up
Footnotes: pastebin.com/G4f1KUJf
Music: pastebin.com/Bmm8pdTV
Переглядів: 25 651
Відео
Creating a window - Software from Scratch
Переглядів 166 тис.2 місяці тому
Chapters: 0:00 - Intro 2:26 - The C Programming Language 11:01 - muCOSA and Win32 16:24 - Setting muCOSA up (the technical part) 26:32 - THE WINDOW 37:34 - Basic window attributes 45:00 - Window input 1:02:58 - Wrapping things up
why did you not use WinRT instead of Win32?
I feel like I’m watching Acerola. I love his work so much, and the dynamic of your video that is so much similar to Acerola’s videos really make your own interesting. Like if you were Acerola’s younger brother.
i always thought WinAPI was annoying too, until i actually tried to use X11 to do some basic things like make an OpenGL window or get keyboard input... then i realized that ive been spoiled having access to something like WinAPI that is actually well documented and easy to use
This kid is crazy
Love the video but I will die on this hill: Index -> indices matrix -> matrices vertex -> vertices
Which sane programmer is typedef'ing uint32_t as uint32_m? Your lack of knowledge abt the Win32 API is fucking hilarious! (more videos pls, so ppl can learn from you)
I feel a vibe This homie is about to build a whole engine real quick
Not that it didn't interest me, otherwise I wouldn't have watched it. But help me god, that 1 hour felt like a whole year :D
not from scratch, didn't build the computer quark by quark
Hey man, you should look into shader uniforms. They are basically variables you pass into the shader itself without having to pass the same value through each of the vertices.
Well well now make a window vibrant.😒
Bro, I turned on notifications for your channel and I didn't get notified about this video, that's fucked up
I think that my consistent hyperfixation on this topic should've been enough to get tested for autism, I would known before yesterday.
Why wont webgpu?
1:09:58 Why not use UV coordinates? I'm assuming you'll want to implement textures later anyways, you'll need them for those as well.
what is this shit? thanks for wasting my time.
dude just use winget in a 16 line script
overrated channel
MSAA multisampling doesn't run the fragment shader multiple times for primitive edges. Rather, it uses a multiple of depth/coverage to modulate the single pixel value. It's a cheap hack, but to be fair graphics is in practice chock full of cheap hacks.
perfect content
on my to watch later
1:42:40 you say "minimum" so many times when you meant maximum 🥲
I made a program using win32api a while back and jankly solved the “missing keys” issue. My implementation (in python albeit) involved getting a list of current VK codes and mapping them to a dictionary, but if shift was held down a different dictionary would be used, effectively doubling the amount of keys accepted.
TempleOS support when?
Rendering order is always relevant, for both opaque and transparent objects. Rendering opaque objects is done by sorting front to back from the distance to your eye matrix aka the camera. You want to render the opaque background last because you can then save on pixel shader calculations as the fragment gets rejected during depth test.
you should use a triangle instead of a quad for the circles
i may actually use this to make my game because of thew extensive documentation (these videos)
Hello! First of all I want to tell you that I really appreciate your videos. However, some parts of this one bit me quite hard... - about packing vertices with repeated data, OpenGL has a mechanism for such use cases called Uniforms, letting you have shared data between the vertex and fragment shader program that is ran - For rounded rectangles, (and other primitives), search up about SDF (signed distance fields) for functions that are less hacky and use GLSL builtins (which may result in better performance, perhaps?) Regardless, I would be glad to enter in contact with you regarding this library
at the end your pronaunciatio of maximum as minimum makes it hella confusing.
Thank you so much for the amazing content, the moment I saw your first video you became one of my favorite UA-camrs. ❤
He’s back!!!
"It's stupid, but it works." I mean...that's like every function I've ever made.
1:02:47 if it works it ain’t stupid
Merry Cristina
I am so excited to learn about how you handle graphics
SOMEONE TELL ME WHAT THEME IS HE USING!
11:40 dear god, he is doing this project on windows, rest in peaces, you have created your own version of hell Edit: 13:30 wait so he's not? Idk, but still, rest in peaces regardless
7:00 I get the feeling he's building this project on windows, which was just.. not exactly the smartest thing anyone has done in the past 5 decades
1:30 guys I think he's talking about windows, but that's just a guess
I think I'm too new to programming to understand this stuff
share this video to every kid who asks where maths formulas are used after school
great! now create your own c compiler
this video was awesome, I never seen a video so long that has been able to still be interesting in all moments.
Just so you know, Unlicense is actually a really, really bad public domain license that doesn't hold up to many legislations. A better choice would be either MIT-No-Attribution (which would work in your case), 0BSD or CC-0 (my personal favorite, I find it to be the most universally valid public domain license).
Also, it is perfectly valid to just license that single gl.xml file under Apache, as long as it is clearly separated from your other source files within the license disclaimer (as you've done so). You could consider your repo as dual licensed under MIT and Apache, but that's really stretching it. Also, I find it really weird that you have it both as MIT and as public domain. MIT is more legally binding than PD, for obvious reasons such as having to keep the copyright header on every file and attribution in general. You might as well license everything under PD (using CC0, 0BSD etc.) and be safe. If someone wants to sidestep your MIT license, they can just choose Unlicense (poor choice of license) and then your MIT is worthless. Or just put it all under MIT/BSD, as it's the most permissive license you can get away with without being obscure or CC0 or some variant of those aforementioned licenses.
Instead of cramming so much repeated data onto every vertex have you considered using uniforms instead? Also have you looked into some of the well known signed distance functions? That's basically what you're creating and I know rounding shapes is very easy with SDFs!
A quick tip for rendering rounded rectangles is to just elongate a circle! A formula to render a rounded rectangle would look something like this: float r = .1; vec2 scale = vec2( .4, .2 ); float roundRect = step( length( max( abs( uv ) - ( scale - r ), 0. )), r ); The UV variable would be your 2D coordinate system / position, with the center of the shape being at 0,0. To have anti-aliasing, instead of step(), you could use smoothstep() with a small epsilon added and subtracted from the radius (r) to have a small gradient around the edges of the shape. A good resource for learning how to create various 2D and 3D shapes with shaders is Inigo Quilez's blog where they have a large collection of Signed Distance Field (SDF) formulas.
Wow. I didn't know about texture arrays! That's something I'll recall next time I do rendering code again.
using yume nikki fangame music in the video is based
glad to know someone else has had issues related to PeekMessage besides me, specifically a problem fixed by omitting which window the message came from! i made a very shitty win32+gdi (no opengl) abstraction library for c++, and my event handling system broke after some amount of calls to PeekMessageA, and i didn't know why. removing the window specifier made it work, but yeah to this day i have no fucking clue why that solved it or why it broke in the first place
this is so interesting and valuable to me, thanks alot