Batch Rendering Sprite Sheets | C Game + Engine From Scratch 11

Поділитися
Вставка
  • Опубліковано 12 вер 2022
  • Grab the player.png from the repo below.
    Code used in recording: github.com/Falconerd/engine-f...
    Pixel art for this series is custom made by Presley Carvalho. Check out his website here: perigic.com/
    Background pixel art for this series is Kings and Pigs by Pixel Frog. Check it out here: pixelfrog-assets.itch.io/king...
    Music for this series is from Breezy's Mega Quest by RyanAvx. Check it out here: ryanavx.itch.io/breezys-mega-...
    ➤ Website: dylanfalconer.com
    ➤ GitHub: github.com/Falconerd
    ➤ Twitch: / falconerd
    ➤ Discord: / discord

КОМЕНТАРІ • 19

  • @fabiokleis
    @fabiokleis 10 місяців тому +1

    I'm programming a 2d game without an engine and I finish a basic batch renderer, now I'm starting to implement the render of sprite sheets, your videos about these concepts in pure C helped me a lot, currently I'm using c++ but I really appreciate just doing things in C is kinda cool

  • @johnjackson9767
    @johnjackson9767 10 місяців тому +2

    I support other C game dev masochists when I find them. Subbed.

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

    fantastic video! what nerdfont are you using in vim?

    • @harrizonsoler8708
      @harrizonsoler8708 10 місяців тому

      Looks like IosevkaTerm NerdFont

    • @lysikasaito
      @lysikasaito 10 місяців тому

      @@harrizonsoler8708 i really appreciate that you told me that, but afterwards i found out and now i happily use iosevka!

  • @bricksnbuttons2000
    @bricksnbuttons2000 10 місяців тому +1

    Where did stb_image.h come from? Did I miss it back in ep1?

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

      Hi, same issue here, how did u fix it ??

    • @bricksnbuttons2000
      @bricksnbuttons2000 6 місяців тому +1

      @@MotaruASP shit I can’t remember. I have all the dependencies in a private repo if you just want to copy it from there lol

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

    So I got my code to render 1 million that are static(don’t move). But I can’t even do 100K when moving my sprites because glBufferSubData is the bottleneck. Any ideas how to speed things up?

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

      I'd have to profile it some more but I think there's a couple of suboptimal things. Draw elements can use draw triangle or fan with no EBO. Maybe sorting sprites by texture before hand will speed up by reducing texture switches. Alternatively stitch commonly used textures into one large atlas on startup and write code to index into their regions

    • @johnjackson9767
      @johnjackson9767 10 місяців тому

      Look into using indirect multidraw

  • @DoctorSoulis
    @DoctorSoulis Рік тому +6

    Wait. You can make games with C?!

    • @bonehelm
      @bonehelm Рік тому +5

      Almost all games prior to year 2000 we're made in C. At some point the game industry decided C++ should be the standard. But there's still tons of C libs out there to make games.

    • @m.hosseinmahmoodi
      @m.hosseinmahmoodi Рік тому +3

      A lot of classics are made in c (Doom, Quake, Wolfenstein 3D) and even some modern game (Retro City Rampage). And like Chris said a lot of c libraries such as SDL (used in all games from valve), GLFW and stb all written in c.
      But honestly I won't recommend using c for a large project that you'll spend more than few weeks, c++ is mush better suited for larger projects.

    • @RockTo11
      @RockTo11 Рік тому +12

      I can't think of a legitmate technical reason to use anything other than C to make games.

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

      @@RockTo11 For example, many things that can only be done with macros in C can be done in C++ without them. This frees the editor and analyzer from working with those. I use VS Code with clangd and they slow down significantly when I call a macro function multiple times.
      But I would say there is not a hard technical reason that would disable you from using C. However, that does not mean the small changes are negligable. For example, dynamic arrays are used everywhere, and in C++ you can easly use std::vector for it. When an algorithm can be improved with a dynamic array, there is friction in C to improve it. Or there would be hard limits because the coder will chose a static array for convinence.

    • @bluesillybeard
      @bluesillybeard Рік тому +2

      The entire Linux kernel is C.
      Well, most of it, there are a few bits in other languages (like Assembly)