How To Render 2 Million Objects At 120 FPS

Project files: github.com/Matthew-J-Spencer/...
Let's discover the true potential of Unity by pushing its limits. In this video, we'll explore a variety of techniques, from straightforward tweaks like data-oriented design, to more advanced methods such as direct GPU rendering and compute shaders. Join us as we uncover the power and flexibility that Unity has to offer!
Some techniques used:
Unity DOTS (burst, jobs, ecs)
RenderMeshInstanced
DrawMeshInstancedIndirect
Data-Oriented Design
Avoiding extern calls
❤️ Become a Tarobro on Patreon: / tarodev
=========
🔔 SUBSCRIBE: bit.ly/3eqG1Z6
🗨️ DISCORD: / discord
✅ MORE TUTORIALS: / tarodev

Пікірлер: 428

  • @Tarodev
    @Tarodev Жыл бұрын

    Let me know if you'd like to see anything else benched, or whatever else you'd like me to cover :) My specs: Ryzen 9 5950X 16-core GeForce RTX 3090 64GB Memory

  • @sima19995

    @sima19995

    Жыл бұрын

    How about the forgotten Quaternions?

  • @gemidytwins

    @gemidytwins

    Жыл бұрын

    Sure, mesh baking vs instances vs gpu instances, material batching, light baking, all these stuff. Also triplanar mapping with 3 textures, with 6 textures (albedo+normal), simple vs. with blending. LOD solutions: unity lod, vs other solution (like progressive mesh) + billboard + impostors. All these are very interesting.

  • @fourthgearvibez4343

    @fourthgearvibez4343

    Жыл бұрын

    There's no way my laptop with 12 fps on blender has quadruple your space with half of it being free and STILL only runs at 12-25 fps on blender.

  • @ChronoCZ

    @ChronoCZ

    Жыл бұрын

    Hey, cool video. I think you could squeeze out more performance out of mono behavior game objects by parenting them to some object. Maybe add that as a benchmark case. I believe that incorrect hierarchy might cause a few % slowdown.

  • @pieTone

    @pieTone

    Жыл бұрын

    Wait, I don't get it. Are you mental checkpoint?

  • @purplexy
    @purplexy Жыл бұрын

    I love how you prepare all these scenes to make them look so appealing and eye-catching for us. Good stuff, keep this up! 😛

  • @Tarodev

    @Tarodev

    Жыл бұрын

    The poor bitrate couldn't keep up when it reached 90k cubes > Glad you enjoy the visuals :)

  • @fabiencrescent6503
    @fabiencrescent6503 Жыл бұрын

    Increased Performance Strategies : 1:30 - Manager script instead of monobehaviours (only 1 Update() call) 2:49 - Reducing external calls (Caching position instead of asking repeatedly the transform position) 3:50 - GPU Instancing 5:21 - Multi-threading (Unity "Jobs" & "Burst") 6:58 - ECS (part of Unity Dots) 8:29 - GPU Instancing Indirect 13:09 - Camera Cache

  • @Tarodev

    @Tarodev

    Жыл бұрын

    Awesome. Thanks ❤️

  • @fabiencrescent6503

    @fabiencrescent6503

    Жыл бұрын

    You're welcome and thanks for helping Unity devs ! 😉 I'm having trouble with rendering 9 chunks of 16x16x10 cubes for a simple prototype (I didn't find the way to implement simple GPU instancing..) so I don't know yet how to use all the work you did but it seems really great !

  • @Blushter
    @Blushter Жыл бұрын

    You're the programmer with a great teaching and visualization skill sir. You're fantastic, After Breakkeys i kind of lost hope in tutorials but after discovering your channel you're indeed a blessing for Unity developers.

  • @Goomero

    @Goomero

    Жыл бұрын

    dis foo stuck in tutorial hell

  • @MidasButSilver
    @MidasButSilver Жыл бұрын

    Your vids are amazing; fun to watch, very interesting and always filled with info. Also love that you always include similar scenarios with the different tools we have available to show their drawbacks/advantages

  • @iHeartGameDev
    @iHeartGameDev Жыл бұрын

    Taro, you explained all of this so well!! I admittedly don't know a single thing about ECS, Dots, GPU instancing but even from that position, I came out of this seeing the real benefits of those systems. Awesome job and love having you back making vids :)

  • @Tarodev

    @Tarodev

    Жыл бұрын

    Ahh, thanks Nicky ❤️

  • @simoncodrington
    @simoncodrington7 ай бұрын

    This one was fascinating mate, really liked the visually focused explanations, showcasing the tangible FPS improvement along the way.

  • @lavisch837
    @lavisch837 Жыл бұрын

    Man, I really want to get into DOTS. Really seems like it's the future of Unity development.

  • @Tarodev

    @Tarodev

    Жыл бұрын

    More performance than you could ever really need, to be honest

  • @mrslake7096

    @mrslake7096

    Жыл бұрын

    I think it's not worth the cost of time & complexity for most projects

  • @Tarodev

    @Tarodev

    Жыл бұрын

    @@mrslake7096 Yup, 90% of indie games will never need to touch it. The ones which do will most likely only need jobs & burst. Even for a game like vampire survivors, ECS is not really a requirement.

  • @MuhammadHosny0

    @MuhammadHosny0

    Жыл бұрын

    not worth it unfortuantely

  • @maxfun6797

    @maxfun6797

    Жыл бұрын

    ​@@MuhammadHosny0 it's absolutely worth it if you want to make games with multiplayer and mlagent ai. Infact it is necessary, my game lags so much without it, and I used a small count of very simple ai. Yes without these 2 things, it's probably not worth it. BUT... dots isn't actually hard to figure out. The hardest thing imo in unity is multiplayer (but only because my game is complex), everything else takes a day to learn.

  • @gamecreatorc
    @gamecreatorc Жыл бұрын

    I'll have to keep this in mind. Love what you do for the community!

  • @KonaiNobi
    @KonaiNobi Жыл бұрын

    WOW!! This was a fantastic video. I've been dabbling in learning Jobs+Burst but this demo was just amazing, gonna have to put more effort into getting my head around that .

  • @COL4NTUOMO
    @COL4NTUOMO Жыл бұрын

    Man! I think you are one of the best unity creators in yt.. Your explanation is clear and you really know what you talking about I would love to watch a serie where you create a game from scratch using all those techniques

  • @minhmino6445
    @minhmino6445 Жыл бұрын

    your video is really great , help me learn a lot, and seeing 10k objects on screen at the same time with high fps is so awesome and fun to watch

  • @edmundjr.salcedo7854
    @edmundjr.salcedo7854 Жыл бұрын

    This is the best AD for Dots and ECS

  • @alaslipknot
    @alaslipknot Жыл бұрын

    Very insightful as usual, thanks a lot! there is really not a lot of good in depth resources about doing GPU Instancing, it would be amazing if you can a video exclusively about that.

  • @Tarodev

    @Tarodev

    Жыл бұрын

    I can do that :)

  • @Louis-nh1ei

    @Louis-nh1ei

    Жыл бұрын

    @@Tarodev Please do good sir :)

  • @YoupiMatos2

    @YoupiMatos2

    4 ай бұрын

    @@Tarodev I'm gonna second this suggestion, the lack of resources is really sad, it feels like there's an abyss between a mid level Unity developer and an advanced one, because these techniques are only shown through examples but barely explained in detail. Please do! Thanks in advance!

  • @Astoaria
    @Astoaria Жыл бұрын

    Great work! One of the best gamedev videos I stumbled upon in a while!

  • @rolandinnamorato1953
    @rolandinnamorato1953 Жыл бұрын

    love this style of incremental enhancement.

  • @VEETEEGameStudio
    @VEETEEGameStudio Жыл бұрын

    I love these new test and experiment videos , keep it up man💜

  • @antijulius
    @antijulius Жыл бұрын

    Absolutely love this content. Thanks for taking the time to systematically clear these things up and visually show the difference.

  • @Tarodev

    @Tarodev

    Жыл бұрын

    No problem, it was a lot of fun 😊

  • @jujhar.
    @jujhar. Жыл бұрын

    You're one of the best devs in the pass it on challenge, awesome work man

  • @Jalechah
    @Jalechah Жыл бұрын

    wow! This blows my mind, and gives me a lot to think about and research. Cheers mate. great Vid.

  • @orangejuicetech-qdtgs6669
    @orangejuicetech-qdtgs6669 Жыл бұрын

    So love your channel Taro ❤ it could touch my feeling again about development industry

  • @xanderlinhares
    @xanderlinhares Жыл бұрын

    That was rad. Keep up the awesome work!

  • @stevennassef
    @stevennassef Жыл бұрын

    GREAT VIDEO!. i really like these comparison videos. very useful and descriptive thank you!

  • @MrZtapp
    @MrZtapp5 ай бұрын

    Every time I watch your videos I learn something new. A lot to try to understand but this is uber usable for my next project, Bookmark. Thanks.

  • @jubinjajoria2870
    @jubinjajoria2870 Жыл бұрын

    Can we expect some ECS DOTS Tutorials?

  • @Tarodev

    @Tarodev

    Жыл бұрын

    This could be in the cards

  • @Louis-nh1ei

    @Louis-nh1ei

    Жыл бұрын

    @@Tarodev I was going to ask the same thing ! Just want to push this haha

  • @gavintantleff

    @gavintantleff

    9 ай бұрын

    ECS DOTS is dead. It’s never coming out. I promise you. Not worth investing in

  • @jubinjajoria2870

    @jubinjajoria2870

    9 ай бұрын

    @@gavintantleff I respect your opinion, but you can't just put your opinion as facts. I would like to hear some stats/facts/ research that can back your answer.

  • @gavintantleff

    @gavintantleff

    9 ай бұрын

    @@jubinjajoria2870 the fact that most dots libraries are not getting any real work done, there are no updates or information about dots, deadlines missed significantly. Of course I can’t know that Unity is dropping it, but it sure seems to me like they are. Why they don’t just come out and say it, I have no clue. The only dots related feature that seems like it’s being kept is tasks and burst

  • @flynnmc9748
    @flynnmc974810 ай бұрын

    Insanely helpful to see these steps broken down like this, thanks for the video :)

  • @TaAnderson-Google
    @TaAnderson-Google Жыл бұрын

    Yes, it was fun and yes, I learned something. This is to be expected from Tarodev, but NEVER taken for granted. Thank you Sir. Stellar as always.

  • @Tarodev

    @Tarodev

    Жыл бұрын

    Good to see you're still here, Tristan 😊

  • @Tharky
    @Tharky Жыл бұрын

    Amazing video again, I was wondering how to do gpu instancing and this really helped :)

  • @vdvgames
    @vdvgames10 ай бұрын

    Great vid! :) Was always undecided over individual scripts compared to a single loop.

  • @OG_Space_Viking
    @OG_Space_Viking8 ай бұрын

    This is massive, I'm making a satellite tracker that I've been trying to optimize forever and this is what I've been looking for, thank you.

  • @TurboMakesGames
    @TurboMakesGames Жыл бұрын

    Awesome performance comparison man!! Very thorough 💪💪

  • @Tarodev

    @Tarodev

    Жыл бұрын

    The DOTS 🐐 has landed

  • @talal2245
    @talal2245 Жыл бұрын

    Legend mate. Very insightful!

  • @beardordie5308
    @beardordie5308 Жыл бұрын

    Some big surprises here, thanks!

  • @riddheshzaveri8103
    @riddheshzaveri8103 Жыл бұрын

    Wow, its so mind blowing that often its not about the engine but the developer himself regarding how much can you extract the performance out of the engine.

  • @agustinlado
    @agustinlado Жыл бұрын

    What an excellent video! Advanced concepts, smooth implementation and succinct. I'd love to have this exact same thing for Unreal Engine and to be able to compare both, but I see you focus exclusively on Unity.I've got a bit to learn about Unreal and shaders before I can do this but I definitely will at some point. Thanks for sharing your knowledge!

  • @Tarodev

    @Tarodev

    Жыл бұрын

    I would absolutely love to see an Unreal comparison. UE is looking INSANE recently.

  • @gemidytwins
    @gemidytwins Жыл бұрын

    Subscribed, just another very cool content. Thank you.

  • @supairo6539
    @supairo65396 ай бұрын

    This is actually very helpful. I am currently working on a Game that has to update the position of many thousands of GameObjects. I will definetly try to implement some of these things to boost the performance.

  • @hoody4289
    @hoody4289 Жыл бұрын

    I will treasure this video like Golum treasures the ring. Thank you so much, the visuals and explanations are perfect !

  • @bluzenkk
    @bluzenkk Жыл бұрын

    I learned something. Thanks. I love your videos. very informative. looking forward to your next video. DOTS are hard. Amazing how you can write them as if its nothing. I hope I can become a great coder like you one day~ if possible, please make more video on dots in the future. or other performance related topics are fine too.

  • @Tarodev

    @Tarodev

    Жыл бұрын

    More DOTS? Can do!

  • @YouCodeThings
    @YouCodeThings Жыл бұрын

    Fantastic - great examples!

  • @airONAIR
    @airONAIR Жыл бұрын

    Amazing video, thank you so much for making this!

  • @bkky9
    @bkky96 ай бұрын

    Awesome video! It reminds me of Dyson Sphere Program, the devs offload everything they can to the GPU to get insane performance out of Unity

  • @yaarrghmematey
    @yaarrghmematey5 ай бұрын

    Thank you! Thank you! Thank you! I never knew of GPU Instancing Indirect! Bloody hell, that is a game changer for our Voxel Engine, so glad to have found your video and can't wait to implement this indirect instancing. 😊

  • @brandenimmerzeel8182
    @brandenimmerzeel8182 Жыл бұрын

    tarodev is the real MVP

  • @smittywerbenjj1
    @smittywerbenjj1 Жыл бұрын

    This is really good. Please more!

  • @xaldioDev
    @xaldioDev Жыл бұрын

    Love these tests!

  • @Hazzel31337
    @Hazzel31337 Жыл бұрын

    i knew from jason weinmanns gamedev show that you should do your own game loop instead of the monobeheaviours and that ECS ist fast, but your video is like a massiv sun shinning light on this topic and helping me understand, 100/10 quality content! thank you so much

  • @DarkSmugLoser
    @DarkSmugLoser Жыл бұрын

    Solid work, subscribing.

  • @Tarodev

    @Tarodev

    Жыл бұрын

    Welcome 🙏

  • @twinjuke
    @twinjuke Жыл бұрын

    Now subscribed, very useful stuff here! Thank you.

  • @paulmeynckens6676
    @paulmeynckens667610 ай бұрын

    Waouh! What an amazing and instucting video ! Thank you so much.

  • @the0neskater
    @the0neskater8 ай бұрын

    Incredible video, well done!

  • @bryanhooi9132
    @bryanhooi9132 Жыл бұрын

    i not very good in English but the way you teach ..wow .! thank a lot Tarodev ..i love your video

  • @Tarodev

    @Tarodev

    Жыл бұрын

    Glad you enjoyed ❤️

  • @D-Dev
    @D-Dev Жыл бұрын

    Really impresive experiment!

  • @user-uk9er5vw4c
    @user-uk9er5vw4c8 ай бұрын

    terrific video! subbed

  • @Tarodev

    @Tarodev

    8 ай бұрын

    Welcome aboard 😊

  • @mfaxyz
    @mfaxyz5 ай бұрын

    The most underrated technical tutorial.

  • @WeslomPo
    @WeslomPo Жыл бұрын

    Caching variable does make a difference. Especially on mobile devices, where we don't have much rich instruments to optimize our projects, and we need to be sure that it work across multiply devices.

  • @mertkalak3730
    @mertkalak3730 Жыл бұрын

    Awesome content, thank you!

  • @saqibbro5297
    @saqibbro5297 Жыл бұрын

    Amazing Video !!

  • @aliengarden
    @aliengarden Жыл бұрын

    Yessss a new TaroDev video, instant like.

  • @DLPLORD
    @DLPLORD9 ай бұрын

    This video is pure gold 🥇, thank you❕

  • @goldswordkiller4231
    @goldswordkiller42316 ай бұрын

    The numbers just feel so good to look at because the font you use is the supercell font, which is just hilarious. Makes me think 12 fps is good.

  • @Banaaani
    @Banaaani Жыл бұрын

    Insane how big difference some of these technologies make. It really opens up options for new games or features while keeping really good performance.

  • @chosencode5881
    @chosencode5881 Жыл бұрын

    Thank you so much! This is so helpful!!

  • @GrayFoxware
    @GrayFoxware Жыл бұрын

    Man, I missed you! This video is Amazing!

  • @Tarodev

    @Tarodev

    Жыл бұрын

    Thank you :D

  • @swalscha
    @swalscha Жыл бұрын

    Thanks for this insight on performance! It's a huge aspect of development I'm personally interested in :D If you need new topics, you could share tips to reduce the final data volume used by the build (sometimes I see games that take so many Go that I don't even understand how they have reached so much! Even considering a lot of textures midmaps and full assets integration).

  • @Tarodev

    @Tarodev

    Жыл бұрын

    Damn, that's a great video idea. It's something I could also learn a bit about, too. I've done this a few times on previous project deployments, but I feel there's a lot to learn.

  • @thisisKushagr
    @thisisKushagr6 ай бұрын

    This is so well explained, omg I didn't even know that half the things I was already doing were optimizations in the first place.

  • @MandyLeeYT
    @MandyLeeYT Жыл бұрын

    Great job

  • @bonecircuit9123
    @bonecircuit91238 ай бұрын

    great content! thanks mate

  • @sgtghost17
    @sgtghost17 Жыл бұрын

    Awesome videos!

  • @Tristan559
    @Tristan5592 ай бұрын

    Excellent video!

  • @FADIK1987
    @FADIK19876 ай бұрын

    cool, thanks for this benchmark

  • @enitalp
    @enitalp9 ай бұрын

    Very nice video, this is the way I always work, Test everything , learn the best practices, from actual experimentation. I’m caching everything, coded for years on mobile/ switch, and those caches have an impact on a 10 to 20 times, slower Cpu. Input. For exemple is costly, more on some hardware. Plus it’s not just the call of an external function, taking time, it’s also the need for the cpu to trash the data and code cache. Making the functions coming after slower, because of it

  • @chuteapps1
    @chuteapps17 ай бұрын

    Really great and intelligent video, I can tell you really know what you're doing which is refreshing to see on youtube :)

  • @Tarodev

    @Tarodev

    7 ай бұрын

    Glad you enjoyed ❤️

  • @TextGuy
    @TextGuy Жыл бұрын

    Thanks for the video, very informative.

  • @user-vd5pw4du2f
    @user-vd5pw4du2f8 ай бұрын

    Amazing!! Thank you!

  • @ryancollins4243
    @ryancollins4243 Жыл бұрын

    This dude always exploring the actually important shit. Thanks duder.

  • @flurinjenal374
    @flurinjenal3743 ай бұрын

    Crazy, top video!

  • @jonasRedStar
    @jonasRedStar Жыл бұрын

    thank you, I have learned A LOT

  • @kaasronald3623
    @kaasronald3623 Жыл бұрын

    great video as always. super useful to get started choosing optimisation techniques. It's so tempting to implement ECS once it enters 1.0, even for just the sub-scenes, but it's probably way too risky for games that release within 12 months... >:(

  • @Dominik-K
    @Dominik-K Жыл бұрын

    This was very interesting and I didn't know those APIs in Unity for GPU instancing yet

  • @TedThomasTT
    @TedThomasTT Жыл бұрын

    Great video 👏 It would be interesting comparing these techniques to using VFX graph.

  • @nikosnikolaidis3762
    @nikosnikolaidis37625 ай бұрын

    mind blowing . great video

  • @ewwitsantonio
    @ewwitsantonio Жыл бұрын

    You just converted me to a DOTS believer. I didn't really care until this video + knowing some stable release seems to be on the horizon... :) I'm diving in!!

  • @JohnK68
    @JohnK68 Жыл бұрын

    Great video, needs a follow up!!!

  • @Trashloot
    @Trashloot6 ай бұрын

    I haven't programmed anything in Years and never used unity but this video was still auper interesting:D. Amazing presentation:D

  • @felfurion8624
    @felfurion8624 Жыл бұрын

    Thank you for everything that you do

  • @Tarodev

    @Tarodev

    Жыл бұрын

    You are most welcome

  • @user-uz7cv7uf2o
    @user-uz7cv7uf2o4 ай бұрын

    Im an indie game dev, who was working on a voxel game, and my biggest issue was rendering. This will definitely help. Thanks!

  • @TheArghnono
    @TheArghnono4 ай бұрын

    I just discovered your channel today, and noticed there has not been a new video for a few months. I don't want to add to the youtuber-hamster-wheel pressure, so I'll just say I love your stuff, it is rare quality among lots of mediocrity, and if your life is in a place where you feel like continuing to make quality Unity gamedev content, I'll watch it immediately :)

  • @notDreadful
    @notDreadful Жыл бұрын

    Absolutely amazing

  • @libiroli
    @libiroli Жыл бұрын

    Video idea related to this: how to properly benchmark & profile. Recently there are new tools like memory profiling. A deep dive especially by you who has shipped actual titles would be very interesting. Thank you again!

  • @typhereus
    @typhereus8 ай бұрын

    This is mind blowing.

  • @JJNincorporated
    @JJNincorporatedАй бұрын

    Fantastically educational

  • @AINovelGenerator
    @AINovelGenerator Жыл бұрын

    It's beautiful!

  • @HiddenExp
    @HiddenExp6 ай бұрын

    Nice vid Taro! I'm curious, would you get a considerable performance improvement by implementing a force directed graph using ECS? Or would the physics involved make things messy?

  • @nickdevprod3667
    @nickdevprod3667 Жыл бұрын

    Thanks for reminding me how much stuff i dont know

  • @Tarodev

    @Tarodev

    Жыл бұрын

    I'm here for you

  • @timurradman3999
    @timurradman3999 Жыл бұрын

    Dude, that's crazy :,) I can see myself using it for bullets in my top-down shooter game

  • @RugbugRedfern
    @RugbugRedfern Жыл бұрын

    Does Rider have intellisense for shaders? Seeing the keywords highlighted in the .shader file makes me curious if it would be worth it for shader development.

  • @Tarodev

    @Tarodev

    Жыл бұрын

    It does, yes! It works right out of the box.

  • @JimPlaysGames
    @JimPlaysGames Жыл бұрын

    Wow, a really incredible difference. Thanks for the video! I haven't done anything with multithreading. Do you have a video about the job system, or one planned?

  • @Tarodev

    @Tarodev

    Жыл бұрын

    Lots of requests, so I'll do a jobs video 😊 shouldn't be too long

  • @JimPlaysGames

    @JimPlaysGames

    Жыл бұрын

    @@Tarodev Awesome :D

  • @connor43057
    @connor430577 ай бұрын

    Basically an entire intermediate computer graphics course in 10 minutes. Bravo!

  • @joeofbubba

    @joeofbubba

    6 ай бұрын

    no

  • @r8teful
    @r8teful Жыл бұрын

    Absolute god tier content.