Unity GPU Instancing in less than 7 minutes!

Поділитися
Вставка
  • Опубліковано 13 січ 2025

КОМЕНТАРІ • 45

  • @Flaroon
    @Flaroon  3 роки тому +35

    Just a disclamer, When I say 120fps with 100,000 instances I mean for my rig. Your results may vary with your setup. Thankyou for watching the video and make sure to subscribe!!! Good luck in your procedural Journey.

    • @GINZ-iv3ri
      @GINZ-iv3ri 2 роки тому +1

      Can I ask what is your pc/laptop specs?

    • @Flaroon
      @Flaroon  2 роки тому +5

      @@GINZ-iv3ri sure. I have a i7, gtx 1650 and 16gb of ram.

    • @GINZ-iv3ri
      @GINZ-iv3ri 2 роки тому +2

      @@Flaroon Oh that's nice. I was planning to buy a laptop with rtx 3050 (4gbs of vram 🤦‍♂️), will that suffice? Assuming with 100,000 objects...

    • @Flaroon
      @Flaroon  2 роки тому +1

      @@GINZ-iv3ri yes. Those specs will Def be able to run the code at 120fps.

    • @GINZ-iv3ri
      @GINZ-iv3ri 2 роки тому +2

      @@Flaroon Oh thanks! Just sub you btw.

  • @seekeroftheball
    @seekeroftheball Рік тому +26

    Great video!
    For anyone wondering about the line that is cut off. Here's a solution:
    Batches[Batches.Count - 1].Add(item:
    Matrix4x4.TRS(
    pos: new Vector3(x: Random.Range(-20, 20), y: Random.Range(-10, 10), z: Random.Range(0, 300)),
    q: Random.rotation,
    s: new Vector3(x: Random.Range(1, 3), y: Random.Range(1, 3), z: Random.Range(1, 3))));

  • @ReikoTennosaar
    @ReikoTennosaar 3 роки тому +6

    This editing is so nice keep it up!

  • @JamesWjRose
    @JamesWjRose 3 роки тому +11

    That was VERY enlightening. Thank you very much.

  • @riteshrobotics9713
    @riteshrobotics9713 3 роки тому +6

    Very nice explaination keep it up!

  • @pranaym5331
    @pranaym5331 3 роки тому +3

    This is a great video! Thanks a lot

  • @personmuc943
    @personmuc943 2 роки тому +3

    Thank you, but you can use drawmeshinstancedindirect to bypass the 1000 limit, But I have no idea how to use drawmeshinstancedindirect which is why I'm here.

  • @OPENPCreviews
    @OPENPCreviews 2 роки тому +36

    There is literally zero demonstration on this video on how to use this script and what the output is. Neither is the code all shown in the video, making this video unhelpful.

    • @mehmetchad
      @mehmetchad 9 місяців тому +3

      I don’t think this video is meant as a beginner step by step tutorial

  • @Ariel16283
    @Ariel16283 2 роки тому +4

    Aren't you still having to loop through the batches on the CPU side every frame? I am a bit confused. I recently watched that Acerola tutorial on Grass\GPU instancing and checked his code. It seems that he generates a single buffer with all the grass mesh data and sends only once to the gpu on the start function.

    • @stormer268
      @stormer268 Рік тому +1

      Use compute buffer and shader.

  • @orangejuice563
    @orangejuice563 Рік тому +1

    hey love the vid! I just wanted to ask how can I attach the grass to terrain? I'm a little new to coding

  • @animated4me
    @animated4me Рік тому

    Super Helpful, Thanks So Much!!!

  • @KevinDrongowskiSmart
    @KevinDrongowskiSmart 2 роки тому

    This was so helpful. Thank you!

  • @septarap3901
    @septarap3901 Рік тому

    5:50
    what was that s:Vector3 value?

    • @septarap3901
      @septarap3901 Рік тому

      At the very end

    • @septarap3901
      @septarap3901 Рік тому

      It got cut off-screen

    • @septarap3901
      @septarap3901 Рік тому

      was it 0,0,0?

    • @Flaroon
      @Flaroon  Рік тому

      It would have to be Vector3.one for the scale and quaternion.random for the rotation

  • @JamFeliix
    @JamFeliix 7 місяців тому

    isnt there a manual version in unity? in blender you can just Alt+D an object and boom, instance. i could really use with a no code solution if there is one

  • @marksmithcollins
    @marksmithcollins 3 роки тому +3

    Do you have code for this video uploaded?

  • @FalloutBreakbeat
    @FalloutBreakbeat 2 роки тому

    Great little tutorial. Thanks. 👍

  • @FenyEro
    @FenyEro 2 роки тому +2

    Can you upload the script? for me: error

  • @ahmadsaerozi6688
    @ahmadsaerozi6688 2 роки тому +1

    05:50 what the full code?

    • @OPENPCreviews
      @OPENPCreviews 2 роки тому

      Yes what is it, it is cut off the screen.

  • @yqish7848
    @yqish7848 6 місяців тому

    I followed this tutorial and the entire mesh rendered as black, any ideas?

  • @armyofchickens6062
    @armyofchickens6062 Рік тому

    How could you do this for a 2d game?

  • @leonardomontes2712
    @leonardomontes2712 7 місяців тому +1

    You need to learn how to vocalize better. It was very hard understanding your pronounciation. On the other side, very nice and well edited video. Keep it up.

  • @levrisfirst3291
    @levrisfirst3291 3 роки тому +2

    How to connect colliders to this objects ?

  • @Sober-MindedYT
    @Sober-MindedYT 3 роки тому +1

    Great tutorial. But do you know how to make grass using this technique?

    • @Flaroon
      @Flaroon  3 роки тому

      You could using some tessellation technique. I'll get back to you on that one.

  • @Vundeq
    @Vundeq Рік тому +1

    good video

  • @LiquidMark
    @LiquidMark 2 роки тому

    What vs code theme is that?

    • @Flaroon
      @Flaroon  2 роки тому

      It's not a theme but rather I edited it so that I could make it a little prettier. Looking back it was kinda useless and maybe even a detrement to the video but too late now. So overall not a theme just a editing effect

    • @LiquidMark
      @LiquidMark 2 роки тому

      @@Flaroon It should be a theme, looks clean asf.

  • @KVergot
    @KVergot 2 роки тому

    The content is good, but you need to enunciate more clearly. Around 2:10 to 2:15, I have no idea what you are saying.

  • @noirlavender6409
    @noirlavender6409 11 місяців тому +1

    Cocks, this video is fantastic

  • @nikoart1561
    @nikoart1561 2 роки тому +5

    That's a bullshit video.
    First of all this video is incomplete and not showing quite anything here.
    The second thing is that I tested both solutions with GPU instancing and this method.
    With this method i gained only 5+ fps more... with GPU instancing that provided from unity i gained more than 40+ fps.
    This lines of codes is already included in the GPU instancing but even more better because you don't need to manually assign everything.