Diffuse Shading - Vulkan Game Engine Tutorial 18

Поділитися
Вставка
  • Опубліковано 25 вер 2024

КОМЕНТАРІ • 63

  • @kallehalvarsson5808
    @kallehalvarsson5808 3 роки тому +52

    Regarding 07:45: GPUs are built specifically to deal with 4x4 matrices and use 256 bit wide SIMD registers, so there's no difference in calculation time between a 4x4 and a 3x3 matrix. In fact, when multiplying a 3x3 matrix, the GPU will probably just pad the data with extra zeros to make it fit into the register.

    • @BrendanGalea
      @BrendanGalea  3 роки тому +14

      Oh that’s good to know! Thanks. Would you be alright with me pinning this comment?

    • @kallehalvarsson5808
      @kallehalvarsson5808 3 роки тому +9

      @@BrendanGalea Yeah, sure! No problem!

  • @VictorGordan
    @VictorGordan 3 роки тому +16

    "First let's fix a mistake from last week" I can relate to that on a spiritual level lmao

  • @Gmitbotw
    @Gmitbotw 3 роки тому +13

    This is by far the best tutorial i've seen! Explainations are very clear and easy to follow. I'm still early in the tutorial but I hope you continue these tutorials! Looking forward to the next one!

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

    only channel i've hit the notification bell for

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

      😄 thanks, very much appreciated!

  • @Sunita-fm5hd
    @Sunita-fm5hd 3 роки тому +10

    Hello Brendan Galea, thank for these amazing tutorials! Could you please make a tutorial on what render passes are? I am so confused about them. I can't understand the difference between swapchain, swapchain images, framebuffers, render targets and Image views, they all seem the same to me!I can't visualize the flow of Vulkan components

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

      I have the same problem too

    • @BrendanGalea
      @BrendanGalea  3 роки тому +7

      Great suggestion! We should be getting to this topic fairly soon. I plan to go through all of this in detail when we get to multiple render passes and building our own framebuffers.
      I may also create a video just going through the swap chain code and these topics before that.

    • @Sunita-fm5hd
      @Sunita-fm5hd 3 роки тому

      @@BrendanGalea Thank You

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

    Thank you Brendan for all these amazing Vulkan videos. You rock!

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

      Thank you. It’s great to know that they’re appreciated

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

    I'm watching video #5 on this series, just want to let you know that this series is great, i really appreciate it and please keep up the good work.

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

    Wow. I was literally waiting for this and i check youtube and its out. Thanks!

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

    this is amazing please continue with these game engine videos even if you have to do patron. I'm definitely subbing.

  • @Legend286UK
    @Legend286UK 3 роки тому +5

    Please do keep making tutorials, because eventually you could do PBR and deferred rendering :) would be nice to learn how to do more complex things

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

      Next one should be out sometime next week! Sorry for the delay, been dealing with some life stuff. Everything’s all good though!

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

    Great tutorials! Could we put normals into an instanced array to avoid duplicating vertices for the "flat" shading?

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

      Not exactly, but there are other methods that can help reduce duplicate vertices! Vulkan has something called the "provoking vertex", which uses one of the vertex normals as the normal for the entire face for flat shading.
      Also by using a different topology specification when creating the pipeline, such as triangle strip, or triangle fans can further reduce vertex duplication.
      However both these methods require some further processing on the model data to make sure its properly structured.

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

    Couldn't apply directional light to models with textures. Why did that happen?
    Edit:
    Solved.
    Inside fragment shader file in main function,
    Instead of doing:
    outColor = texture(texSampler, fragTexCoords) * vec4(fragColor, 1.0);
    I was doing:
    outColor = texture(texSampler, fragTexCoords);

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

    @10:56 ahh the complete void of space... that suits me just fine :)

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

    I am having a weird issue where the dark sides remain dark even while rotating around the z-axis. I can't seem to point out the part where I went wrong. If anybody had a similar issue, help me out please. It remains the same even with a cube. It is as if the color is directly baked into the mesh and doesnt change.

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

      Hmmm one guess is maybe the vases are being drawn inside out? In the pipeline implementation default pipeline config info check your clip settings. I don’t remember off the top of my head what they’re called but make sure your front face is set to counter clockwise and your cull mode is either none or back face

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

      Or it could be that your not transforming your normals in the vertex shader.

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

      @@BrendanGalea I have even tried copying your shaders from the repo but as it was before the dark side remains dark until when I rotate it on the y -axis , it suddenly shifts from black to white unnaturally. Another thing I noticed was that on the light side of the vase, their was no variation is brightness due to the topology. I have also checked my pipeline as per your comment and it seems to be fine.

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

      @@BrendanGalea my comment would be probably left unnoticed, but for some reason I, as well as nyx1284, get the parts of the vase (and other objects) darker than in your example in the vid. I've tried to experiment with different settings, but was only able to achieve the same look by changing the amount of ambient light, significantly increasing (so, in the vertex shader, `const float AMBIENT = 0.12` instead of 0.02). At `AMBIENT = 0.1` the dark part of the vase become the same color as the background, and with the lower values it appears too dark

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

    I can't wait for the shadows tutorial

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

      Ya maybe by the end of the year! 🤞

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

    How come you went for a vertex shader based lighting algorithm as opposed to a fragment shader based one? 🤔

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

      Just for time constraints mostly. I wanted to show both options but couldn’t fit it in this video. When we cover specular lighting we will also switch to per fragment lighting

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

      @@BrendanGalea Oh ok, I thought there was a deeper reason

  • @user-dh8oi2mk4f
    @user-dh8oi2mk4f 3 роки тому +2

    Shouldn’t the lighting calculations be done in the fragment shader, with the normal passed from the vertex shader to the fragment shader?

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

      Yep that’s another option that I’ll cover in the specular lighting tutorial. Just didn’t have enough time to cover everything in this one video

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

    is it possible to add models with animation using fbx or something

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

      haven't gotten to animations yet in the series, but it a planned topic for me to cover in the future!

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

    yoo new episode

  • @xr.spedtech
    @xr.spedtech 3 роки тому +4

    Sup fam, half of a graphic programer's work is using mathematics to solve some problems ...
    Thank for the normal calculation stuff ...
    But I can't use this as muh PC took a hit..
    I am coding a CAD prototype ... On a cheap android ....
    I wanna try mapping real world measurements in lengths in 3D space
    But I don't understand how much floats would make a metre in 3D space
    I don't have understand rasterizer renders while using the 2D pixels ....
    And there's math UA-camrs that I following up on coding something 4D .....
    The bastard busted down before I got the chance to test it ....
    Any Opinions ?

    • @xr.spedtech
      @xr.spedtech 3 роки тому

      I got it done for 2D ...
      Doing 3D is a bit doubtful

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

      For floats to meters you could just do a 1 to 1 mapping.
      Going to be hard to develop with just an android device though especially if it’s an older device.
      The earlier videos in the series go through how 3D rasterization works.

    • @xr.spedtech
      @xr.spedtech 3 роки тому

      @@BrendanGalea One To One mapping ?

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

      Like a float v = 3.5 would be 3.5 meters

    • @xr.spedtech
      @xr.spedtech 3 роки тому +1

      @@BrendanGalea Tis a good thing to seek help from another

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

    I love these videos. Thanks :)

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

    Please, make video about StreamLine Rendering (dynamic render passes)

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

      Ya this is something I’ll definitely need to look into more and will cover in the series when appropriate.
      I kind of wish this was released when I started the series, as I think I would’ve just walked through the swap chain code in that case right away since not having renderpasses or framebuffer setup would make things a lot simpler!!
      One thing I still need to look into is device support, hopefully most graphics devices are compatible with this extension. I would suspect this feature would be pretty widely supported, but if for some reason it isn’t yet I might hold off on covering it for a bit.

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

      @@BrendanGalea How I now this was released

  • @xr.spedtech
    @xr.spedtech 3 роки тому +4

    Yes laawdddd ...
    XD

  • @ИльдарБулатов-т4х
    @ИльдарБулатов-т4х 3 роки тому +1

    could you provide an article on this topic?

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

      Ya I have a bunch listed in the resources section of the readme on the GitHub github.com/blurrypiano/littleVulkanEngine/tree/master/littleVulkanEngine/tutorial18/README.md

    • @ИльдарБулатов-т4х
      @ИльдарБулатов-т4х 3 роки тому +1

      @@BrendanGalea thank you for the link)

    • @ИльдарБулатов-т4х
      @ИльдарБулатов-т4х 3 роки тому +1

      @@BrendanGalea will anything be said about computing pipelines?

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

      Ya I do plan to cover them at some point. But there’s quite a bit of other material I’d like to cover first

    • @ИльдарБулатов-т4х
      @ИльдарБулатов-т4х 3 роки тому +1

      @@BrendanGalea this is good news, I'm happy) how long have you been working with vulkan api?

  • @lunchdotbox
    @lunchdotbox 9 місяців тому

    why dont you cover textures yet?

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

    I subscribed.

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

    Hı is this engine one Man made ?

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

      yup!

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

      @@BrendanGalea so are there any APIs and resources you use?

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

      @@-Engineering01- - yup plenty! The early tutorials are mostly based off of vulkan-tutorial.com and the official vulkan documentation. Later tutorials branch out to use a wider variety of resources.
      Resources can be found for each tutorial in the README file on github
      github.com/blurrypiano/littleVulkanEngine