Harnessing the Power of GPU to Draw Pixel Art Lines - Legacy Devlog #21

Поделиться
HTML-код
  • Опубликовано: 9 июн 2024
  • Another day, another indie game devlog™. This time I'll bore you with a method to draw and simulate pixel-perfect lines in Unity.
    That's it. That's the video. We're drawing lines.
    === Support the channel ===
    RUclips Memberships:
    ruclips.net/user/aarthificial...
    Patreon:
    / aarthificial
    Reddit article: redd.it/7ppldz
    0:00 Introduction
    0:10 Drawing lines
    1:07 Simulation process
    2:10 Line editor
    Thanks for watching!

Комментарии • 320

  • @aarthificial
    @aarthificial  3 года назад +277

    Quick update
    1) I've tried to render these lines using *line primitives* connecting points A and B: imgur.com/a/Path692
    It seems that some angles are not pixel-perfect and chaining multiple lines together can result in random holes.
    2) I thought that, in Unity, there's no way to change the primitives used by a mesh.
    It's not true - MeshTopology allows you to do just that.
    So that changes quite a lot of things.
    3) Lesson learned - geometry shader bad.
    It's not supported on some hardware and tends to be less performant than, say, a compute shader.
    4) Some of you have proposed some interesting methods of using a fragment shader to draw these lines.
    I'm currently looking into them.
    All in all, thanks so much for all the feedback! I'll try to improve the way I render lines.
    There will be a follow-up video if I come up with something interesting.

    • @sadpancake6563
      @sadpancake6563 3 года назад +11

      Can you please add reddit article url to description?

    • @aarthificial
      @aarthificial  3 года назад +11

      @@sadpancake6563 Thanks, totally forgot about it.

    • @uis246
      @uis246 2 года назад +1

      Have you looked to line width and conservative rendering?

    • @sipos0
      @sipos0 2 года назад +1

      OpenGL's rules about when polygons line up are confusing. It seems like there is no good reason to need triangles along the line instead of line segments, but I can completely imagine it not working with line segments.

  • @Dastmema
    @Dastmema 3 года назад +712

    The hability of this guy to make graphs for explanations always takes me out of guard

    • @aarthificial
      @aarthificial  3 года назад +209

      This whole channel is really just an excuse for me to make these graphs at this point

    • @Dastmema
      @Dastmema 3 года назад +53

      @@aarthificial can you teach us?

    • @alex.g7317
      @alex.g7317 2 года назад +4

      @@Dastmema I take that as a no then…

    • @galaxy3432
      @galaxy3432 2 года назад

      @@aarthificial can you teach us?

    • @yokowan
      @yokowan 2 года назад +2

      momiji profile picture spotted in the wild

  • @user-qu5pv2uv5m
    @user-qu5pv2uv5m 3 года назад +450

    I really hope a level creator is added to the final game it would be so sick

    • @aarthificial
      @aarthificial  3 года назад +162

      Totally agree!

    • @qu765
      @qu765 3 года назад +72

      @@aarthificial i like this answer

  • @YohanesVienas
    @YohanesVienas 3 года назад +280

    I absolultely love what you're doing. I don't even know what Astortion is gonna be exactly, but its getting bought, simply because of the technical side of things. This is so damn impressive

    • @aarthificial
      @aarthificial  3 года назад +94

      Thanks!
      Now as I think of it, I should probably make a video about what Astortion is exactly. Because I've never really talked about this in detail

    • @lemonlordminecraft
      @lemonlordminecraft 3 года назад +19

      @@aarthificial I cannot wait, you're one creative dude

  • @brandonbaker2598
    @brandonbaker2598 3 года назад +213

    This production quality is impeccable.

  • @felicitygray7811
    @felicitygray7811 3 года назад +88

    i understand all of the individual pieces of this, but the fact that you've managed to both theorize a way to combine them AND also actually managed to follow through and build it astonishes me. thank you for sharing all of these clever ideas. your uploads are inspiring me to think more creatively about ways to make amazing things out of the skills i already have, and it's hugely empowering

    • @voidling2632
      @voidling2632 Год назад

      I understood absolutely nothing.

  • @tiredko-hi-
    @tiredko-hi- 3 года назад +63

    WITCHCRAFT!!
    I'm dying
    Edit: Forgot to say amazing visualizations (as always)
    Wasn't bored, very much like this kind of stuff. Keep it up!

  • @KingGurke98
    @KingGurke98 3 года назад +37

    So glad I found this devlog; it always gives me a huge burst of inspiration to watch what you have done! It got me to return to an old game project aswell. Though I'm always amazed at how much care you put into Astortion's looks so early on...

  • @_kett2164
    @_kett2164 3 года назад +40

    once again your stuff blows me away! You could have done it the easy way but you did it in the coolest way possible instead!

  • @t3ssel8r
    @t3ssel8r 3 года назад +19

    Cool work as usual :) Interesting how these days to get a pixel perfect line on GPU we have to resort to tessellation, geometry shaders, compute shaders, etc. In the past one might have been able to trust that GL_LINES was implemented with Bresenham's algorithm in hardware, but on my current machine this is not the case.

    • @aarthificial
      @aarthificial  3 года назад +2

      Thanks!
      Is there a way to use things like GL_LINES in SRP though?
      Also, now as you said it, I wonder if I could output a point primitive instead of a triangle in my geometry shader and make it work

    • @t3ssel8r
      @t3ssel8r 3 года назад +4

      ​@@aarthificial I haven't looked too closely at what drawing functions are permitted in SRP. on the bleeding edge, SL5 has enableRandomWrite textures, or a compute shader can write directly to texture memory.
      Another thing that came to mind was to use the vertex shader to output a 3-pixel thick triangle strip (dirty region), and use a frag shader to get the pixel perfect lines. Bresenham's isn't optimal for frag shading in this case, but O(1) per fragment algorithms exist. It might be a reasonable tradeoff on platforms that don't support more advanced shaders, such as WebGL.

  • @sofi390
    @sofi390 2 года назад +7

    Ooo have you considered using this system to give her real-time ponytail physics? I rarely see it done in pixel games and with all the innovations you’ve made it would be interesting to see! It may add a sense of physicality that would fit in well with the aesthetics! I can see how custom animations also have their own benefits as well tho

  • @takieddinbalti6956
    @takieddinbalti6956 Год назад +1

    This is so insane. I started to feel like an intermediate as a game developer. But you make me feel like an absolute beginner again. 😮‍💨

  • @erikahlundhelguera
    @erikahlundhelguera 3 года назад +5

    This is seriously amazing! I've wanted to implement the VelocityBuffer in my top down game for a while and this just convinced me to do it

  • @atakoof2257
    @atakoof2257 3 года назад +3

    Babe wake up new Aarthificial video

  • @PabloPazosGutierrez
    @PabloPazosGutierrez Год назад

    I'm not into gaming or animation, but been watching your videos, and I really like how you explain things and make visual cues. Simply awesome.

  • @m1che_
    @m1che_ Год назад

    Ur devlogs are so well made and the explanations are pretty easy to understand. I'm going to just binge every single one now.

  • @dawidpietrykowski
    @dawidpietrykowski 3 года назад

    Amazing work, quality of the animations is incredible, can't wait to see more devlogs like this from you

  • @AlmantasKli
    @AlmantasKli 3 года назад

    Gorgeous video from start to finish, super excited to see what you make next!

  • @JujuProdGames
    @JujuProdGames 3 года назад +2

    The motion graphics in this video are incredibly well made. Awesome work!

  • @canadianblitz3468
    @canadianblitz3468 3 года назад +1

    I love how you went through everything in detail!

  • @abdusalammalaev2338
    @abdusalammalaev2338 3 года назад

    I REALLY LIKE YOUR VIDEOS! This awesome infographics, this nice style of telling, minimalism and other... It is so nice to watch!

  • @salabimsalabao
    @salabimsalabao 3 года назад +5

    The editing is amazing and the game is looking really good so far!
    Also, congrats on 15k! you deserve it and much more

  • @yoctometric
    @yoctometric 3 года назад

    This is really neat! Thanks for the stunning quality and lovely explanations as always

  • @ThighConnoisseur
    @ThighConnoisseur 3 года назад +4

    really well done, good thinking

  • @gavaii
    @gavaii 3 года назад

    Love the minimalistic look of the explanations!

  • @neoclod3112
    @neoclod3112 2 года назад

    Wow that is beautiful! Well done and thank you for sharing your video.

  • @krycerkris
    @krycerkris 3 года назад

    Love your videos! Clear, informative, visually interesting. And the project itself is simple, but full of passion! Amazing work!

  • @igrb
    @igrb 3 года назад

    The systems you make for the game are so cool, really like how you explain them

  • @LanK111er
    @LanK111er 3 года назад +4

    hey love your way of going about things by finding the absolute best solution to the problem even if its complete overkill for what you want. It's fun to watch.

  • @vb0t429
    @vb0t429 2 года назад +1

    Impressive solution and implementation!

  • @lucianorubio9129
    @lucianorubio9129 3 года назад

    Your project is amazing!

  • @jordy15322
    @jordy15322 3 года назад

    Great editing and content as always, keep up the good work!

  • @alexanderrotmg
    @alexanderrotmg 3 года назад +3

    Community: How much detail do you want?
    aarthificial: yes.

  • @nasta4554
    @nasta4554 3 года назад

    You are a genius dude! I'm loving these videos
    keep it up

  • @elvismd
    @elvismd 3 года назад

    As always you solve these problems in intrresting ways, amazing!

  • @filipemecenas
    @filipemecenas 2 года назад

    I dont understand much , but im keeping watching ! Because It looks fantastic , im enjoying your Channel ! Thanks for sharing all this cool tips of your jorney

  • @thezestychunk5575
    @thezestychunk5575 3 года назад

    Dude I’ve been follow you for awhile now and it’s just so sick seeing you working hard and trying new things. The game looks absolutely amazing, and the art and atmosphere are perfect

  • @bishan_8617
    @bishan_8617 3 года назад

    The graphs used to explain stuff in your videos are always so satisfying & clean, also I don't know what you mean by "This time I'll bore you," this was a nice interesting video that was simple and concise :)

  • @theblackkoopa2329
    @theblackkoopa2329 3 года назад

    Just saying that all of the effort you put into explaining the technical details of your project is what keeps me, as an avid programmer myself, invested!

  • @Grivel176
    @Grivel176 3 года назад

    Absolutely Magnificent. I don't really understand all of the complexity of such a thing but the result is stunning.

  • @Lolatronn
    @Lolatronn 3 года назад +2

    1:57 I laughed a bit to hard at the "witchcraft" arrow.

  • @web_dev_cz
    @web_dev_cz Год назад

    Man, you are crazy. So inspirative, sooo well made and amazingly thought out. Kudos.
    P.S. I absolutely love your graphics, the font, the colors, the color accent and icons, work with whitespace... ah, a true bliss. I'm in daze how you manage it beside the project :) Best wishes with project and in life. (I noticed you quit your job recently what the hell you also worked fulltime ?!?!?!)

  • @monawoka97
    @monawoka97 3 года назад +16

    I've worked in the game industry for a bit now and I've started to develop a smell for when things are implemented the right way vs the wrong way. Let me tell you this smells fucking great.

  • @plusmorale
    @plusmorale 3 года назад

    Almost 4 minutes of pure infromation. Always enjoy Astortion Devlogs

  • @UnofficialFoneE
    @UnofficialFoneE 3 года назад

    Great work as always!

  • @adt4864
    @adt4864 3 года назад

    Oh my gosh these graphics are so beautiful!

  • @PrabowoMurti
    @PrabowoMurti Год назад

    Your excellent work has a great impact to the humanity. Thank you.

  • @captaincyborg1429
    @captaincyborg1429 3 года назад

    I really like the editing. Good job!

  • @sinus4784
    @sinus4784 3 года назад +1

    another amazing devlog video i can't wait for the next one!
    this was really cool i want to try to replicate this in godot at some point

  • @DolphinDev
    @DolphinDev 3 года назад

    Super interesting concept!

  • @jeanayala5239
    @jeanayala5239 3 года назад

    I'm so exiting to see how this evolve

  • @WuchtaArt
    @WuchtaArt 3 года назад

    This video is like a line: straight to the point

  • @AstonishedByTheLackOfCake
    @AstonishedByTheLackOfCake 3 года назад

    your work never ceases to amaze me, this is truly some next level shit and your dedication really shows

  • @AyyyyyyyyyLmao
    @AyyyyyyyyyLmao 3 года назад

    This is incredible. You need to man a dev team just to bring these tools to the rest of us. The world needs you!

  • @blueberrygames321
    @blueberrygames321 3 года назад

    I love how you went from explaining the compushader with arrays to an arrow with "witchcraft" and the end result. This is often how I feel about a lot of this, the math is so far beyond my paygrade its insane.

    • @aarthificial
      @aarthificial  3 года назад

      Tbf, the math would deserve a separate video but the reddit post in the descriptions does a really good job explaining it

  • @NishanGhoshgameshamelame
    @NishanGhoshgameshamelame 3 года назад

    Thumbs are held up high! Nice showcase, Also liked the memento at the end. XD

  • @joshbishop
    @joshbishop 3 года назад +1

    I never clicked on a notification thumbnail so quickly

  • @stefanguiton
    @stefanguiton 2 года назад

    Great video!

  • @plzbgaming
    @plzbgaming 3 года назад

    Impressive as always

  • @noiJadisCailleach
    @noiJadisCailleach 3 года назад

    You are a
    GENIUS!

  • @meady200
    @meady200 2 года назад

    Absolutely goddamn amazing!

  • @jgtb0pl
    @jgtb0pl 2 года назад

    that's nice form of foreshadowing

  • @mrpedrobraga
    @mrpedrobraga 3 года назад

    You're awesome, dude.

  • @hopesndreams5033
    @hopesndreams5033 2 года назад

    ohhhhhhhhhh that rope is so satisfying, I can't WAIT to play this game

  • @Skeffles
    @Skeffles 3 года назад

    That looks awesome with all those ropes.

  • @Eldarduil
    @Eldarduil 2 года назад

    wow thank you, it's very inspiring to me.

  • @tastygold
    @tastygold 2 года назад

    Shaders are absolutely brain melting to me, I have never got my head around it. I need to try learn how to make stuff like this. The velocity shader was mind blowing!

  • @RetroDead
    @RetroDead 3 года назад

    babe wake up, new Astortion devlog

  • @TeppuTeppu
    @TeppuTeppu 2 года назад

    awesome! I love performance!

  • @nikhilsood9501
    @nikhilsood9501 3 года назад

    Good Job M8.
    Obviously not only subscribing the channel but also eagerly waiting for the next video as well. ^_^

  • @Tubeytime
    @Tubeytime 2 года назад

    Never thought I would called game dev beautiful but here we are

  • @nguyenhoangminhtrung2779
    @nguyenhoangminhtrung2779 Год назад

    What is this godsends content I just found?

  • @EVILBUNNY28
    @EVILBUNNY28 3 года назад +2

    Sebastian Lague AND aarthificial upload a video on the same day! Am I in coding heaven?

  • @ZealZeal
    @ZealZeal 3 года назад

    I usually don't click on notifications, but I will make an exception out of you

  • @innovativename5268
    @innovativename5268 3 года назад

    Interesting, thanks

  • @pixelkiller67
    @pixelkiller67 3 года назад

    Very intersting !

  • @Adam-fg4ut
    @Adam-fg4ut 2 года назад

    The explanations on your code and animations are great! I wonder how you animate these explanations in your videos. Trying to copy you lol.

  • @GregoryTheGr8ster
    @GregoryTheGr8ster 3 года назад

    I love what you are doing with the GPU here! The GPU is the best invention since the invention of the personal computer itself. The GPU inspires ingenuity.

  • @syncarn
    @syncarn 3 года назад +1

    What do you do for a living? You have more skill than most professional Unity devs I work with every day!
    Great video :)

    • @aarthificial
      @aarthificial  3 года назад +1

      Thanks!
      I've been a full stack developer for about two years now

    • @syncarn
      @syncarn 3 года назад

      @@aarthificial Awesome! Not sure where you live, but if you are in the US, Canada, Argentina, Germany, or Columbia and you are interested in working on mobile games professionally with Unity then send me a message. I have some connections... :)
      Edit: Also possibly Poland which I saw listed somewhere. We have a few devs there too ;)

  • @ruzco4873
    @ruzco4873 3 года назад

    You're a genius omg

  • @gefulltetaubenbrust2788
    @gefulltetaubenbrust2788 3 года назад +1

    This video is great, you’re getting better and better with each one. Just one thing: There IS a way to render lines using the GPU, as there are render modes for that in the graphics APIs. But this might not be possible with Unity, so a rather minor point.

    • @aarthificial
      @aarthificial  3 года назад

      Thanks so much!
      I've added a pinned comment a moment ago. It may address some of the things you're referring to

  • @monsieuralexandergulbu3678
    @monsieuralexandergulbu3678 3 года назад

    3:23 big brain move ;)

  • @rainloki5363
    @rainloki5363 3 года назад +2

    the witchcraft part had me laughing, and it's 100% true.

  • @hellbufl1438
    @hellbufl1438 3 года назад

    I love it!

  • @MelonSiggi
    @MelonSiggi 2 года назад

    At this point he's about to make cloth simulation in a pixel game. Neat!

  • @SuperGamersgames
    @SuperGamersgames 3 года назад

    Small stuff like this always get me in development. No player will ever care about these additions, BUT ALL THE DEVS WILL. Like have an editor for the lines?? You're almost making me want to switch to Unity (almost)!
    Also, wow, foreshadowing and I didn't even know it.

  • @chris.davidoff
    @chris.davidoff 3 года назад

    Dang, this is an amazing creation. Not to mention, well made video!!
    I've heard the argument that you can achieve similar results if you employ the use of the Job system (and subsequently still have access to collisions). I wonder if that could apply here.

    • @aarthificial
      @aarthificial  3 года назад

      Thanks!
      Definitely, I was considering using Havok, for example, but I decided to stick with the compute buffer for now. The main reason being that DOTS physics is not production ready yet

  • @tedchirvasiu
    @tedchirvasiu 3 года назад

    This is super smart

  • @tulasigopinath
    @tulasigopinath 3 года назад

    3:07 you should make a secret room called The Room of Thousands Nodes, this is very satisfying to see

  •  2 года назад

    I love this

  • @parsuli.
    @parsuli. 3 года назад

    I cannot wait to get this game when it comes out and spend hours trying to speedrun it while my eyes rest on its fabulous art... And I've only seen two devlogs, and don't even know what kind of game it'll be (thought I suspect a platformer of some kind).

  • @mylesfranco3545
    @mylesfranco3545 Год назад

    well thats cool!

  • @liltrashpanda174
    @liltrashpanda174 2 года назад

    This is the kind of stuff that makes me want to get into game development.

  • @FireNLightnin
    @FireNLightnin 3 года назад

    You and Sebastian League are the two most talented/innovative programmers I've ever seen.

    • @aarthificial
      @aarthificial  3 года назад +3

      I'm honored to even be compared to him

  • @SilentOnion
    @SilentOnion 9 месяцев назад

    3:15 looks scary. Like hair growing out of the cealing

  • @Junivieve
    @Junivieve 3 года назад

    This man is a genius

  • @JustATempest
    @JustATempest 3 года назад +11

    The definition of over engineering. Great work!

  • @Timbobs
    @Timbobs 3 года назад

    Thank you for accurately describing a process as witchcraft 😄 I have no idea why youtube sent me here, but it’s fascinating.

  • @bezimienny5
    @bezimienny5 2 года назад

    Nice. Now we can finally get next gen 8k hair similations in 2d on our characters. Good job!

  • @Poly_0000
    @Poly_0000 3 года назад

    God, this is so cool.