Unity Performance Tips: Draw Calls

แชร์
ฝัง
  • เผยแพร่เมื่อ 20 ก.ค. 2024
  • A short video on how to improve your frame rate in Unity. This video covers various optimizations to reduce draw calls such as combining meshes, batching and gpu instancing.
    Music Credit: LAKEY INSPIRED
    Track Name: "The Process"
    Music By: LAKEY INSPIRED
    Official SoundCloud / lakeyinspired
    Official TH-cam Channel: / @lakeyinspired
    License for commercial use: Creative Commons Attribution 3.0 Unported "Share Alike" (CC BY-SA 3.0)
    creativecommons.org/licenses/...
    Music promoted by: Chill Out Records @ goo.gl/fh3rEJ www.ChillOutMedia.com / www.LoFi-HipHop.com
    Music Credit: "KaizanBlu"
    Track Name: "Remember"
    • Instagram - / kaizanblu
    • SoundCloud - / kaizanblu
    • Facebook - / kaizanblumusic
    • TikTok - @kaizanblu vm.tiktok.com/aCYwfx/
    • TH-cam - / @kaizanblu
    Licence: Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
    • Music released by: Chill Out Records goo.gl/fh3rEJ @www.ChillOutMedia.com / www.LoFi-HipHop.com

ความคิดเห็น • 222

  • @Kapthos
    @Kapthos ปีที่แล้ว +165

    I was always so worried about poly count, always trying to keep it to a minimum, but I love it that in this video you went from 0.5 FPS to hundreds without reducing a single polygon, always kept with those 21M.

    • @Domarius64
      @Domarius64 ปีที่แล้ว +22

      There are various bottlenecks to be aware of, polycount is still one of them, but the aim is to solve the one affecting your particular situation.

    • @xomvoid_akaluchiru_987
      @xomvoid_akaluchiru_987 ปีที่แล้ว +1

      @@Domarius64 why not apply all of the performance techniques at once? As soon as you solve the original problem, shouldn't you apply the other techniques?

    • @Domarius64
      @Domarius64 ปีที่แล้ว

      @@xomvoid_akaluchiru_987 if you have infinite time, sure, you can do everything. But in the real world you are always making trade offs to get something produced in a way that still turns a profit.

    • @xomvoid_akaluchiru_987
      @xomvoid_akaluchiru_987 ปีที่แล้ว

      @@Domarius64 Ok, time constraints, sure, but if a product is finished and you're coming back to fix some things then I don't see why implementing all of them would be an issue if the product really does benefit from it. If it doesn't benefit much then I just trust myself to have common sense and see that it's not worth it.

    • @Domarius64
      @Domarius64 ปีที่แล้ว

      @@xomvoid_akaluchiru_987 that "extra time at the end" literally never happens in game dev :) you always end up releasing the game when its good enough, not because its finished, because it never is. And so you cant justify spending time on things that have no tangible benefit - remember, you said "why not do all of them?" Well, thats why not. If the game runs on the target hardware acceptably, there is no reason to optimise. Plus when you say "why noy do all techniques" like there are only 5 or something. Every different programmer could know any number of techniques they learned about somewhere, too numerous to list, you cant just "do them all".
      And more importantly, those changes will not have zero impact, there will always be knock on changes related to that, and plenty of opportunity for new bugs to be introduced at every step of the way, all which will have to be fixed, taking even more time. If its working, you leave it alone.

  • @samkwok2538
    @samkwok2538 3 ปีที่แล้ว +74

    The best Unity Performance tips on TH-cam ever

    • @lucutes2936
      @lucutes2936 2 หลายเดือนก่อน

      indeed

  • @TurboMakesGames
    @TurboMakesGames 3 ปีที่แล้ว +183

    Great overview. I liked how you you showed multiple levels of improvement and how each setting improved frame rate and batches 👍

  • @Imry0411
    @Imry0411 ปีที่แล้ว +41

    This will definitely be added to my greatest-unity-tutorials-of-all-time list.

  • @ivo435
    @ivo435 ปีที่แล้ว +20

    You single-handedly saved my project. I went up from average 28-30 fps to 160 lol. Thank you so much

    • @dertobbe1176
      @dertobbe1176 หลายเดือนก่อน

      How are you doing mate? Is your game realesed yet?

  • @iLikeCoffee777
    @iLikeCoffee777 3 ปีที่แล้ว +10

    Okay these are some really good tips explained very well and I absolutely love the cat at the end!

  • @harrykingsley7915
    @harrykingsley7915 3 ปีที่แล้ว +29

    These are very professional and excellent quality tutorials. Keep up the good work!

  • @gneisskitty9359
    @gneisskitty9359 2 ปีที่แล้ว +3

    Helpful, concise, and clear. Thank you for taking the time to make this video.

  • @bifrostbeberast3246
    @bifrostbeberast3246 5 หลายเดือนก่อน +2

    Conscise, precise and short. Sir, you have mastered the art of tutorials and I am eternally grateful!

  • @Foxyzier
    @Foxyzier 3 ปีที่แล้ว +6

    the simplest and most understandable video on that topic thanks

  • @peteyoshea
    @peteyoshea 3 ปีที่แล้ว +4

    This is so well explained. Great video!

  • @Louis-ko4yq
    @Louis-ko4yq 3 ปีที่แล้ว +2

    Great work, the overall quality of the video is really high, please continue :)

  • @TheSateef
    @TheSateef ปีที่แล้ว +1

    i love these short concise videos full of great info, thanks so much

  • @dreamisover9813
    @dreamisover9813 2 ปีที่แล้ว +2

    Great overview, quick and to the point, thanks

  • @cristhiancantillo4922
    @cristhiancantillo4922 2 ปีที่แล้ว +1

    Short and clear. Nice vídeo man

  • @fakename3208
    @fakename3208 2 ปีที่แล้ว +1

    Awesome video thank you bro. Loved the visuals and explanations. I now know exactly what I need to do for my use case.

  • @thatsalot3577
    @thatsalot3577 2 ปีที่แล้ว +2

    This video is a gem, small but extremely valuable.

  • @Trashloot
    @Trashloot 2 ปีที่แล้ว

    So much good information in such a short video. Just wow.

  • @raploky
    @raploky ปีที่แล้ว +1

    I CAN'T EXPLAIN HOW EFFICIENT IT IS!
    THANK YOU!

  • @PedroL.Rosario
    @PedroL.Rosario 2 ปีที่แล้ว

    Really nice, tutorials for enhance the game performance is one of my favorites, very useful!

  • @andreidaniel687
    @andreidaniel687 ปีที่แล้ว

    Thank this is amazing I've been looking for something like this for a while now!

  • @INeatFreak
    @INeatFreak ปีที่แล้ว

    Quick and accurate! Great video 👍

  • @kedidjein
    @kedidjein 2 หลายเดือนก่อน

    i learnt more with your video than a lot of time on unity docs and asset store...thanks a lot perfect explanations

  • @nikbivation
    @nikbivation 2 ปีที่แล้ว

    thank you for this! so much info in so little time

  • @howtogamedev_
    @howtogamedev_ ปีที่แล้ว

    This was really cool, finally got to know why batching

  • @jamesthiel5721
    @jamesthiel5721 2 ปีที่แล้ว

    Nice thank you, this is very clear, easy to understand and successfully removes doubts on the subject.👍🏼

  • @ObviousDev
    @ObviousDev 3 ปีที่แล้ว

    Great tutorial! Very underrated channel in my opinion :)

  • @ArranAsh
    @ArranAsh 2 ปีที่แล้ว

    Thank you so much, my game had a lot of belts in it and this was a great way of cutting down usage

  • @TobeasJ
    @TobeasJ 4 หลายเดือนก่อน

    Very clean and easy to understand.

  • @limsengyong2122
    @limsengyong2122 2 ปีที่แล้ว

    very well-explained, thanks for the tips!

  • @specialgorilla
    @specialgorilla 2 ปีที่แล้ว

    Dang I had no idea this was even a thing! Fantastic tutorial

  • @marshallross3373
    @marshallross3373 ปีที่แล้ว

    Great tips! Thanks!

  • @FireFox64000000
    @FireFox64000000 11 หลายเดือนก่อน +1

    Woah nelly this is going to be so useful.

  • @squonkbot9487
    @squonkbot9487 2 หลายเดือนก่อน

    It's men like you that make the world a better place, I watch tons of videos on the same thing but you broke it down simple and easy to digest.

  • @GabrielDias0223
    @GabrielDias0223 2 ปีที่แล้ว

    Incredible video, thank you so much!

  • @Sail_VR
    @Sail_VR ปีที่แล้ว +1

    SO USEFUL THANK YOU!!!

  • @faiqali4915
    @faiqali4915 3 ปีที่แล้ว

    The only good video about batches on youtube

  • @gabangang5093
    @gabangang5093 3 ปีที่แล้ว

    Nice tips, 800th subscriber. :D

  • @AndrewDreamKeeper
    @AndrewDreamKeeper 2 หลายเดือนก่อน

    thnks dude! powerfull information 👍

  • @Juss_Chillin
    @Juss_Chillin 2 ปีที่แล้ว +1

    Thank youuu, I needed this soooo much for my mobile app! So, thank you ^-^

  • @aaronjenkins2225
    @aaronjenkins2225 2 ปีที่แล้ว

    i wish i saw this video months ago, great advice!!!

  • @Foxtrot6624
    @Foxtrot6624 9 หลายเดือนก่อน

    Absolutely fantastic. I had no idea that marking an object as static actually did anything without scripts or rigid body’s applied to them

  • @mimsii4200
    @mimsii4200 4 หลายเดือนก่อน

    Really cool, thanks!

  • @liulinzhifu
    @liulinzhifu 2 ปีที่แล้ว +1

    very informative, thank you!

  • @bambusz0131
    @bambusz0131 2 ปีที่แล้ว

    Very good and helpful! Thanks!

  • @IslamAudioStation
    @IslamAudioStation 2 ปีที่แล้ว +1

    Very important and very helpful lesson.

  • @yatah
    @yatah 2 ปีที่แล้ว

    Very clear and helpful vid! thx!

  • @glebparshikov1351
    @glebparshikov1351 ปีที่แล้ว

    That is brilliant. Finally, I understand!

  • @shobeon
    @shobeon ปีที่แล้ว

    What a nice tips! gonna try it

  • @schizoscope8703
    @schizoscope8703 2 ปีที่แล้ว

    Thanks for clear explanantion!

  • @HonorLone
    @HonorLone ปีที่แล้ว

    short and informative
    thanks!

  • @luizfellipe1206
    @luizfellipe1206 3 ปีที่แล้ว

    Very intuitive instructions 10/10

  • @piyushguptaji402
    @piyushguptaji402 4 วันที่ผ่านมา

    ngl that funnel animation was mesmerizing asf 🤤

  • @onemanonmars6478
    @onemanonmars6478 ปีที่แล้ว

    Great video! Thanks-

  • @Banaaani
    @Banaaani ปีที่แล้ว

    Thanks. This is insanely helpful.

  • @dertobbe1176
    @dertobbe1176 หลายเดือนก่อน

    You accidently exolained what happened to my scene. Ty I got it ans will make use of it ❤

  • @ClintochX
    @ClintochX 8 หลายเดือนก่อน

    Thanks so much for this video

  • @TruGameRage
    @TruGameRage ปีที่แล้ว

    wow this was informative! thanks a lot

  • @gddhyper4913
    @gddhyper4913 ปีที่แล้ว

    Back after lots of months and now i understand

  • @baldipogchamp8926
    @baldipogchamp8926 2 ปีที่แล้ว

    Been making jam games in unity for 2 years now, did not realise how important the Static tickbox was. Never used it before, changing that now!

  • @kevinramirez-rq8sy
    @kevinramirez-rq8sy 2 ปีที่แล้ว

    Very well explained!

  • @captaincommando9839
    @captaincommando9839 ปีที่แล้ว

    insanely useful considering i was using multiple materials for flat coloring instead of just using a texture.

  • @ZeroStas
    @ZeroStas 10 หลายเดือนก่อน

    Perfect tutorial

  • @ThefamousMrcroissant
    @ThefamousMrcroissant ปีที่แล้ว

    This is a very nice format to explain performance though: gradual improvement.

  • @Nightmare_Developer
    @Nightmare_Developer ปีที่แล้ว +1

    Loved it !! when i was about to upload my game i searched this and all the top results were just making the game look like potato 🥔 and today i found this video :) honestly TH-cam should push this video more...

  • @in801fo5
    @in801fo5 2 ปีที่แล้ว

    Thank you, keep up the good work! :)

  • @disdathit
    @disdathit 2 ปีที่แล้ว

    Nice vid, thanks 😊

  • @narendrakumarjha734
    @narendrakumarjha734 ปีที่แล้ว

    you saved me. thanks man!

  • @MAINRAGAMES
    @MAINRAGAMES ปีที่แล้ว

    hatur nuhun bang. ilmunya mudah dipahami dan singkat

  • @FireJojoBoy
    @FireJojoBoy 2 ปีที่แล้ว

    This is optimization-heaven

  • @StarkTech47
    @StarkTech47 ปีที่แล้ว

    Awesome video, short, detailed with very good explanations and demonstrations, great job ! I have a question, for the GPU instancing on the material. We see in the video all building moving but how did you do that ? I suppose it thanks to compute shaders or by C# script ?

  • @aussieraver7182
    @aussieraver7182 2 ปีที่แล้ว

    This is amazing!

  • @jonajo261
    @jonajo261 2 ปีที่แล้ว

    GREAT VIDEO MAN

  • @gameplayhubindia
    @gameplayhubindia 2 ปีที่แล้ว

    Awesome Tutorial

  • @Jicefrost
    @Jicefrost 2 ปีที่แล้ว

    thx! Usefull video!

  • @DARK_AMBIGUOUS
    @DARK_AMBIGUOUS ปีที่แล้ว +1

    Please make more videos about optimizing your games to make them run smoother, thank you

  • @Reeality09
    @Reeality09 2 ปีที่แล้ว +21

    Btw. GPU Instancing will NOT work, if you have enabled SRP Batching in the Render Pipeline Settings. The SRP Batching is also better in performance reasons, because your gameobjects do not need to share the same Mesh/Material.. just the same Shader.

    • @antonovivan3008
      @antonovivan3008 6 หลายเดือนก่อน

      I’ve never tried to measure the difference in performance by myself. But according to what people write at Unity forum, SRP batcher is generally slower than static batching. It has less memory footprint and easier to use though. And in some cases GPU instancing may be more efficient than SRP batching. In case of dense grass field made of 1 instanced mesh, for example.

  • @jusdoit967
    @jusdoit967 2 ปีที่แล้ว

    Thank you man i wish if i saw your video before now

  • @QuestTaker
    @QuestTaker 3 ปีที่แล้ว

    Thank you for the guide! Super easy to understand, entertaining, and you have a sexy voice. You have it all man keep it up!

  • @ethankendall7575
    @ethankendall7575 2 ปีที่แล้ว

    Thanks this means a lot to me when I am developing on a Intel i5 2gb gpu appreciated

  • @a6gitti
    @a6gitti 3 หลายเดือนก่อน

    thanx for these tips

  • @UnityTrap
    @UnityTrap 2 ปีที่แล้ว

    Awesome video 👍

  • @bhattacharjeesantanu
    @bhattacharjeesantanu 3 ปีที่แล้ว

    Totally awesome channel !!!!!!!💥💥💥💥💥💥💥💥

  • @MrZazzy
    @MrZazzy 3 ปีที่แล้ว

    Tysm, you deserve 1k Subs :)

  • @user-uk9er5vw4c
    @user-uk9er5vw4c ปีที่แล้ว

    awesome!

  • @ELEMENTLHERO
    @ELEMENTLHERO ปีที่แล้ว +1

    Best 5 min ever spent!

  • @oozly9291
    @oozly9291 3 ปีที่แล้ว

    Great help!

  • @kurtdevries9182
    @kurtdevries9182 2 ปีที่แล้ว +2

    the ultimate guide to go from seconds per frame to frames per second.

  • @mohammedmurad7725
    @mohammedmurad7725 2 ปีที่แล้ว

    Thanks, REALLLLLY THANKSSSS.

  • @albertusbodenstein1976
    @albertusbodenstein1976 3 ปีที่แล้ว

    Thanks man! ~!you LEGEND you!

  • @vikaskumarpatel5017
    @vikaskumarpatel5017 2 ปีที่แล้ว +1

    Thank you for such a single explanation. Amazing! I do have a few questions though,
    1. How much duplicate objects with the same mesh, materials and settings?
    2. Are duplicate objects different draw calls?
    3. Are duplicates affect the CPU/CPU in the same way? For eg. two buildings with different materials which has the same mesh and two building with exactly the same mesh and material.
    4. What about complex meshes? What is people just use this technique on a mesh which is complex?
    5. What if I mark an object Static and turn on GPU instancing?
    6. Also, fbx vs obj in this case?

    • @jamesthiel5721
      @jamesthiel5721 2 ปีที่แล้ว +1

      Well, make a PREFAB of any multi-duplicate object you are planning to use. So 1 object with it's material(s) for ex. (note: prefabs can be a parent object with "nested child objects" too)
      Set it correctly, (Optimizing/combining, Static or GPU instancing) and use that prefab to build/compose.
      Make a second prefab for the different materials using the same mesh.. it's another batch for each material/mesh relation if I understand correctly.
      Unity will batch each of these separately but they will batch since a prefab is made for optimization and for batching.
      Complex meshes: just like the multiple window objects, you should combine/join all the objects like so:
      Static and or whole unbreakable objects should be combined/joined as ONE mesh. (NO need to connect all vertices like a sphere is). the breakable object would need to be seperate chunks objects which each a rigidbody component.
      Separate moving parts (animation) for car-wheels, windmills for exemples. nested in a parent object.
      Cars probably are all non-static so use gpu instancing. But not for the windmill structure -> static structure, and just for the rotating object -> gpu instancing. (although: you probably not gonna spawn 15 windmills so no real need of batching these. lol 🤣)
      Characters: usually one mesh for the body skin. for more life: 1 mesh for each eyes, and even more: the tongue and teeth/gum.
      Then customization of each cloth and bags, wearables ... is another story.. diff. approaches..
      5. GPU instancing allows object to move while Static is static cant move. there is conflict right there.. but I don't know try it.
      6. I have no clue which is best.

  • @MrZazzy
    @MrZazzy 3 ปีที่แล้ว

    Amazing Vid, 824th Subscriber

  • @potaterjim
    @potaterjim 2 ปีที่แล้ว +7

    But what about occlusion culling? If you've got an interior level made up of several walls and rooms, is it better to user lots of smaller meshes and occlusion culling?
    Or what about the middle ground: making each room a large static object, and then using occlusion culling to turn off entire rooms at a time?

  • @regys9521
    @regys9521 2 ปีที่แล้ว

    GREAT CONTENT

  • @suicune2001
    @suicune2001 3 หลายเดือนก่อน

    Thank you! One of the reasons I'm hesitant to try 3D is because I'm worried about performance. 2D is just so much easier and you don't need to worry about performance as much.

  • @farukonder8937
    @farukonder8937 2 ปีที่แล้ว

    Thank you :)

  • @galan4173
    @galan4173 3 ปีที่แล้ว

    Nice vid!

  • @Ali-ASLAN-Dev
    @Ali-ASLAN-Dev ปีที่แล้ว

    subscription for the cat and I liked it for the tip.

  • @miaan9374
    @miaan9374 2 ปีที่แล้ว

    Thanks bro

  • @zlotey6485
    @zlotey6485 3 ปีที่แล้ว +14

    I have a question about your 3rd point.
    4:05
    What should I use for organic material? For example, grass, trees, bushes, etc. - but these only "move" by a shader.
    should I use GPU instancing or static mesh?

    • @LofiDev
      @LofiDev  3 ปีที่แล้ว +22

      Good question, static batching should work for them. When I say no movement what I mean is that objects transforms should not change. Any movement done through the shader is fine.