Crafting a Better Shader for Pixel Art Upscaling

Поделиться
HTML-код
  • Опубликовано: 1 авг 2024
  • In this episode, we explore a subject that was only tangentially related to my game project: rendering pixel art with anti-aliasing. Applications for this technique range from anti-aliasing for pixel-art textures in low-poly games like Minecraft, to games that primarily feature pixel art sprites in 3D environments, like Octopath Traveler. This video was submitted as an entry to the #SoME3 competition.
    Check out some extra discussion of the topics covered here over on Patreon:
    / 83276362
    Timestamps:
    00:00 The aliasing problem
    01:18 An existing solution
    01:41 Background knowledge
    02:49 First shader
    03:42 Distortion
    04:17 Box filter
    06:07 The problem
    07:12 The solution
    08:31 Final shader
    10:27 Transparency
    11:24 Gameplay
    Music:
    lofi geek - give me
    lofi geek - souls
    lofi geek - real
    lofi geek - two lifes
    lofi geek - lights
  • НаукаНаука

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

  • @samuelmediani
    @samuelmediani Год назад +334

    The quality and clarity of this video is surprising. You are both a great programmer and educator

    • @loco-ok5bi
      @loco-ok5bi 9 месяцев назад +2

      and animator

    • @X22GJP
      @X22GJP 8 месяцев назад

      Saying to somebody, "I'm surprised you did so well" is actually kinda' insulting, no matter how good the intent.

    • @t3ssel8r
      @t3ssel8r  8 месяцев назад +8

      no harm no foul

  • @aarthificial
    @aarthificial Год назад +312

    Fascinating video! I'm currently using the naïve method of first scaling up by the floored ratio using nearest neighbor and then scaling up the result with bilinear filtering. I need to give your method a try.

    • @t3ssel8r
      @t3ssel8r  Год назад +133

      yo ty for the motion-canvas it made those code animations so painless (unlike almost everything else about making this video lmao)

    • @CloudPhase
      @CloudPhase Год назад +12

      I was literally thinking about you throughout this entire video, I even considered reaching out to you about this video as I would love to see you implement something like this in your own game so this is great to hear.

    • @clankfish
      @clankfish Год назад +15

      i mix you two guys up constantly

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

      ​@@clankfish😂 same

    • @meme-tastic6089
      @meme-tastic6089 Год назад

      @@t3ssel8r BROOO I WAITED FOR 2 YEARS U STILL DIDNT GIVE OUT UR 3D TO 2D ART MAKERRR. PLSS MAKE IT AVAILABLE TO BE DOWNLOADED.

  • @MercurySteel
    @MercurySteel Год назад +450

    I didn't understand a single thing but it was fun to watch

    • @JJalmanke
      @JJalmanke Год назад +9

      동감한다

    • @MercurySteel
      @MercurySteel Год назад +15

      @@JJalmanke
      я не говорю по-китайски

    • @ciso
      @ciso Год назад +11

      ​@@MercurySteel I think he he said that he agrees

    • @D01Light
      @D01Light Год назад +7

      T'as pas tord

    • @Jlewismedia
      @Jlewismedia Год назад +5

      ​@@ciso booga wooga ooga

  • @unconnectedatgmail
    @unconnectedatgmail 9 месяцев назад +30

    I love learning about all of the difficulties that are hiding just beneath the surface of things we encounter in everyday life. Thanks!

  • @ChillestDudeEver
    @ChillestDudeEver Год назад +63

    After discovering this channel, I binged the content so hard. Concise explanations, logical flow through the explanations, high production quality, practical applications of concepts... These videos are just superb from both an educational and entertainment perspective. Kudos!

  • @snesmocha
    @snesmocha Год назад +213

    always love a nonbullshit full explenation of a system!

    • @Jake28
      @Jake28 Год назад +3

      explanation*

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

      @@Jake28 um, comments already hearted so ummmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm 💀

    • @Jake28
      @Jake28 Год назад +6

      @@snesmocha just let people discover the correction in the replies on their own

    • @snesmocha
      @snesmocha 3 месяца назад

      @@Jake28I return to this comment 10 months later and am just face palming rn 😂

  • @sgtreckless5183
    @sgtreckless5183 Год назад +37

    This might have been the first complex shader video that I've seen that I was able to follow each step of. Really great vid!

  • @LordFaultier
    @LordFaultier Год назад +24

    Your overview of these mechanics have been very helpful and pretty insightful for my own projects. You are truly brilliant! Thanks for putting out such a wonderful content :)

  • @pixelarp
    @pixelarp Год назад +20

    Been waiting for a new upload from you! Last video was a treat! Keep it up, both your game and yout videos!!

  • @interessts5033
    @interessts5033 Год назад +2

    I have been watching youtube videos for about 10 years or so and this is no joke the very best one I have ever seen. The amount of work you must have put into this seems so much! Congratulations!

  • @semmu93
    @semmu93 Год назад +6

    the animations in this video are seriously jaw-dropping. such a high quality work, very easy to understand and follow, well done!

  • @capsey_
    @capsey_ Год назад +6

    Never thought of using bilinear sampling as box average. Love your videos, they are unique that you deep dive into heavy math and technical details about niche problems while keeping it extremely approachable and entertaining! Visualizations are well made

  • @BenjaminCode
    @BenjaminCode Год назад +5

    The amount of work you put in this video to teach us something that should be so hard to grasp is insane. As a RUclipsr myself, I see all the work there is behind this video and it makes me even more grateful.
    As usual Tim Soret's recommendations are dope.

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

    I've always loved how your videos explain topics in detail while making good use of visual demonstration. Where I would have been stuck on how perspective effects anti-aliasing, I understood in seconds with the warped quadrilaterals.

  • @MrA6060
    @MrA6060 Год назад +6

    Dicovered this channel with the absolutely brilliant animation with math video, and it just keeps on providing cool, informative and very well made videos

  • @bobthedeleter
    @bobthedeleter Год назад +2

    always a good day when this guy uploads. keep up the videos, you have a talent for explaining these concepts in such a concise way!

  • @j_smith_
    @j_smith_ 9 месяцев назад +5

    Congratulations on the #some3 win!

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

    Awesome! Always a treat when you upload! love the detail and editing that goes into these explanations. I could imagine this'll help a lot of people.

  • @1ogic948
    @1ogic948 Год назад

    I love learning about technical details like this. Excellently presented.
    Also, looks like a lot of work got done on the gameplay and such, which is looking very exciting!

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

    Amazing vid and your game at the end looks sick, can't wait for the next update on that project. Keep up the stellar work!

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

    I really appreciate the way you go into great detail about technical aspects that might not seem as important in the grand scheme of things - really perfecting them. I'm sure when this all culminates into your game, you will be able to feel that extra layer of polish. Looking forward to disecting this when I get my hands on it! Great work as always. :^)

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

    Your video editing, the way how you explain things and subjects are pretty impressive. You are very talented man!

  • @nibbler7
    @nibbler7 Год назад +5

    BABE WAKE UP, t3ssel8r UPLOADED A NEW VIDEO!!!

  • @retro_marco3363
    @retro_marco3363 Год назад +2

    Man, you are on some big brain stuff. Amazing results for next level pixel art!

  • @GGCannon
    @GGCannon Год назад +3

    Holy... I started re-watching your older videos yesterday, wondering when you'd post a new one because it had been a while and just woke up today to this *GIFT*.
    Love your content and one of my wish is to develop the skill set to do something similar to what you do.
    Thank you for the video.

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

    Wow, this was a phenomenal video! Seeing how far your game has developed over the past few years has been great, but these explanations are something in a league of their own. Excellent job!

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

    Keep it up! Love how much your content has grown, from the twitter gifs to here, it's great

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

    absolutely incredible. you have a gift for this. amazing visualizations

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

    I am so happy to see you come back! Your videos are really hard but very useful!

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

    no video in 10 months, I randomly check out this channel and here you are.
    I just realised that this is probably how all 3D texture editors work, like blender textured view and substance etc. At least it has the same effect.
    The effect it has on your game is perfect!

  • @pheelgad5455
    @pheelgad5455 Год назад +2

    THIS GUY IS SO FREAKING SMART DAM

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

    You're back! I'm going to have to try this for one of my projects.

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

    I cant tell you how exciting it is to get another video from you! Leaving another comment after watching. :)

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

    I really love watching your videos. Keep up the great work! Can't wait to see more.

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

    Excellent presentation. Very clear, very easy to understand, and absolutely zero frills. This is fantastic content.

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

    Love how in-depth you go in these videos

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

    Wow! I made a similar implementation when trying to make multi-colored SDFs, and while I directly went with the fwidth() approach, I hadn't considered updating the uv gradients nor the sampling window!
    Also having the explanation as to why this works in the first place was amazing! Thank you so much for these videos!

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

    I'm absolutely floored by the quality, skill, and knowledge on display here.

  • @user-md4cu9iq3f
    @user-md4cu9iq3f 10 месяцев назад

    Please never stop doing this so high quality explanatory videos, I'm just amazed

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

    You are such an incredible creator and thinker. Just so deeply impressed 🙇‍♂

  • @sw97058
    @sw97058 Месяц назад +1

    This was a game changer. I am working in Godot and with a simple translation this shader is working better than any other option, including heartbeasts jitter-free scaling shader. This is perfectly upscaling my 720p pixel art to 1080p.

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

    been watching this series since day 1 and i cant wait to see the final product i love every video

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

    This is cool! I've been stuck on working with OpenGL stencil buffers to achieve something similar to octopath, but its inspiring to see progress in this art style

  • @therealgamewizerd
    @therealgamewizerd Год назад +3

    I'm probably never going to use this specific type of shader ever, but the quality of the video was so good and the production value felt so high that I feel you earned a sub regardless. Incredible video

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

    That video is fully amazing, loved every second and stored as a reference.

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

    So happy you are back!

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

    My guy, your videos are amazingly helpful and well done

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

    Great video, really stellar visualizations

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

    I think this will be very useful for my rendering engine. thank you for the amazing explanation

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

    Great approach, and easy to understand.

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

    glad to see you dev blossom, been subbed

  • @aloysiuskurnia7643
    @aloysiuskurnia7643 8 месяцев назад +1

    The amount of math that goes into just 5 lines of shader code is crazy. It feels satisfying.

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

    bro you are amazing, your are the one that inspired me to build my game in similar style to yours . keep going bro 🖤

  • @Tubeytime
    @Tubeytime 11 месяцев назад +3

    As a digital artist, I understand this concept intuitively, but not mathematically. Fantastic explanation, I'm sure.

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

    I love your art style for your own game! I want to play it!

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

    such a high quality video, love it!

  • @denisbryukhachev3663
    @denisbryukhachev3663 8 месяцев назад +1

    Maaaan instant subscribe to your patreon, wish you good luck with your project!
    Don't forget to add some content before release (weapons, abilities, enemies), this beatiful game must be played by a lot of people))

  • @normalperson4925
    @normalperson4925 Год назад +2

    good to see you again!

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

    It looks really good. I really like this style

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

    Wooww tu contenido me inspira mucho para contar una historia, me encanta tu crecimiento y como avanzas!

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

    I have no idea what you're on about but the video is weirdly relaxing and the editing is really nice. Great job

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

    Awesome as always!

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

    God like explaination, please make more of this math related content, the transformation into fwidth is so smooth!

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

    This video was very well made! Game looks awesome too as always

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

    Wow. Very clever, and very well-explained.

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

    High quality work, thank you! :)

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

    This guy is slowly teaching me math better than some of my professors. What is referred to as the deformation gradient in the video, is more generally called a Jacobian.

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

    This is unbelievably rad, great work.

  • @niklas5336
    @niklas5336 9 месяцев назад +1

    This scaling method is also useful in video/image display, in particular for solving the issue of temporal aliasing. The popular video player mpv had the (simplified) version of this scaling method for 10 years, as the name “oversample”, for both scaling and frame mixing. VLC 4 has had it a few years also.

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

    Another great video. Your game looks stunning, I hope to play it someday

  • @thygrrr
    @thygrrr 8 месяцев назад

    I've used several of these techniques, but only had an intuition. Your explanations really expanded my understanding. Your3D stuff looks absolutely stunning, and I'm considering some kind of pixelated look after switching engines from unity to Godot.

  • @PMA_ReginaldBoscoG
    @PMA_ReginaldBoscoG 9 месяцев назад +1

    Congrats on getting the first place in Grant Sanderson' favourite 25 videos of #some3🎉

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

    Congrats on the golden pi creature was a nice surprise to find your video mentioned !!

  • @Eleazarus07
    @Eleazarus07 8 месяцев назад

    Yeah! I will play this game. Seeing the techniques is wonderful.

  • @astrid.5973
    @astrid.5973 Год назад

    you make some of the best videos on game programming implementation ❤

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

    Thank you for your research and passion

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

    I’m about 6 weeks into a class on graphics programming, and this video is a really neat intersection of things I totally understand and things I don’t get at all

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

    I was just thinking how to achieve that. great video

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

    Totally great video, I can only imagine the amount of work you put into making of this!
    On a personal note I would be VERY interested in how you go about making the shader that "transforms" your 3d models into pixel art. They look incredible.

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

    I would need a few lives fully dedicated to study shaders to understand this, but even if I got a 2% that's new knowledge for me. Thanks for this superb visuals presentation, and btw your game is shaping up to be a major hit, best luck sir!

  • @FriedBacon88
    @FriedBacon88 5 месяцев назад +2

    I love your videos. Hope everything is good on your end

  • @Jay-dk6hf
    @Jay-dk6hf 10 месяцев назад

    Amazing production quality

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

    Personally, I prefer to have internal resolution set to something like 360p for that pixel KRUNCH. Just a bit annoying to make UI work.
    But that was a really cool explanation and way of thinking about the filter! Awesome video.

  • @MusicalSkele-
    @MusicalSkele- Год назад +1

    omg a new video after years

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

    wow, definitely worth the wait

  • @user-ut1xf1mg3i
    @user-ut1xf1mg3i Год назад +2

    Amazing work as usual. Your content got me really interested in shaders, rasterization, and 3D rendering in general. So much so in fact I was motivated in my linear algebra class and I'm taking the advanced class next semester in a few months. Even with all my interest though, I never understood how you got your foliage to look so good (and your game in general) and I gotta say I am extremely interested. Is there somewhere where I can find this kind of information, and if it is on your pattern I'd be more than happy to support.

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

    Return of the king !

  • @1000orks
    @1000orks 7 месяцев назад +1

    I feel very stupid for having the same problems (for dynamic UI scaling actually) and going with the first algorithm thinking this is good enough.
    Then encountering all the problems you have adressed in your solution and now realizing I should have just watched until the end and not just vaguely remember.
    Thank you - this really helped a lot!

    • @t3ssel8r
      @t3ssel8r  7 месяцев назад +3

      thanks! I was motivated from hearing similar struggles from several different teams (RadicalFish, Tim Soret, Aarthificial, ...) so I thought I would really cover all the details one is likely to run into when doing this.

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

    Great video! I'm always wondering why such basics - and by that I don't mean easy stuff, but fundamental requirements for a game engine - are not provided out of the box nowadays.

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

    Thank you! I stg it is impossible to find anyone saying that you can scale pixel art to non integer resolutions! The only exceptions seem to be Casey Muratori, a shader on shader toy, shovel knight, and a video about doing it in Godot by HeartBeast, and even the Godot documentation says it can't be done! Thank you so much for the simple description!

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

    Looking good man.

  • @hafl-evil333
    @hafl-evil333 Год назад

    The legend has returned.

  • @darenn-keller
    @darenn-keller Год назад +1

    Great job!

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

    the king has returned

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

    This video deserves more views

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

    yooo new vid, very cool !

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

    the king is back

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

    Excellent way to visually explain very interesting niche concepts! Always love your videos.
    Perhaps this is handled separately, perhaps not at all, but I’m curious - is gamma correction taken into account when blending colours? Maybe it’s high cost for little change, but I don’t know. It definitely makes it look better, so I’d imagine that if it’s not being used it’s because you looked into it and decided it wasn’t worth it.
    For anyone else interested, gamma correction is used to adjust light intensity from their display values to their physical values, then do the relevant math, then adjust them back. This is one of the biggest unsung heroes of making video games look more realistic in the last 10~15 years. For an extreme example as it pertains here, suppose you have a checkerboard pattern of 0% and 100% (black and white). Suppose you reduce resolution to half both ways, and now you have a solid grey by mixing half of each, but what does that look like? Intuitively you’d say 50%, but gamma corrected it would be 73%. To understand, get a pixel perfect screen that has the checkerboard in the middle, and each version of grey on either side, then back away or squint until the checkerboard blends into a solid grey. You’ll find that it matches the 73% and not the 50%, which is a result of how our eyes perceive light values. Most game engines and 3D renderers automatically do this now, but most other things do not by default, including OS screen settings and image and video editors.
    If you made a video about gamma correction I’d share it with everyone.

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

      modern engines do all operations in linear color space and only apply the display gamma at the end. that is also what happens here. (Although parts of the video were authored in a video editing software that operated in rec 709, so in this video you could see some variations, but in practice, nobody's gonna notice if the anti-aliasing has a nonlinear gamma)
      I probably won't make a video about it because it's a subject others are more qualified to speak about (and tbh, I hate dealing with these sorts of bookkeeping problems)

  • @BaronVonScrub
    @BaronVonScrub 8 месяцев назад +1

    This is sick! Makes me wonder a little about how a little temporal would look stacked on top of this? Might look like trash and undo eveything, or might actually lessen the effect of "pixel-jumping" when things move or rotate.

  • @christopherheardalmagrande1372
    @christopherheardalmagrande1372 8 месяцев назад +1

    Incredible videos. The 3blue1brown of game dev. Tremendously grateful for your efforts!