Realtime 2D Gravity Simulation
12:31
2 жыл бұрын
Пікірлер
@bdenix1997
@bdenix1997 10 сағат бұрын
instead of compiling every shader as a build step, how about like lets say try to figure out if its modified, then if it is, compile it? can we do something like save every shader file's last modify date and then compare them, if its newer then it means its modified. then we only compile those?
@jonwebb5395
@jonwebb5395 11 сағат бұрын
This is a great tutorial. However, one question I have is on the lve_device files. This file was not create in the last tutorial and it is not discussed in this tutorial, nor are we asked to download it. Obviously we need it to make this example work, so I downloaded it from the github repository. Is the creation of this file discussed in another tutorial?
@ooffoo5130
@ooffoo5130 Күн бұрын
Hey I might have missed it but is there a particular reason that we want to represent every operation as a linear transformation? Is it just so that we can evaluate the composition of all the transformations into a single matrix?
@MK-zj8sc
@MK-zj8sc 2 күн бұрын
I keep getting this error on arch linux: libdecor-gtk-WARNING: Failed to initialize GTK Failed to load plugin 'libdecor-gtk.so': failed to init
@atibyte
@atibyte 2 күн бұрын
Nice explanation, thank you.
@kakalisaha9428
@kakalisaha9428 3 күн бұрын
The vkCreatePipelineLayout throws an segmentation fault
@BrendanGalea
@BrendanGalea 3 күн бұрын
If your on windows check the pinned comment. I think I had a fix mentioned there that i go over in part 2 sorry!
@HolloMatlala1
@HolloMatlala1 5 күн бұрын
The 3 body problem will be solved in 3D VR Maths #Metaverse
@MusikArsenal
@MusikArsenal 9 күн бұрын
Darn.. this series never progressed far enough to teach textures 😅
@burakcanik01
@burakcanik01 11 күн бұрын
This, along with Cem Yuksel's 3D Transformation video really explains the subject well. I've reviewed this subject multiple times throughout the years but I gotta say, this 2-step approach (perspective projection = perspective transformation + orthographic projection) is IMHO the most intuitive and easy to remember way of teaching/studying this subject. Most books/resources tend to focus on deriving the perspective projection matrix from the ground up, often times skipping the inherent connection to orthographic projection. Thank you for a job well done. Cheers!
@chimpfwee
@chimpfwee 12 күн бұрын
It made an actual spiral, this is really cool
@Kavci034
@Kavci034 22 күн бұрын
4:32 because you changed the path, cmake doesnt recognize the source files before regeneration, and reopening vscode automatically generates cmake files. You can just regenerate from command palette
@RocketCityGardener
@RocketCityGardener 22 күн бұрын
I'm using Visual Studio 2019 and I can't figure out how to add a custom build step. Anyone have any luck with that?
@RocketCityGardener
@RocketCityGardener 22 күн бұрын
I managed to get it working by adding the following to VulkanTest.vcxproj in the section <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> It's doesn't look for all *.frag and *.vert files currently. Just the specific ones. I'd appreciate any help on making it generic like in the tutorial make file. <CustomBuildStep> <Command>C:\VulkanSDK\1.3.280.0\Bin\glslc.exe $(ProjectDir)simple_shader.vert -o $(ProjectDir)simple_shader.vert.spv</Command> <Outputs>$(ProjectDir)simple_shader.vert.spv</Outputs> <Inputs>$(ProjectDir)simple_shader.vert</Inputs> </CustomBuildStep> <CustomBuildStep> <Command>C:\VulkanSDK\1.3.280.0\Bin\glslc.exe $(ProjectDir)simple_shader.frag -o $(ProjectDir)simple_shader.frag.spv</Command> <Outputs>$(ProjectDir)simple_shader.frag.spv</Outputs> <Inputs>$(ProjectDir)simple_shader.frag</Inputs> </CustomBuildStep>
@RocketCityGardener
@RocketCityGardener 13 күн бұрын
I found a way that works for each file you add. It doesn't check for every frag or vert file and then loop however. Select the file in the Solution Explorer. Click the wrench icon in the lower Properties window to open Property Pages. Under Item Type select Custom Build Tool and Hit OK Open Property Pages again There will now be a Custom Build Tool tree, select that. Set Command Line to: C:\VulkanSDK\1.3.280.0\Bin\glslc.exe $(ProjectDir)%(Identity) -o $(ProjectDir)\%(Identity).spv Set Outputs to: $(ProjectDir)\%(Identity).spv And set Link Objects to No (Not sure what this does?) Repeat for both FRAG and VERT files.
@wisdomokafor9631
@wisdomokafor9631 22 күн бұрын
I have tried to implement the projection and view matrix in my vulkan application but my screen still blank even after using this method.
@eatDAmeats416
@eatDAmeats416 24 күн бұрын
hey was there ever a "device setup" video made about the classes you created?
@dusha3030
@dusha3030 24 күн бұрын
3 years after, this is still a Masterpiece, following the tuts rn. I can already tell you play a small part in changing my life. And for that, I want to thank you.
@tomfoolery5680
@tomfoolery5680 Ай бұрын
The 3 billion body problem.
@moonyl5341
@moonyl5341 Ай бұрын
if i stretch the window to be 0 pixels tall then it stops accepting input
@karelknightmare6712
@karelknightmare6712 Ай бұрын
So in the end the frustum matrix is simplified to a ‘pyramid’ matrix so that angles from the center are displayed with respect to their tangential value. Right? 😅
@moonyl5341
@moonyl5341 Ай бұрын
great tutorial but how come its B8G8R8A8 not R8G8B8A8?
@GrimReaperNegi
@GrimReaperNegi Ай бұрын
Imagine if you could do this with games like Sims 3 or Sims 4!!!
@coolmanthecool603
@coolmanthecool603 Ай бұрын
Tutorial 1 had 150k views, this, the second to last tutorial only has (almost) 10k views, only 7% of people actually finish (I didn't do last tutorial, because people probably skipped ahead and just watched to see what they were making, as its got a lot more views than this.
@justinhardee82
@justinhardee82 Ай бұрын
you... are.. the shit bro, str8 up. This is simply amazing, ty for making these videos. You should follow it up with a part two of an engine creation but instead of vulkan using glfw for 3d graphics in a window, you should do it for OpenXR technologies, focusing on either PCVR or better, the Android / C++ native implementation of OpenXR for the meta quest 3. I am learning a lot from you, as opposed to the numerous books I could not quite grasp fully until I found your videos.. not even in the university I attend have I learned as much as I have in the past 20 summin videos of yours I binged in 4 days.. so far thanks
@oleksandrhrazhdan242
@oleksandrhrazhdan242 Ай бұрын
Could ChatGTP help you to continue with Vulkan tutotials?
@TaskForge
@TaskForge Ай бұрын
How to make the makefile? What’s .env?
@pedro_soares_bhz
@pedro_soares_bhz Ай бұрын
Wow, these drawings are so cool, they have a 2000's vibe. Nice.
@Natural__Facts
@Natural__Facts Ай бұрын
I’m working on my NEA project but I am super confused, can I get any contact details to ask for help? Or can you suggest any tutorials that could help me understand this?
@user-de5hy7ze1y
@user-de5hy7ze1y Ай бұрын
where have discord ink
@yynill
@yynill Ай бұрын
in what coding language?
@coolmanthecool603
@coolmanthecool603 Ай бұрын
The way you say homogeneous is strange, I know its the proper way, but its not fluid, hum odge unis
@DoctorOfMinecraft
@DoctorOfMinecraft Ай бұрын
how does the non linear z buffering effects the light calculations? or are they too small to care about?
@BrendanGalea
@BrendanGalea Ай бұрын
When doing light calculations you want to use the world space x,y,z values so the non linear z value (screen space) in the depth buffer does not play a role in the calculation. The z depth buffering value is only really used for determining which fragment is closest so only the ordering matters. However for some more advanced techniques such as screen space ambient occulsion or when using shadow maps the non linear z buffering does start to matter and is something that should be kept in mind. It’s a bit beyond the scope of a KZfaq comment to be able to go into. But any good tutorial that depends on depth dependent information should cover how it is relevant in the context of the tutorials topic.
@StevenMartinGuitar
@StevenMartinGuitar Ай бұрын
If anyone is wondering "Why is he doing most of the legwork for us - HOW WILL I EVER LEARN MYSELF?!!!!" .... Let me tell you ... I had that same thought. So I stopped watching this series and put it to one side. I then proceeded to go through the Vulkan-Tutorial chapter by chapter, reading everything and typing it all out...line....by....line. It was a freaking painful SLOG. 1000+ lines of code later, most of which I barely understood what I was copying out (and I'm an experienced C++ programmer just new to graphics) and you've JUST ABOUT rendered a simple triangle on the screen. It's a real motivation killer and I think that is EXACTLY what Brendan's example code aims to solve. Tuck away the excruciating detail in a few classes and let the learner understand the core concepts rather getting bogged down in why the VkImageViewCreateInfo::subresourceRange.baseMipLevel must be '0' in this particular example. I'm still working through some of the final chapters / more advanced topics, and I have a 'better' understanding on things but the reason I've now gone back to re-watch/continue this video series is to actually learn what the heck I was just typing for many hours :D
@devilbager
@devilbager Ай бұрын
The problem with this tutorial is that this is a Vulkan tutorial. Although this series is most likely completed, I wanted to point out that what makes copying code so bad is that it's defeating the entire purpose of Vulkan, by copying code which is integral to Vulkan and what actually makes Vulkan it's own. The main goal of Vulkan is not to render a cube, this could be done with OpenGL or any other API, but what makes Vulkan different from an OpenGL tutorial is it's verbose low level design like setting up a logical device, etc. You can't learn a language like Spanish by using google translate. Of course this is just my opinion but again the viewers should not be dependent on downloaded code that they don't understand as beginners, which should have been the main talking points of this tutorial. Anyways that's my only issue with it, I do really like the quality of this series and how beginner friendly it is (excluding the copying).
@BrendanGalea
@BrendanGalea Ай бұрын
Thanks for the honest critical feedback. I agree with what you’re saying. However if I was to do this again I would do it in the same way. I want to build up more of the surrounding context around renderpasses, framebuffers, etc where the tutorials covering each of these topics can really go into the proper depth, before going back and then going over the swap chain and device code. When I was first writing the tutorials for the device and swap chain code it was just information overload so I scrapped them and went the other direction. So hopefully in about 4ish months when I have a chance to start making videos again there will be just a few more topics covered before we finally go back to rewrite the swap chain and device code
@alexfrozen
@alexfrozen Ай бұрын
What is advantage of uniform buffers over storage buffer? If it has so big limitation in size, which big loose over storages, there should be something bad side of storage buffer over uniforms. What's that?
@BrendanGalea
@BrendanGalea Ай бұрын
Not positive and haven’t benchmarked it myself but I believe it comes down mostly to performance. The hard thing is it’s definitely device dependent what it actually going on behind the scenes. Uniform buffers are read only in shader code and also have a more limited size. Also it’s typically recommended to avoid frequently updating uniform buffer data. Because of this it’s feasible that some gpu devices may be using a different type of memory with faster read performance to optimize speed for reading uniform data in shaders. Sorry for the lackluster answer. I guess a good rule of thumb is that if you’re not targeting any specific device then use uniform buffers when you require only read only access in shaders and when the size limitations aren’t an issue. If targeting a specific device and performance is critical, best to do benchmarking to determine the differences.
@aeliusdawn
@aeliusdawn Ай бұрын
4:00 "Since we've not using Vulkan" I assume you meant to say OpenGL?
@BrendanGalea
@BrendanGalea Ай бұрын
Yup! Lol
@Chevifier
@Chevifier Ай бұрын
Wooot!! Red triangle!! I gotta call home for this. Hey Mom! check this out😅
@randospawn7495
@randospawn7495 Ай бұрын
Making a vulkan game engine by myself just wanted to see how to link it lol
@Raymond13557
@Raymond13557 Ай бұрын
I'd like to use something like this for my game, you have to find a ring in a haunted house but the townsfolk are terrified of the ghosts. the ghost is not all that scary but he IS mean however, so you could defeat it by using a magic stone. Once you defeat the ghost another quest could show up to defeat a demon that is in a building
@salieridr9730
@salieridr9730 Ай бұрын
I love your tutorials! I am following the official Vulakn Tutorials but I think it is hard for me to understand how it works. Your explanation is very clear!
@Fireblazer777
@Fireblazer777 2 ай бұрын
Great explanation!
@mrshodz
@mrshodz 2 ай бұрын
Your videos are some of the best on 3D programming!
@user-fl1dc9ju3g
@user-fl1dc9ju3g 2 ай бұрын
Bruh made a whole universe
@Aurora12488
@Aurora12488 2 ай бұрын
This is almost the perfect derivation of perspective projection (especially since it includes both the off-axis and FOV versions!). However, I wish you would have talked more about why applying the first perspective transform gets us into a space that allows for trivially transforming with the orthographic projection matrix. It doesn't seem intuitive to me. Firstly, I think it would have helped to emphasize that multiplying by n and dividing by z actually turns the slanted edge of the frustum into the right-angled straight edge of the desired rectangular prism because everything on that will end up landing at the exact same x value (or y, for the top, respectively). Secondly, however, we should note that what we get after multiplying with our perspective matrix is *not* a 3D rectangular prism, since its components haven't been divided by the w component (i.e. z value) yet. It's a seemingly somewhat arbitrary 4-dimensional entity, and so it's unclear from my limited linear algebra skills why doing the perspective divide and then applying the orthographic projection is equivalent to doing the orthographic projection and then the perspective divide. There seems to be a deeper "truth" to homogeneous coordinate equivalence that is more than just a notational convenience. If you had touched a little on that, this would have been the de-facto, perfect explanation.
@Aurora12488
@Aurora12488 2 ай бұрын
Hmm, trying to figure it out more, it seems like the "divide-by-w" can really just be considered to be multiplying the matrix-vector multiplication by the scalar 1/w. And if you have a scalar a and a matrix-vector multiplication M times v, M[av] = a[Mv] (as well as [aM]v). I think that's the last piece of the puzzle.
@herohiralal3255
@herohiralal3255 2 ай бұрын
Are you the same person as Joseph Anderson? The guy who makes game critique videos? You sound so similar...
@BrendanGalea
@BrendanGalea Ай бұрын
No not sure who that is!
@piotrek7633
@piotrek7633 2 ай бұрын
6:55 why isn't that possible exactly?
@Aurora12488
@Aurora12488 2 ай бұрын
Because matrices only allow for the resulting values to be linear combinations of the form Ax + By + Cz + Dw, where A,B,C, and D are just regular old numbers. In other words, matrix-vector multiplication takes a set of raw numbers, multiplies them component-wise with the vector's components, and then adds them together. There's no way to represent dividing one of the vector's components by a different one of its components. Now obviously you could make, for instance, A = 1/z before-hand and bake that into the matrix, but then *every single vertex* would need a special matrix because every vertex has a unique 3D position and thus a unique z value. So instead, we can use homogeneous coordinates to allow us to use a single matrix for all vertices of a given object, and then do the z division as a separate, final step.
@mrshodz
@mrshodz 2 ай бұрын
Brilliant video.
@atismoke
@atismoke 2 ай бұрын
This is beautiful! What happens when its in 3D though?
@BrendanGalea
@BrendanGalea 2 ай бұрын
This method probably wouldn’t work well in 3D. In 3d most of space is empty so doing a dense grid representation would be a lot slower.
@atismoke
@atismoke 2 ай бұрын
@@BrendanGalea ah, makes sense.
@maconcamp472
@maconcamp472 2 ай бұрын
This represents our world peace! Galaxy collisions!!!🐼🐾
@fernandogoncalves7297
@fernandogoncalves7297 2 ай бұрын
Bro got me good with the code to download, unfortunatelly for me, im implementing the tutorial with other names so i'll take my time translating everything. Still think that i`ll end up learnng a lot, so thanks!!! I`m really enjoying thinks so far! Edit, it was actually very fast, nice.
@10bokaj
@10bokaj 2 ай бұрын
opengl looks down the positive z-axis? it is the y-axis that are swapped?