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!
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.
Can you please add reddit article url to description?
@@sadpancake6563 Thanks, totally forgot about it.
Have you looked to line width and conservative rendering?
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.
The hability of this guy to make graphs for explanations always takes me out of guard
This whole channel is really just an excuse for me to make these graphs at this point
@@aarthificial can you teach us?
@@Dastmema I take that as a no then…
@@aarthificial can you teach us?
momiji profile picture spotted in the wild
I really hope a level creator is added to the final game it would be so sick
Totally agree!
@@aarthificial i like this answer
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
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
@@aarthificial I cannot wait, you're one creative dude
This production quality is impeccable.
TRUE!
Fr it’s insane
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
I understood absolutely nothing.
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!
Thanks as always!
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...
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!
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.
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
@@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.
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
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. 😮💨
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
Babe wake up new Aarthificial video
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.
Ur devlogs are so well made and the explanations are pretty easy to understand. I'm going to just binge every single one now.
Amazing work, quality of the animations is incredible, can't wait to see more devlogs like this from you
Gorgeous video from start to finish, super excited to see what you make next!
The motion graphics in this video are incredibly well made. Awesome work!
I love how you went through everything in detail!
I REALLY LIKE YOUR VIDEOS! This awesome infographics, this nice style of telling, minimalism and other... It is so nice to watch!
The editing is amazing and the game is looking really good so far!
Also, congrats on 15k! you deserve it and much more
Thank you!
This is really neat! Thanks for the stunning quality and lovely explanations as always
really well done, good thinking
Love the minimalistic look of the explanations!
Wow that is beautiful! Well done and thank you for sharing your video.
Love your videos! Clear, informative, visually interesting. And the project itself is simple, but full of passion! Amazing work!
Thanks so much!
The systems you make for the game are so cool, really like how you explain them
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.
Impressive solution and implementation!
Your project is amazing!
Great editing and content as always, keep up the good work!
Community: How much detail do you want?
aarthificial: yes.
You are a genius dude! I'm loving these videos
keep it up
As always you solve these problems in intrresting ways, amazing!
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
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
Thanks so much!
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 :)
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!
Absolutely Magnificent. I don't really understand all of the complexity of such a thing but the result is stunning.
1:57 I laughed a bit to hard at the "witchcraft" arrow.
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 ?!?!?!)
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.
+
Almost 4 minutes of pure infromation. Always enjoy Astortion Devlogs
Great work as always!
Oh my gosh these graphics are so beautiful!
Your excellent work has a great impact to the humanity. Thank you.
I really like the editing. Good job!
Thanks!
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
Super interesting concept!
I'm so exiting to see how this evolve
This video is like a line: straight to the point
your work never ceases to amaze me, this is truly some next level shit and your dedication really shows
This is incredible. You need to man a dev team just to bring these tools to the rest of us. The world needs you!
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.
Tbf, the math would deserve a separate video but the reddit post in the descriptions does a really good job explaining it
Thumbs are held up high! Nice showcase, Also liked the memento at the end. XD
I never clicked on a notification thumbnail so quickly
Great video!
Impressive as always
You are a
GENIUS!
Absolutely goddamn amazing!
that's nice form of foreshadowing
You're awesome, dude.
ohhhhhhhhhh that rope is so satisfying, I can't WAIT to play this game
That looks awesome with all those ropes.
wow thank you, it's very inspiring to me.
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!
babe wake up, new Astortion devlog
awesome! I love performance!
Good Job M8.
Obviously not only subscribing the channel but also eagerly waiting for the next video as well. ^_^
Thanks and welcome aboard!
Never thought I would called game dev beautiful but here we are
What is this godsends content I just found?
Sebastian Lague AND aarthificial upload a video on the same day! Am I in coding heaven?
I usually don't click on notifications, but I will make an exception out of you
Interesting, thanks
Very intersting !
The explanations on your code and animations are great! I wonder how you animate these explanations in your videos. Trying to copy you lol.
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.
What do you do for a living? You have more skill than most professional Unity devs I work with every day!
Great video :)
Thanks!
I've been a full stack developer for about two years now
@@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 ;)
You're a genius omg
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.
Thanks so much!
I've added a pinned comment a moment ago. It may address some of the things you're referring to
3:23 big brain move ;)
the witchcraft part had me laughing, and it's 100% true.
I love it!
At this point he's about to make cloth simulation in a pixel game. Neat!
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.
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.
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
This is super smart
3:07 you should make a secret room called The Room of Thousands Nodes, this is very satisfying to see
I love this
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).
well thats cool!
This is the kind of stuff that makes me want to get into game development.
You and Sebastian League are the two most talented/innovative programmers I've ever seen.
I'm honored to even be compared to him
3:15 looks scary. Like hair growing out of the cealing
This man is a genius
The definition of over engineering. Great work!
Thank you for accurately describing a process as witchcraft 😄 I have no idea why youtube sent me here, but it’s fascinating.
Nice. Now we can finally get next gen 8k hair similations in 2d on our characters. Good job!
God, this is so cool.