How Sprite Sheets/Texture Atlases Work // Game Engine series

Поділитися
Вставка
  • Опубліковано 4 тра 2020
  • Patreon ► / thecherno
    Instagram ► / thecherno
    Twitter ► / thecherno
    Discord ► thecherno.com/discord
    Assets used ► kenney.nl/assets/rpg-base
    Series Playlist ► thecherno.com/engine

КОМЕНТАРІ • 102

  • @TheCherno
    @TheCherno  4 роки тому +31

    What’s your game idea??

    • @AgentM124
      @AgentM124 4 роки тому +19

      Legend of Cherno: New Horizons
      You're little Cherno with a sword trying to kill monsters. But when you come back to the village, there's animals that you need to talk to and flowers you have to water.
      Gives you room to animate textures, entities with AI/pathfinding, items, inventories, combat, scene transitions, lighting, all of that game good stuffs.

    • @nootnoot1249
      @nootnoot1249 4 роки тому +3

      idk but plz add mages!

    • @matte5447
      @matte5447 4 роки тому +7

      @@AgentM124 Don't forget that he has to make barista level coffee as well

    • @quaintbear
      @quaintbear 4 роки тому

      What about double dragon 2? It would be cool to see that game with better textures.

    • @AgentM124
      @AgentM124 4 роки тому

      @@matte5447 absolutely!

  • @cankarkadev9281
    @cankarkadev9281 4 роки тому +8

    wow! I really love where the series is heading to! :D

  • @Alecor_studio
    @Alecor_studio 4 роки тому

    Intresting series, time just flew by while watching

  • @seanmccain1450
    @seanmccain1450 4 роки тому +1

    I’ve already implemented this in my engine but I love the vid!!!

  • @kinsondigital
    @kinsondigital 4 роки тому

    I myself am not too far away from dealing with sprite sheets for my engine. I plan on creating a texture sprite sheet tool for creating and packing texture sprite sheets. I am building a particle creation tool currently that is for the most part done and it will auto deploy particle setups into an engine's content pipeline and I will do the same thing with the texture atlas tool. :D Excited!!

  • @Fractal80Y
    @Fractal80Y 4 роки тому

    bit of CLA-76 on the master definatley adds some clarity!

  • @mayushkumar1623
    @mayushkumar1623 4 роки тому +4

    The Art Series would be great!!!!

  • @conman698
    @conman698 4 роки тому +12

    You should make a Working at EA Simulator.

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

    The compiler isn't required to setup constexpr at compile time.
    17:47 for example, you would want everything here to be static.
    It's nothing major it'll probably be optimized away anyway, all depends

  • @empurrormeow2015
    @empurrormeow2015 4 роки тому +6

    Texture atlas api... would love to see a mini series (like batch rendering) on sparse textures and/or multidraw indirect. Probably overkill though :D

  • @mirvids5036
    @mirvids5036 4 роки тому

    Very interesting.
    Assuming several maps and multiple image sheets, will you load each image sheet image into memory and call that or read directly off the sheet as required ?
    As for a game, how about moving around the scene, entering rooms looking the "Cherno" chalice ? ( Rotating image of your Cherno icon.)

  • @user-nb1vx6rb4n
    @user-nb1vx6rb4n 4 роки тому +1

    Great! More video like this!

  • @oblivionronin
    @oblivionronin 4 роки тому

    Awesome video, cant wait to see the updates on this ! I was wondering (im thinking 2d here) where you change the characters appearance through item or otherwise, I was wondering if it is possible to generate a new atlas (sprite sheet) for all of the characters animation on the fly when you change an item.
    It woudl look something like this...
    -- You have multiple sprite sheets with all the character parts ( head, eye, body, legs, armors items etc.)
    1. At startup, read the character's equipement, body settings, anchor points for items etc etc.
    2. generate a sprite sheet by assembling all theses specific sprite sheets into an atlas (sprite sheet) ( maybe even using color swap shaders for more flexbility)
    3. use this atlas as one texture on every frame with text coord defined for specific animations (ex idle({x=0,y=0 }{x=0,y=8})
    4. if the character changes an item. (Regenerate the atlas/sprite sheet) (perhaps we coudl have intermediate sprite sheet for faster generation, like 1 for body itself, 1 for items)
    does that sound viable at all ?

  • @Aluminum0013
    @Aluminum0013 4 роки тому +23

    I shouldn’t be watching this. I’m still on the “Let’s make something in Hazel” episode. I just love this series too much not to watch the videos right when they come out.

    • @seanmccain1450
      @seanmccain1450 4 роки тому +4

      Aluminum same goes for me. I haven’t been keeping up to date and I don’t code along with him; I just like to hear out his concepts and then implement them my self on a less platform independent way. I wrote a sprite sheet system for my engine a week or so ago.

  • @KennyTutorials
    @KennyTutorials 4 роки тому +4

    This is Kenney made for Kenny) Of course it's a joke) I just saw it first and thought it was my nick.

  • @dnlpucci
    @dnlpucci 4 роки тому

    That's really good! Can you talk about compression techniques for the texture atlas? I suppose that there is a way to do it to use as little as possible

  • @HalValla01
    @HalValla01 4 роки тому +1

    What DAW is that in the beginning? Studio One?

  • @dikyyakin3395
    @dikyyakin3395 4 роки тому

    thank you for the video

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

    Ooooo, make Contra! For this project it's perfect!

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

    I'm using a similar technique (sprite/texture atlas) in my current project, though I'm pre-defining the coordinates upfront rather than doing the calculation at runtime.

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

    Does any one know why in 18:54 is needed reorder to get sprite transparent ? The depth(z coords) are not enough to see paricles through transparency

  • @mateuszabramek7015
    @mateuszabramek7015 4 роки тому

    Any plans on making c++20 modules, or too soon for that?

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

    thanks!

  • @novacaine_.5108
    @novacaine_.5108 4 роки тому

    damn i better step up my C++ skills XD. nice work

  •  4 роки тому

    Very nice! I use pugixml myself to traverse spritesheets.

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

    Yo, out of curiosity, I was wondering what would happen if you actually hard-coded the pixel info of the sprite sheets into a header file and compiled it into the engine? Would it be even faster, since the engine doesn't have to read the whole thing from a file or from memory every time it wants to use a chunk of it? If so, what are the down sides? Why isn't it done?

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

    I have a question ,does making sprite sheet animation get copyright strikes?

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

    When you mentioned making a new game I went ahead and made a new project in the solution.
    I've made some adjustments to my Premake file and don't recall just how different it is from the repository version, but I just managed to copy-paste the Sandbox premake and rename it to the new project's name.
    Copy-paste the SandboxApp and renamed it to AppEntryPoint to make it easier to follow, then copied the Sandbox2D header and cpp and renamed them to Game.
    A few renames here and there but otherwise it looks like the way the solution is set up should make it relatively easy to make new projects with. Only downside right now is the ParticleSystem at this point is in the Sandbox not the Engine.
    My game idea is a simple top-down RPG given Kenney's assets mostly suit that. For the moment it will just be a small town or something to walk around in. Should give me a chance to make some very basic systems for things like opening/shutting doors or interacting with NPCs.

  • @elab_DIY
    @elab_DIY 8 місяців тому

    perfect :)

  • @AimlessGreyCat
    @AimlessGreyCat 4 роки тому

    Latest video so I’ll ask here. How much math do I need to know before diving into opengl and the game engine.
    My math knowledge outside vector math is basically nada.

  • @TheDeathMongrel
    @TheDeathMongrel 4 роки тому +9

    OK here's an idea. Fire in the Forest. You're the arsonist. Set fire to trees in the level. Face off against fire jumpers, then police. Weather helpers/hazards: Wind (helps), Rain (doesn't). OK admittedly not PC and maybe touchy to some given recent events. Could turn it around too though. Gotta put out fires in the forest, save people trapped, catch arsonist. Heck with those two goals you could even do multiplayer. Kind of like CStrike--but with FIRE.

    • @wraithlordkoto
      @wraithlordkoto 4 роки тому

      I like this idea very much

    • @otacon1024
      @otacon1024 4 роки тому

      I for one always felt there was a disturbing lack of arson-oriented games.

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

    It seems that I'm having a blending issue with the particles because they are being drawn before the other images and they have a lover depth so they are not being drawn. But it seems that you are not having that blending problem

  • @gabrieldinse7891
    @gabrieldinse7891 4 роки тому

    Can you guys recomend some resource explaining about game scripting (lua, python, etc), because i cant undertand it very well (why and how to use something like this on my game engine? )

    • @user-hp3kp6oh2m
      @user-hp3kp6oh2m 4 роки тому

      Gabriel Dinse You can integrate python in c++, so you feed a string of python code to it. I think its like integrating the glslang compiler in c++.

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

    I know this is a bit of an old video, but... Why didn't you turn on the grid in Photoshop? You could have configured it in Preferences and then it would be easier to find the position and size of each texture tile.

  • @monomere
    @monomere 4 роки тому

    noice :D

  • @dionyzus2909
    @dionyzus2909 3 роки тому +1

    I wish you could made a video about making texture atlases with glSubImage2d, I am having a hard time trying to index freetype glyphs into the same texture...

  • @fandusss8559
    @fandusss8559 4 роки тому

    That CLA76

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

    We're getting a Vulkan GPU for our next product at my embedded graphics job, so I could really use a Vulkan series right about now, haha

  • @billowen3285
    @billowen3285 4 роки тому

    Why do you want to not use c++ I don't get it

    • @KayVerbruggen
      @KayVerbruggen 4 роки тому +1

      Bill Owen Because scripting should be as easy as possible, the performance in a simple script is not gonna matter. So using a language like Lua makes it a lot more user friendly. It’s also not going to be for the engine itself if that’s what you’re thinking about, the scripts are only going to handle the code for the game.

    • @billowen3285
      @billowen3285 4 роки тому

      Kay Verbruggen ty

  • @CountJeffula
    @CountJeffula 4 роки тому +1

    I don’t judge. He likes the orange bush. How he rolls.

  • @greenb1ade
    @greenb1ade 4 роки тому

    😎

  • @pcache
    @pcache 4 роки тому

    So, why are texture coordinates normalized with respect to full width/height? Is it a matter of convenience, an old design that stuck, or maybe something different?

    • @jamesmnguyen
      @jamesmnguyen 4 роки тому

      Convenience, having to account for every possible texture size, or having to change the code everytime you change the image size is annoying. Being able to say, "I only want to render the top left quarter of an image" is super easy with normalized coordinates.

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

      It's not just convenience, different mip-map levels are different sizes.

  • @VortekShow
    @VortekShow 4 роки тому

    Hey I'd really love to learn how to build a super basic raytracer

    • @0x356
      @0x356 4 роки тому

      Check out Peter Shirleys "Ray Tracing in one Weekend" e-book series

  • @kaspergable
    @kaspergable 4 роки тому

    Make a nidhog like 2d side scroller. But instead of using sword, use salamis.

  • @AlienFreak69
    @AlienFreak69 4 роки тому

    Make a level builder.

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

    He said without touching visual studio so il just use a different text editor like atom

  • @zachgeyer8090
    @zachgeyer8090 4 роки тому

    A Zelda like game about herding cats

  • @beProsto
    @beProsto 4 роки тому +1

    "lua" - oh no

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

    pre-rendered models with pre-rendered depth buffers, virtua cop arcade shooter

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

      high detail pre-renders, view point dependent transform for the pre-render

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

      3d I mean

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

      2d-3d

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

      just the z-buffers with color

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

      why cant you just once write the "for each texture" function, resource for tile logic

  • @mihalic1989
    @mihalic1989 4 роки тому

    Maybe the next series should be called - Writing new FIFA game engine

  • @matthewpeterson5159
    @matthewpeterson5159 4 роки тому +1

    anyone else having issues w/ bleeding when using texture atlases? can't figure out what the issue is; i literally copied texture atlas code from a prior project which i know worked... on different hardware .........
    i've tried literally everything lol, can't fix it. and i can't easily switch to array textures .. so.. i mean.. mehhahdshhaehreaujrjr

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

      you managed to fix this?

  • @sonarcreep3691
    @sonarcreep3691 4 роки тому

    Cubase?...lol