BLENDING | Game Engine series

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

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

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

    For the final render submit code in 17:20, you need to make sure:
    1. the transparent image should be rendered after the opaque image
    2. If you follow the tutorial, then it should works. But if you add "glEnable(GL_DEPTH_TEST);" along with "glEnable(GL_BLEND);" in the init function in OpenGLRenderAPI.cpp file, then the position of the two images matter. The transparent image must be slightly in front of the opaque image to pass the depth test. Allow depth test is commonly used in 3D object rendering.

  • @trapido0230
    @trapido0230 5 лет назад +33

    Man, making this series must be a challenge to you! Cause this is mind blowing good!!

  • @TheFlynCow
    @TheFlynCow 5 лет назад +26

    It doesnt matter in this case, but binary AND can result in 0 even with two non-zero arguments.

  • @OTC-X1Spacecrafts
    @OTC-X1Spacecrafts 5 лет назад +2

    Thank you for this series Cherno! I have learned soo much as a programmer from learning to make this game engine. Code that used to confuse me, I now understand with ease! Thank you, thank you, thank you!!!

  • @UnicycleSoul
    @UnicycleSoul 5 лет назад +6

    Man as soon as I finish preparing for masters entrance exam I'm going through this series. It's so good

  • @MrUarabei
    @MrUarabei 5 лет назад +15

    Can't wait to see Cherno integrating other renderer APIs (especially DirectX) :)

    • @Vitriol-dk3xh
      @Vitriol-dk3xh 3 года назад

      u probably meant Direct3D

    • @hazzardmaddison4971
      @hazzardmaddison4971 2 года назад

      any recommended DirectX books and videos?

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

      @@hazzardmaddison4971 check out ChilliTomatoNoodle's tutorials

  • @robertaradi9994
    @robertaradi9994 5 лет назад

    Thank you for making this series Yan. What you're creating is truly something awesome and useful, and there is so much I have learnt from it.

  • @Silvan278
    @Silvan278 5 лет назад +2

    One minor thing to add is a technique called "Premultiplied Alpha" which achieves the same thing but without some artifacts you get from the standard alpha blending SRC_ALPHA and ONE_MINUS_SRC_ALPHA. This is very important for proper 3d alpha blend rendering, especially for foliage like grass. The problem is that due to mipmapping the GPU can interpolate pixels at the edge of transparent textures, which can create black fringes. You can fix this either by basically extending the texture outwards at the edge, so blending works as expected or you use the aforementioned technique premultiplied alpha. It works by using a blend mode of GL_ONE instead of SRC_ALPHA for the source color, but you have to do a preprocess step by premultipling every pixel by the corresponding alpha value. In fact the maths works out beautifully and you get the same result, without any artifacts and even slightly better performance due to one less multplication and possibly less state changes.

  • @__jan
    @__jan 5 лет назад +10

    drinking game: take a shot each time he says "cherno logo"

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

    Thanks! Really learning a lot!

  • @sam_is_people1170
    @sam_is_people1170 2 года назад

    thanks!

  • @jamesmnguyen
    @jamesmnguyen 5 лет назад +10

    6:40 If you want to use bitwise operators, wouldn't the correct operator be OR? Since there might be a case where internalFormat and dataFormat might not be 0 but their bits don't overlap so the assert triggers. (I know what the GLenum values are for formats, and this problem will never come up, but better be safe)

    • @peterSobieraj
      @peterSobieraj 5 лет назад

      I think that OR also can lead to incorrect results.
      And I think it's quite possible, if we extend API in future so API user can ask for specific format on GPU and assign it to internalFormat. Then we can and up with CPU data format RGBA, and GPU data format RGB.
      So in that case:
      internalFormat == 3
      dataFormat == 4
      3 == 0110
      4 == 1000
      0110 & 1000 == 0000
      However if we use "OR", then we run in to problem if lets say API user asks for RGB, but loading texture fail, and we end up with:
      internalFormat == 3
      dataFormat == 0
      3 | 0 == 3

    • @jamesmnguyen
      @jamesmnguyen 5 лет назад

      @@peterSobieraj That's why boolean AND is the safest, less hassle way.

    • @peterSobieraj
      @peterSobieraj 5 лет назад

      @@jamesmnguyen Yes. I agree.

    • @beaumanVienna
      @beaumanVienna 3 года назад

      @@jamesmnguyen If we're always setting both at the same time, why do you want to AND them?

    • @jamesmnguyen
      @jamesmnguyen 3 года назад +1

      @@beaumanVienna This is old but I'll answer. Logically you want to make sure internalFormat and dataFormat are never 0. The code in the video is very basic and so you either set both or never set both; However, in the future you might want special cases and end up with one variable set to 0 (See previous comments). So boolean AND will cover those future cases.
      Honestly, it doesn't matter. Don't get too caught up in this piece of code. Just understand the implications.

  • @DRAGON_FullPower
    @DRAGON_FullPower 5 лет назад +1

    I love this series!I will activate the pettreon on 1 September

  • @MarSe32m
    @MarSe32m 5 лет назад

    So GOOD! Keep it up bruder!

  • @filiperei6055
    @filiperei6055 4 года назад +6

    Unfortunately I am late to vote, but why on earth would the majority vote for 2D vs 3D?!
    We get the opportunity to have this genius break down something complex (and arguably more useful in the industry) VS something less complex - and the majority voted for the latter? :(

    • @bulletproofduck4487
      @bulletproofduck4487 4 года назад

      I am thinking about the same thing

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

      That was my thoughts, the whole point of this shouldnt be "But I want to make a 2D game" it should be "I want to learn as much as possible" and 3D would be so much better for that. If people wanted to make 2D games, then they should make 2D games, not make a 2D game engine first.

  • @GustavoPereira-kc7ov
    @GustavoPereira-kc7ov 3 года назад

    Hey cherno, what is the name of this cool song at the beggining of your videos?

  • @zuzanahroudova9028
    @zuzanahroudova9028 4 года назад

    What about blending in fragment shader?

  • @zapyray3371
    @zapyray3371 5 лет назад +1

    Is this gonna be "real engine" like Godot ?

  • @_Omni
    @_Omni 5 лет назад +2

    👍👍👍👍👍

  • @nocs13
    @nocs13 5 лет назад +1

    why there is alpha blending only?
    does alpha blend enough for flame effect?
    and where is realization for Add, Subtract, Multiply, Overlay, etc?

  • @AUdominoes
    @AUdominoes 5 лет назад

    Interesting, great work!
    I really wanna follow along but I’m confused right now as to what the current state of the engine, would be easier to follow through once it’s out completely.
    Any idea as to how long the completion of this would take Cherno? Anyone?

  • @chris_burrows
    @chris_burrows 5 лет назад +4

    I missed the poll, but I am curious... did you poll Patreons only or your entire RUclips audience? I suppose it depends on why you are doing this all in the first place but I guarantee the vast majority of the people paying for this series want 3D exclusively and you are going to lose us all.

    • @ahsanullah6326
      @ahsanullah6326 5 лет назад +8

      Entire RUclips

    • @TechByRyan
      @TechByRyan 5 лет назад +1

      It seems like everyone is missing the point that he is still doing 3D. The poll was for which one to do first.

    • @bies_moron4404
      @bies_moron4404 5 лет назад +1

      i am paying for knowledge (not for 2D/3D) :D

    • @chris_burrows
      @chris_burrows 5 лет назад

      @@bies_moron4404 You're right, there'll always be something to gain from it. I'm just cut coz my implementation has diverged so far from stock Hazel and I was desperately waiting for Cherno to rein me back in. Now I'm just gonna write myself deeper and deeper into a 4D spaghetti wonderland.

    • @peterSobieraj
      @peterSobieraj 5 лет назад +1

      I miss the voting as well, but I'm for 2D.
      At first I thought that I would prefere 3D.
      But then I reminded my self why I started watching this.
      We can learn doing 3D in OpenGL from almost any OpenGL tutorials, including on on this channel.
      But from this series I want to learn how to set up and organise everything for project as big as Game Engine ?
      How to create GUI for editor so it will be easy for game designed to work with and easy for programmer to improve ?
      How to name classes and namespaces so it will make sense ?
      And this is complicated topic by it self even without 3D. Belive me, I tried many times :)
      And 3D will be added later on any way.

  • @adityaverma6120
    @adityaverma6120 5 лет назад +1

    I don't like your new style of thumbnails.

  • @ahsanullah6326
    @ahsanullah6326 5 лет назад

    First