Batching in OpenGL

Поделиться
HTML-код
  • Опубликовано: 18 янв 2025

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

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

    Thank you for this. I really appreciate how tightly organized the video is. Starting with the instancing comparison is great, and the video's very information dense. Doesn't waste time at all.

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

    Excellent explanation. Not short like you got a bus to catch, and not long and rambling like ur haven't talked to a human in 20 years.
    This puts other creators to shame.
    Keep it up

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

    3:05 You should avoid copying a vector; pass it by reference. Heap allocation is very slow.

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

    Cool explanation, thanks. I think this might somewhat explain what "spritebatch" is in the Monogame Framework. I always wondered why they called it that.

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

    i also believe this is the best way to draw non-specialized geometry requiring simple model structure!

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

    Great stuff thank you for this is there more details somewhere?

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

      Thanks. Sorry for replying late. Here is the source code for this demo: github.com/Saurav280191/TS_ENGINE_BatchingDemo

  • @JacobElliottSermons
    @JacobElliottSermons 5 месяцев назад +1

    @ 6:01, the flicker in the back, that is because you are not using mipmaps, I believe - isn't that right?

    • @sauravsikarwar
      @sauravsikarwar  4 месяца назад

      Right. I think I had not added the mipmap code when I created this video.
      That can be easily added. A lot of other interesting things are pending (Majorly scripting engine and a few complicated architecture changes.

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

    Nice! I’ll need to implement batching

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

    Great! Would be great to have a look at the source code for your examples, thanks!

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

      Sorry about the replying so late. I somehow missed your comment. Here it is: github.com/Saurav280191/TS_ENGINE_BatchingDemo

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

    Thanks. This is very cool video. I wish you to increase amount of views, as very useful content...

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

    Nice content, keep up 👍. I am just wondering if you do the world space transformation on CPU side and transfer mesh data to GPU every frame, is it actually an ideal practice? But certainly, it is better than doing drawcall for every single object each frame. I think in vulkan the MVP can also be easily batched, but not sure about openGL.

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

      Thanks for liking the video @fangzhou4333. Transformation on CPU is not an ideal practice but in the batching case since all the meshes are combined in one we don't have any other option apart from getting the vertex transformation done on CPU side. In the example I have shown in this video all the models are repositioned once at the start only so I have used GL_STATIC_DRAW but in cases where we need to keep transforming the mesh vertices(eg: batching animated models) on runtime GL_DYNAMIC_DRAW is recommended.

  • @korigamik
    @korigamik Год назад +4

    Great video but, where can I see the source code for this?

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

      I haven't uploaded it yet. Will be uploading it on GIT soon and will share the link in description. For reference I've shown some code snippet in the video. Maybe that will help.

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

      @@sauravsikarwar that's cool. I'll be waiting for it 👍

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

      Hi @@korigamik. I've uploaded a new video. That has framework source code mentioned in the description as well. Check it out🙂

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

      @@sauravsikarwar Where? I don't see source code.?

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

      @@ItsYouAreNotYour github.com/Saurav280191/TS_ENGINE_BatchingDemo

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

    Are you rebuilding the batch mesh data each frame, or just once and reusing it?

    • @sauravsikarwar
      @sauravsikarwar  4 месяца назад

      In this example, I had batched it once.
      I tested the code separately in which it can be unbatched and rebatched again and even that works but it needs to be managed very carefully.

  • @10bokaj
    @10bokaj Год назад

    Batching this way only really works for static objects.

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

    Is this the same idea as Unity's batch processing?

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

      Yes. It is same. On the front end it differs a bit but unity also internally might be processing it in the same way based on which graphics api it is using.

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

    The best IT-related videos on RUclips are made by Indians

    • @loli42
      @loli42 2 месяца назад

      INDIA #1

  • @SnakeEngine
    @SnakeEngine 9 дней назад

    Your CPU must be out of this wolrd though processing 4 Million vertices at 170fps. Hard to believe it.