Muukid
Muukid
  • 2
  • 190 772
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
Переглядів: 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

КОМЕНТАРІ

  • @bity-bite
    @bity-bite 2 години тому

    why did you not use WinRT instead of Win32?

  • @Lumely1
    @Lumely1 5 годин тому

    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.

  • @americanhuman1848
    @americanhuman1848 6 годин тому

    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

  • @ArmandoSmirnov
    @ArmandoSmirnov День тому

    This kid is crazy

  • @fabiant.2485
    @fabiant.2485 3 дні тому

    Love the video but I will die on this hill: Index -> indices matrix -> matrices vertex -> vertices

  • @0x616c
    @0x616c 3 дні тому

    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)

  • @donovanvanderlinde3478
    @donovanvanderlinde3478 3 дні тому

    I feel a vibe This homie is about to build a whole engine real quick

  • @rndmmeme87
    @rndmmeme87 3 дні тому

    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

  • @dotader
    @dotader 4 дні тому

    not from scratch, didn't build the computer quark by quark

  • @TheP1geon
    @TheP1geon 4 дні тому

    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.

  • @ashwithchandra2622
    @ashwithchandra2622 5 днів тому

    Well well now make a window vibrant.😒

  • @notLinode
    @notLinode 5 днів тому

    Bro, I turned on notifications for your channel and I didn't get notified about this video, that's fucked up

  • @TheGloriousMoron
    @TheGloriousMoron 5 днів тому

    I think that my consistent hyperfixation on this topic should've been enough to get tested for autism, I would known before yesterday.

  • @nika_251
    @nika_251 5 днів тому

    Why wont webgpu?

  • @AnxiousAnna
    @AnxiousAnna 6 днів тому

    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.

  • @zxcaaq
    @zxcaaq 6 днів тому

    what is this shit? thanks for wasting my time.

  • @supremepvp2109
    @supremepvp2109 6 днів тому

    dude just use winget in a 16 line script

  • @zeroneoneonezerozeronezerone
    @zeroneoneonezerozeronezerone 6 днів тому

    overrated channel

  • @yas1945
    @yas1945 6 днів тому

    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.

  • @ashesmc
    @ashesmc 6 днів тому

    perfect content

  • @ismbks
    @ismbks 6 днів тому

    on my to watch later

  • @rahul9704
    @rahul9704 6 днів тому

    1:42:40 you say "minimum" so many times when you meant maximum 🥲

  • @coffeefish4743
    @coffeefish4743 7 днів тому

    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.

  • @coffeefish4743
    @coffeefish4743 7 днів тому

    TempleOS support when?

  • @prostmahlzeit
    @prostmahlzeit 8 днів тому

    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.

  • @jan_sipiki
    @jan_sipiki 8 днів тому

    you should use a triangle instead of a quad for the circles

  • @jan_sipiki
    @jan_sipiki 8 днів тому

    i may actually use this to make my game because of thew extensive documentation (these videos)

  • @nferhat
    @nferhat 9 днів тому

    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

  • @Toby-ve6gp
    @Toby-ve6gp 9 днів тому

    at the end your pronaunciatio of maximum as minimum makes it hella confusing.

  • @Toby-ve6gp
    @Toby-ve6gp 9 днів тому

    Thank you so much for the amazing content, the moment I saw your first video you became one of my favorite UA-camrs. ❤

  • @kasoisanti2319
    @kasoisanti2319 9 днів тому

    He’s back!!!

  • @joat1979
    @joat1979 9 днів тому

    "It's stupid, but it works." I mean...that's like every function I've ever made.

  • @pembatamang8233
    @pembatamang8233 10 днів тому

    1:02:47 if it works it ain’t stupid

  • @alex-q8-q9
    @alex-q8-q9 10 днів тому

    Merry Cristina

  • @christianbouwense4702
    @christianbouwense4702 10 днів тому

    I am so excited to learn about how you handle graphics

  • @MeKebabman
    @MeKebabman 10 днів тому

    SOMEONE TELL ME WHAT THEME IS HE USING!

  • @KCKingcollin
    @KCKingcollin 10 днів тому

    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

  • @KCKingcollin
    @KCKingcollin 10 днів тому

    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

  • @KCKingcollin
    @KCKingcollin 10 днів тому

    1:30 guys I think he's talking about windows, but that's just a guess

  • @alanhasmemes
    @alanhasmemes 11 днів тому

    I think I'm too new to programming to understand this stuff

  • @ucchuman
    @ucchuman 11 днів тому

    share this video to every kid who asks where maths formulas are used after school

  • @gamefluxchannel4383
    @gamefluxchannel4383 11 днів тому

    great! now create your own c compiler

  • @co4160
    @co4160 11 днів тому

    this video was awesome, I never seen a video so long that has been able to still be interesting in all moments.

  • @stefanalecu9532
    @stefanalecu9532 11 днів тому

    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).

    • @stefanalecu9532
      @stefanalecu9532 11 днів тому

      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.

  • @JoshuaDbener
    @JoshuaDbener 11 днів тому

    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!

  • @OfflineOffie
    @OfflineOffie 11 днів тому

    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.

  • @Speykious
    @Speykious 11 днів тому

    Wow. I didn't know about texture arrays! That's something I'll recall next time I do rendering code again.

  • @polybay
    @polybay 12 днів тому

    using yume nikki fangame music in the video is based

  • @polybay
    @polybay 12 днів тому

    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

  • @splits8999
    @splits8999 12 днів тому

    this is so interesting and valuable to me, thanks alot