Тёмный

Why Devs NEED TO know about Render Matrices! 

Kaze Emanuar
Подписаться 271 тыс.
Просмотров 95 тыс.
50% 1

Опубликовано:

 

25 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 664   
@microphonejunkie
@microphonejunkie 2 месяца назад
Did I just witness Super Mario Galaxy 64 ?
@Aragubas
@Aragubas 2 месяца назад
YEAH!!!! that would be a really cool de-make to make! just imagine x3
@GamingBren
@GamingBren 2 месяца назад
make this happen
@carlosbenton64
@carlosbenton64 2 месяца назад
Posible
@Moonchild1607
@Moonchild1607 2 месяца назад
Wishful thinking.. 😂
@catsanzsh
@catsanzsh 2 месяца назад
@@Moonchild1607 super mario 64 in ursina? :D
@JacktheRacoon
@JacktheRacoon 2 месяца назад
Bro’s teaching Linear Algebra to help game devs
@BoxdHound
@BoxdHound 2 месяца назад
Freal 10 years later I finally actually understand what I had just brute force memorized to pass an exam.
@shuckarooo
@shuckarooo 2 месяца назад
He literally has a degree in mathematics
@kaibaman9651
@kaibaman9651 2 месяца назад
@@shuckaroooI suck at math so I guess game dev was not meant to be for me.
@KosinsStuff
@KosinsStuff 2 месяца назад
@@kaibaman9651 That is not true. Game Engines do most of the mathematical work for you and you rarely ever need to use complex math and even if you do have to use it there are most likely people out there who are glad to help you. Not everyone is perfect everything but that does not mean you shouldnt try anyway. I personally suck at drawing and i still do it every single day, if you dont practice you wont improve. Now go and make a game :D
@insentia8424
@insentia8424 2 месяца назад
@@kaibaman9651 You don't really need much more than basic trigonometry unless you want to make your game fully from scratch
@Reirek
@Reirek 2 месяца назад
In 20 years Kaze is gonna end up porting cyberpunk to the n64 and it’s gonna run at 60fps
@mjcox242
@mjcox242 2 месяца назад
The one time the N64 being 64bit is useful, file sizes. You would kill the ram-bus streaming every texture and model though
@raypuiaascii4653
@raypuiaascii4653 2 месяца назад
​@@mjcox242Isn't the N64 theoretical cartridge size limit 1GB per bank? Pretty much it could even match a DVD with some bank switching
@JerrySM64
@JerrySM64 2 месяца назад
In 20 years, Kaze wouldn't port Cyberpunk but the awful The Last of Us PC port to the N64 as Cyberpunk would just be too easy.
@fruitsnackia2012
@fruitsnackia2012 2 месяца назад
@@raypuiaascii4653 ive heard 256mb (megabyte not megabit) but ive also heard up to 4gb im not sure which one is true. wile this is possible on emulator its currently not possible on any current flashcart cause of the limited 64mb of ram it loads a rom into. unless everdrive releases an updated cart 64mb this is the max.
@t0biascze644
@t0biascze644 2 месяца назад
@@mjcox242 nah, Kaze would still manage to make the rambus go vroom vroom
@RADkate
@RADkate 2 месяца назад
babe wake up vertex shaders for the n64 just dropped vertex animations are actually used quite a lot today for foliage wind and deformation for example, the hardest part to do full animations is baking them to work with closed meshes though, but it does get used sometimes today, rat shaders are great haha
@fnytnqsladcgqlefzcqxlzlcgj9220
@fnytnqsladcgqlefzcqxlzlcgj9220 2 месяца назад
Yeah like Minecraft leaves skewing in the 'wind', it looks great and it's so ridiculously cheap
@AccAkut1987
@AccAkut1987 2 месяца назад
Vertex animation was one of the keys to how Crash Bandicoot was created.
@TheFaiLM4N
@TheFaiLM4N 2 месяца назад
It is limited but vertex animation textures can be the solution if bandwith problem is somehow solved
@Ehal256
@Ehal256 Месяц назад
N64 has been doing t&l (vertex shaders) in software since it was released, that's literally how it always worked.
@bentomo
@bentomo 2 месяца назад
Bruh this is the video you show to new freshman CS/ECE students to get them jazzed about math.
@megamatthew75
@megamatthew75 2 месяца назад
I’d love it if Mario 64 and innovative games on old hardware could be explained as lessons honestly, I feel like it would make for a much more interesting curriculum.
@sboogbloog1004
@sboogbloog1004 2 месяца назад
Yep, I wouldn't have gone for a CS degree if not for Mario romhacks
@tenku44
@tenku44 Месяц назад
When I was learning about matrices in class I saw the phrase computer graphics during the introduction lesson and that prompted a neuron activation The rest of the topic was just doing operations between matrices in a vacuum, and occasionally some problems with 2D shapes. My disappointment was immeasurable
@kmachappy5176
@kmachappy5176 Месяц назад
@@tenku44 same here brother
@wintutorials2282
@wintutorials2282 24 дня назад
I am a CSE / DSAI student 😂
@Fezezen
@Fezezen 2 месяца назад
I took a graphics programming course in college, and a lot of the students had trouble understanding what the view matrix does. The infamous "the camera doesn't move, the whole world moves". I understood it because I knew that's just how it's done even in 2d games, but without a visualization of how it transforms the world to be "in front" of the camera many people struggle to understand what it does. But I suppose knowing you need to feed it the camera's coordinates inverse is a good enough understanding to get it to function as expected without needing to understand the math.
@fearedjames
@fearedjames 2 месяца назад
I was taught how this stuff works in my computer visions course of my Computer Science degree. Despite having zero previous knowledge of anything taught, I thought, when you took 3D rendering as actually just kinematics transformations, it all made intuitive sense. I'm rather surprised you said people had issues with that. its pretty simple Maths.
@Fezezen
@Fezezen 2 месяца назад
@@fearedjames Idk, maybe the way I remember it is just an exaggeration, but I do remember some students reactions to the lesson, and that "There is no camera" became kind of a meme, so much so that any time our professor used the word "camera" during a lecture, students would chime in and say "But I thought you said there is no camera" as a joke. I don't want to sound arrogant, but I did graduate top of my class with only 92% overall average, which isn't even that high for top of the class imo. Perhaps most of the students had trouble with the program in general? It's worth noting too that college here in Canada isn't the same thing as university, and university is usually regarded as the harder academic path, and it's the most encouraged in secondary school.
@Chiberia
@Chiberia 2 месяца назад
so... I actually specialized in 3D computer graphics engines in my computer science days (graduated in 2008, around the time when you still needed to really optimize things). literally everything (shaders, motion, projection, screen space, world space) in an engine is a matrix by nature of simply needing to transform mathematics in a 3D space. the problem isn't that some of these engines aren't using matrices (they are), it's that they've been heavily abstracted into engines that allow for more rapid development at the cost of things like "5 FPS background characters" that few people will notice or care about, certainly not at the risk of a launch delay. it's like choosing to write your program in C++ or assembly - you're going to have much finer control over your performance, but at the cost of development time. I realize I'm speaking on a channel dedicated to hyper-optimization, but that just isn't the way product development can work in the real world.
@KazeN64
@KazeN64 2 месяца назад
yeah i talk about how all engines i know use matrices too. my point is that devs underutilize them. c++ vs assembly is unfair comparison imo - assembly takes at least 4-5 times as long to develope and most hand written eassembly can't compete with compiler generated assembly. it's a lot less practical. abstracting stuff and cutting dev time is great, just not when there are such huge drawbacks to it imo
@czech_ring
@czech_ring 2 месяца назад
can't wait to hear a lecture about things i can barely comprehend
@liaml1694
@liaml1694 2 месяца назад
Barely is the fun part!
@tacokoneko
@tacokoneko 2 месяца назад
if you take a class in university called Calculus III they explain this there
@elokthewizard
@elokthewizard 2 месяца назад
@@tacokonekoi want to learn this for free :(
@whyareyoulookingatthislol
@whyareyoulookingatthislol 2 месяца назад
I learned all about this in my computer graphics class
@liaml1694
@liaml1694 2 месяца назад
@@elokthewizard Access to all knowledge should be free, it would make the world a much better place.
@MichaelPohoreski
@MichaelPohoreski 2 месяца назад
7:35 The reason the W component is special is because when: W=1 the vector represents a point W=0 the vector represents a direction (remember to normalize all vectors to be unit vectors so you don't run into transformation bugs) Edit: 1. *Note:* This ONLY applies to the NON projection matrix. 2. Anyone wanting to understand the projection matrix should read Eric Lengyel's excellent *Projection Matrix Tricks* pdf.
@SuperSmashDolls
@SuperSmashDolls 2 месяца назад
This understanding breaks down at the projection matrix. All perspective projections will mix the Z coordinate into W at some point, which gives you all sorts of values for W. This works because W is a scaling factor: the coordinates we're working with are called homogenous coordinates. To convert back to standard coordinates you have to divide out W from all other components. We work in this coordinate system because perspective is not a linear transformation and thus cannot be represented by matrices alone. Matrices can only scale by a constant, not by other coordinate values, but adding W fixes that. If you adopt the convention that W=1 for points, then you can also represent translations as a matrix. This is why you always set the W column of a transformation matrix to identity. When Kaze started playing around with the W column, he was both turning Mario into a frustum as well as rescaling any transformations on individual Mario verticies done after that matrix. (If for some reason you really wanted to transform things into frustums with your matrices, you could divide out W and reset it to 1 at specific steps to keep transformations stable, but then you can't multiply your matrices across the division.) W=0 divides by zero. If your game and renderer / GPU works in floating point, that gives signed infinities for the other components of the coordinate. If you were to change some points on a model to W=0 (and your hardware is OK with rasterizing this) you'd have a model whose polygons blend into the background.
@MichaelPohoreski
@MichaelPohoreski 2 месяца назад
@@SuperSmashDolls Excellent summary! Eric Lengyel has an fantastic *Projection Matrix Tricks* pdf that should be required reading for anyone interested in this topic. I'll edit my comment with an Caveat that this only applies to the non-projection matrix.
@SillyOrb
@SillyOrb 2 месяца назад
Another very good video. 7:31 If you want to know more, this is for you: Because 4x4 3D transformation matrices are basically just four homogeneous 3D vectors (so 4 components: x, y, z, w), the last column in this image is the w components of the row vectors. The w component is used to do two things at differnet stages of the 3D transformation pipeline: 1. On the input side it is what makes the vectors and matrices homogeneous. What does that even mean? It allows us to use the same computations on two distinct types of vectors that look the same (encoded into a 3 component 3D vector), but behave differently. On one hand you have positions that should scale, rotate and translate; on the other you have directions which should only scale and rotate. Instead of having to implement all operations twice to handle each type of vector, you can add another component to everything and select the type of vector by either enabling or disabling the translation part of the matrix. Where is that? It is the fourth row. The other three rows are each the scaled direction of the local X, Y and Z axes in that order. All four components usually combine into a orthographic (right angles between all three axes, with scaling; no scaling would be orthonormal) basis, giving us a local object space in which we can work and is called the "model matrix." Incoming vectors are basically just weights that are applied to the matrix's four vectors before they are all added up to yield a new outgoing vector. Therefore a position has its w set to 1 and a direction has it at 0. This means the former receives the translation from the fourth matrix vector, while the latter doesn't, as the matrix's vector is multiplied by 0, resulting in an offset of all 0s that doesn't change the result after addition. This is how the introduction of w changes the two distinct (heterogeneous) types of vectors into a common (homogeneous) one. View matrices are the same as model , but are constructed slightly different. Projection matrices use the same format, but mostly just apply screen space XY scaling around a focal point proportional to the computed depth of each position vector. 2. On the output side of the transformation, w contains a perspective correction factor that is used in the "perspective divide" operation to shift any interpolated attributes according to the depth gradient across the transformed surface. It fixes the texture warping that was present on early 3D game consoles like the PS1 (N64 had this built-in already, so its games did not suffer from such warping). Division is still somewhat expensive (albeit casually usable) these days and it was even more so in the early to mid 90s, thus skipping the perspective divide for each computed fragment (pixel-sized piece of a surface) was an easy way to make 3D graphics faster and chips cheaper with some trade-offs back in the day. Some classic games like System Shock 1 had several degrees of perspective correction in its settings on PC. w also has other uses, e.g. as an alternative to z for depth buffering. The output's z contains the non-linear depth, whereas w has the linear depth. Some consoles supported both types of depth buffering in hardware like the NDS. z depth has more precision close to the camera, but suffers from precision loss which shows up as flickering known as depth fighting. w depth has uniform precision and therefore less flickering, but it can suffer from precision loss close to the camera compared to z depth. The last point is rarely an issue in practice and the very far view distances without too many weird hacks are worth solving any near field precision loss.
@xReTuneSx
@xReTuneSx 2 месяца назад
Thank you for taking the time to write this
@damionlee7658
@damionlee7658 2 месяца назад
Thank you for writing this out. I wish RU-vid allowed us to bookmark comments! Screenshot to the rescue for now.
@SuperXzm
@SuperXzm 2 месяца назад
Damn... being 6 minutes late to Render Matrices! I NEED TO know about them!!!
@KazeN64
@KazeN64 2 месяца назад
if you are a dev, you better!!
@jpzarde8734
@jpzarde8734 2 месяца назад
I briefly had to deal with these in first year uni math. That was 7 years ago, maybe I oughta brush up…
@ViviBuchlaw
@ViviBuchlaw 2 месяца назад
​@@KazeN64Its true! One time I programmed a game, and one of my players came up to me at McDonald's and spat in my face (Traumatic) saying I'd never be a real game dev until I learned rendering matrices Suffice to say I've never gone back to McDonald's
@enricofischer1330
@enricofischer1330 2 месяца назад
​@@KazeN64 scaling matricies are Notting more Than vec x vec = vec. (Smal optimization)
@TimTindall
@TimTindall 2 месяца назад
@@enricofischer1330if you’re already applying transformations, having it included in your Mat4 saves the vector multiplication.
@GlitchyPSI
@GlitchyPSI 2 месяца назад
This is an excellent primer to matrices especially for beginner-intermediate gamedevs, it's super useful to know this information especially if you're working with more framework-y engines (or no "engine" at all!) where you have an insane level of control over what happens at different stages (but even if you're using a super batteries included engine it's still excellent knowledge for the future!)
@ZXLink
@ZXLink 2 месяца назад
The perspective part of the matrix could theoretically be used to achieve a Link Between Worlds effect where you render everything at an angle to give that classic "top-down" view using 3D graphics
@tbtb66
@tbtb66 2 месяца назад
I could see something like that or even Animal Crossing's "Rolling log" world
@henrycgs
@henrycgs 2 месяца назад
it's not "theoretically", it's literally what they used
@henrycgs
@henrycgs 2 месяца назад
@@tbtb66 you need more than just matrices for animal crossing because matrices only do linear transformations, whereas making a curved world is not linear
@ZXLink
@ZXLink 2 месяца назад
@@henrycgs "Theoretically" meaning you could use it to achieve the same effect in a N64 game. Not sure how useful it would be in a 3D platformer without some very clever level design... maybe if you wanted to do a Crash Bandicoot style running towards the screen level?
@adora_was_taken
@adora_was_taken 2 месяца назад
generally they call that an orthographic projection, where things don't shrink as they get further away.
@ocaiosim
@ocaiosim 2 месяца назад
I'll be taking the time to read through all the comments and feedback on the editing. I appreciate everyone who shares their thoughts and suggestions! 🙌🤗
@Minty_Meeo
@Minty_Meeo 2 месяца назад
It's already been said many times, but the sound effects for every little thing was too much. It reminds me of an over-edited RU-vid short trying to hold my attention.
@平中山-b7y
@平中山-b7y 2 месяца назад
the intro cards for topics and things were very nice, and a lot of the additional animations and things i liked. i think maybe too many sound effects though. overall i like the direction great job
@technocolossus
@technocolossus 2 месяца назад
Idk man it was fine by me. I have no idea what anyone else is betchin about
@spacebassist
@spacebassist 2 месяца назад
@@technocolossus me when other opinions exist: (ironically i've not paid much attention to the SFX, so i'm indifferent)
@QuiGonJoe
@QuiGonJoe 2 месяца назад
I think the images at 7:13 are broken
@Minty_Meeo
@Minty_Meeo 2 месяца назад
7:19 is this an editing mistake? Missing GIFs?
@KazeN64
@KazeN64 2 месяца назад
oh god yes that's an editing mistake lmao
@Minty_Meeo
@Minty_Meeo 2 месяца назад
@@KazeN64 Damn. It's reupload time.
@ayoraster2970
@ayoraster2970 2 месяца назад
the rest of the video more than makes up for it. really good editing throughout
@ThePC007
@ThePC007 2 месяца назад
The internet conditioned me into thinking this was some kind of weird joke I didn’t quite understand, so I never questioned it, lol.
@flameofthephoenix8395
@flameofthephoenix8395 2 месяца назад
@@ThePC007 I never questioned it because I don't pay any attention to the visual part of the video...
@RipVanFish09
@RipVanFish09 2 месяца назад
Time to pretend like we understand what the magic optimization man is talking about.
@Daltonisntabot
@Daltonisntabot 2 месяца назад
I actually understood it pretty well. It's essentially coordinate plane stuff,but 3D, so add a Z-Axis. Tell the model/effect how to move without adding a gif or animation and it's kuch cheaper than calling an entire animation as it's done in the code, not calling anything. Was that simple enough?
@eth-p
@eth-p 2 месяца назад
​@Daltonisntabot A different way of putting it is that it's tweaking the parameters of how 3D meshes are being projected/flattened onto 2D space. This step already has to happen as part of the rendering pipeline, which means there's no added cost to have scale/shear/rotation effects other than the cycles spent tweaking the parameters.
@nyanezt9636
@nyanezt9636 2 месяца назад
@@eth-p this explanation is very clear to me, thanks
@blarghblargh
@blarghblargh 2 месяца назад
it's high school math. keep doing math and you'll get there! unfortunately they may teach it to you in the most boring way possible. in my experience, it's much more interesting when you're using geometry and linear algebra for graphics or game physics. if you're really interested in game math and graphics, another good creator is Inigo Quilez. He's the creator of shadertoy.
@RipVanFish09
@RipVanFish09 2 месяца назад
(This one was actually pretty easily understandable, at least for me)
@vincentpol
@vincentpol 2 месяца назад
7:29 From my memory, the last column can be used for custom projection. Usually the projection is done on a near-plane that is perpendicular to the camera's view direction. Changing these values allows you to do things like Portals, where you need the projection plane to be the same plane as the wall you're looking at.
@justajad2809
@justajad2809 2 месяца назад
My lord these developers back then just didn't kid around when they had to make stuff like this. Huge props to them and to you Kaze to share that !
@GabroGames
@GabroGames 2 месяца назад
I've been out of the loop, I learned matrices as the primary means of controlling and projecting 3D objects for my degree. I'd always taken it to be THE WAY. It would be very interesting to see how the new HITMAN games 1-3 handle their NPCs. They have large crowds that still react to your actions (in a more limited way than "important" NPCs but still extensive) and, have seemingly little impact on performance, even in great numbers. Would be very curious to learn the optimisations for them.
@KazeN64
@KazeN64 2 месяца назад
it is THE WAY! it's just that game engines handle so much of that for you, that most devs i've talked to never bothered to learn how they work.
@MichaelPohoreski
@MichaelPohoreski 2 месяца назад
Likely LOD (Level of Detail) for far away objects. Less geometry & bone count = less vertex transforms. Another technique (usually used static objects) is “imposters” where you render a 3D model to a texture and show the 2D image.
@GabroGames
@GabroGames 2 месяца назад
That's why HITMAN is so interesting, LOD would be useful but you're often very close to huge crowds so they must still be very efficient regardless. I don't think they are 2D imposters either as you can physically interact with them. Reason I thought of them for this video is many of them share the same models so I'm wondering if they are perhaps clones of each other with different transforms applied for idle animations until they become "disturbed" (by you shooting them or something similar nearby). At which point it's as if they "come to life", like they've now been assigned more complex animations and AI instructions. Most stand around while only a few "decide" to start walking around. I don't know how that's done but I'd opt for an NPC selector that runs on a schedule, regularly picking from the list of super simple NPCs based on some conditions and then assign more complex behaviors to them.
@davidmcgill1000
@davidmcgill1000 2 месяца назад
The w part of the matrix is used in the final projection by doing "xyz / w". This is where the difference between orthographic and perspective projection matrices come in. Orthographic forces it to be a 1 while perspective uses z for it.
@cube2fox
@cube2fox 2 месяца назад
Cool, one could use orthographic projection e.g. to make levels with fixed isometric camera angles.
@blake_n
@blake_n 2 месяца назад
@@cube2fox The Mario N64 mod Monroe Park over on RHDC does this, achieving a sort of Monument Valley aesthetic. It's pretty wild.
@ArneChristianRosenfeldt
@ArneChristianRosenfeldt 2 месяца назад
@@cube2foxor you could just use simple 3x3 Matrix and no division at all (in the firmware).
@davidmcgill1000
@davidmcgill1000 2 месяца назад
@@ArneChristianRosenfeldt Would lose translations as those depend on the constant 1 being multiplied with the coordinates and added in.
@ArneChristianRosenfeldt
@ArneChristianRosenfeldt 2 месяца назад
@@davidmcgill1000 on GBA it is significantly cheaper to subtract the camera position before the Matrix stuff.
@ChloeVFX
@ChloeVFX 2 месяца назад
Dude the editing in this video is absolutely SUPERB, and represents what I wanna do with my own videos. Also, great explanations, I learnt a lot today !! :D And your game is actually looking VERY nice, I especially love the orangey tones of the oil rig level a LOT !! Keep up the great work, mate !!
@kupo871
@kupo871 2 месяца назад
My friend you may enjoy learning about the benefits of dual quaternion for 3D rendering.
@angeldude101
@angeldude101 2 месяца назад
Dual quaternions are pretty great. They're half the size of a 4D matrix, and depending on some specifics, they can be cheaper to compose than matrices (though the also might not be since matrix multiplication is easier to roll into a loop). Applying them to vertices is more expensive however and usually you just convert it into a matrix at that point. Also, dual quaternions can't represent shears, which can be a good thing in many contexts, though Kaze seems to be using shears intentionally here, so they wouldn't help, and can't do scaling (uniform _nor_ non-uniform), which again, _can_ be a good thing depending on the kind of style you're using, but would probably be more of a drawback here. I'd still love to see Kaze consider at least regular quaternions. (They do _not_ require wrapping your head around 4D geometry; they are merely mixtures (aka weighted sums, aka linear combinations) of 4 basis 3D rotations: 3 180° rotations around the original axes, and a 0° rotation around... everything and nothing.)
@blarghblargh
@blarghblargh 2 месяца назад
DUAL quaternions, you say... I'm going to have to look this up.
@Master_64
@Master_64 2 месяца назад
Why is the video in 24 FPS lol Good video, just weird that the video is in 24 FPS when it's unnecessary.
@KazeN64
@KazeN64 2 месяца назад
yeah that's an editing mistake. i have a new editor and i think he didn't know we need that 60fps. will be fixed in the next video!
@Master_64
@Master_64 2 месяца назад
@@KazeN64 Good to hear 👀
@Micha-Hil
@Micha-Hil 8 часов назад
4:55 Wtf? This visualization is clean as hell
@Xanderreh
@Xanderreh 2 месяца назад
I just finished an overview of matrix multiplication in my Discrete Mathematics course I'm taking, so you can't imagine how giddy I was seeing concepts I just learned being applied practically in this video. Love it!
@bilditup1
@bilditup1 2 месяца назад
It’s interesting that this is presented as some kind of arcane magick. In a course you come across this pretty quickly, and is why they generally require linear algebra. I guess while the end goals might be the same, the starting points are a bit different
@clowcell7559
@clowcell7559 2 месяца назад
God where were you when I flunked out of linear algebra back in college? This video could've carried me thru that semester lol. Great video, love your work!
@SZvenM
@SZvenM 2 месяца назад
The editing of this video is very nice. Great video!
@Xaymar
@Xaymar 2 месяца назад
There's a few other things you can do with render matrices that I'm aware of. One of my uses of them was to emulate arbitrary rotated and placed clip planes on hardware/with game engines that do not support these. Another one is to use them for super-resolution screenshots by subdividing the final rendering matrix, allowing you to make screenshots well beyond the 64kx64k limit. They're super powerful, and extremely cheap to run. Also AFAIK modern games still use bone based animations, but the number of vertices that need to be modified has gone up significantly. In Unreal Engine for example, you can opt in to GPU skinning, which significantly improves performance if you're CPU bound, but hurts it if you're GPU bound. The problem that modern games have is that their LoD choice is often not great for the hardware it is going to be running on, resulting in unusual performance losses. And for some reason, the default has now become to make the animations worse - treating the symptom instead of the problem.
@blarghblargh
@blarghblargh 2 месяца назад
m64 associates each vertex with only a single bone. modern games use a mapping of 1 vertex to N bones (often 4, I believe), with a decimal value weighting how much each mapped bone contributes to the vertex's position. while modeling, the process of associating bone weights to each vertex is called "weight painting". "hurts it if you're GPU bound". It depends on how much CPU -> GPU memory bus bandwidth you're using. streaming bone transforms from RAM to VRAM can be much cheaper than streaming vertex data, since the vertex data can just be transferred the one time in bind-pose. so it's not just the amount of CPU/GPU compute that you may have a bottleneck on. bus bandwidth also matters. of course that might be old information now too, and we might have very different results once you start factoring in dynamic LOD stuff like nanite.
@halofreak1990
@halofreak1990 2 месяца назад
"The problem that modern games have is that their LoD choice is often not great for the hardware it is going to be running on, resulting in unusual performance losses. And for some reason, the default has now become to make the animations worse - treating the symptom instead of the problem." Or lowering the rendering resolution, making distant the objects that they were so desperate to render a blurry mess of pixels that would have been better off culled entirely or replaced with a lower LoD. I know this likely won't work for multi-platform games, but if there is only a single target platform, surely it can't be that hard to set performance targets and then make sure the artistic vision for the game works within those constraints?
@The23rdGamer
@The23rdGamer 2 месяца назад
Thank you for sharing your passion and knowledge online. You're a great teacher and a valuable asset to this community!
@rovertronic
@rovertronic 2 месяца назад
A really convenient use of transform matrices is that you can easily determine the up, forward, and right of an object just by pulling any of the 3 rotation vector3s of the transformation matrix! I'm sure modern game engines already provide helper functions for that, but it's especially useful when working with more primitive engines like Mario 64.
@zakkiblakk
@zakkiblakk 2 месяца назад
Wow, this editing was top notch!! And I could even kind of follow along with the math lol
@rjrg7952
@rjrg7952 2 месяца назад
Kaze really learned our matrices with this one
@tombnomb2938
@tombnomb2938 2 месяца назад
Just rewatching the M64 optimisation series and the editing on this latest video looks so professional!
@Monkeymario.
@Monkeymario. Месяц назад
6:21 Unfortunatly ROBLOX tries to prevent you from doing this for some reason, likley because it would break the physics engine, or because the physics engine doesn't see the sheer so it removes sheer and keeps rotation on physics update. OR ITS ROBLOX'S ANNOYING ORTHONORMALIZING! D: Atleast you can still sheer the camera in ROBLOX.
@tiko-
@tiko- 2 месяца назад
wake up babe new mario 64 optimization just dropped
@NOT_A_ROBOT
@NOT_A_ROBOT 2 месяца назад
they didn't really mention anything about optimizing the game, just the fact that you can already do it?
@Fighter_Builder
@Fighter_Builder 2 месяца назад
​@@NOT_A_ROBOT I think it was more in the sense of "this is a more optimal way to do fancy graphical effects" tbh
@blarghblargh
@blarghblargh 2 месяца назад
@@NOT_A_ROBOT it's what his videos typically talk about
@Molotov2112
@Molotov2112 2 месяца назад
Was not expecting Kaze to teach matrix algebra. It’s the foundation of all modern computing and graphics.
@yukoyukooko
@yukoyukooko 2 месяца назад
i really love the blending of the skybox and the levels edge, it really makes your levels look much much larger. definitly add this to all your levels its beyond cool and clever
@optimal284
@optimal284 2 месяца назад
The "3D Math for Games" section in Jason Gregory's (Naughty Dog Engine developer) book "Game Engine Architecture" is an amazingly helpful read that's related to this! Especially the matrices section.
@NemesisTWarlock
@NemesisTWarlock 2 месяца назад
This is utterly fascinating, and I have a vague idea what's going on here... but I'm never gonna hit this level. As a game dev, I'd like to put this DnD wizard-based analogy: I'm having fun with some cantrips and the odd casting of Fireball. Kaze is explaining how you, the viewer, can cast Wish and Time Stop with enough experience!
@n64glennplant
@n64glennplant 2 месяца назад
Lovely work as always, personally I think I’ll be in the minority by saying no to a demo….because I just know the finished game will be amazing I won’t want that wow factor to be diminished by getting a taster early! 😂
@cameronmoore7675
@cameronmoore7675 2 месяца назад
I remember having a really hard time in college understanding the matrix math involved with graphical rendering. Really thankful to have this quick intuitive guide if I ever dive into that again!
@dingus_bingleton_the_3rd
@dingus_bingleton_the_3rd 2 месяца назад
The editing is even better
@brunoldo
@brunoldo 2 месяца назад
Liking this video as soon as you showed the Matrix changing while the values were displayed on the screen. Super useful when trying to understand the math behind the results and it opens for deeper looks into it in general. Great video in general
@AnnCatsanndra
@AnnCatsanndra 2 месяца назад
Thank you so much for the visualization, that makes this stuff make WAY more sense than my textbooks ever did.
@Ayanbadin
@Ayanbadin 2 месяца назад
i really like this new editing style you went for, it makes it more unique and appealing! nice job brutha!
@clebbington
@clebbington 2 месяца назад
The production quality on this video is awesome! Some really cool edits
@VenetinOfficial
@VenetinOfficial 2 месяца назад
so you basically developed a source-styled 3d skybox on the n64. god damn, what a sight
@moonhowler667
@moonhowler667 2 месяца назад
Uh no, it's been common practice since home 3D was a thing. He literally showed that.
@LisandroLorea
@LisandroLorea 2 месяца назад
4:20 There's a company called Voxon Photonics that makes 3D displays. No sure how many people have one of those though, but it's 2D once it reaches the retina
@skeleton_craftGaming
@skeleton_craftGaming 2 месяца назад
Patricia [The new word for matrices] Are just good to know in general, there's a reason why linear algebra is required to get a CS degree. (For some reason, computational science and linear algebra are really closely tied together in more ways than just 3D graphics)
@Psilocervine
@Psilocervine 2 месяца назад
I've struggled with matrices for ages despite doing loads of shader programming and this is probably the most helpful overview I've seen
@epsilonthedragon1249
@epsilonthedragon1249 2 месяца назад
"Ok, glad that’s explained" I too enjoy a good pannenkoek reference
@THMCTerracraft2
@THMCTerracraft2 2 месяца назад
Just don't announce the release date so nintendo doesn't nuke it one day before.
@lex_darlog_fun
@lex_darlog_fun 2 месяца назад
A TA (technical artist) / rendering engineer here. 2:30 Actually, on modern hardware (anything less then 10-15 years old) it's *MUCH* cheaper to animate BG characters fully on GPU. The only thing CPU does in such case is it sets up each charcter's animation ID and progress (which can be sent as a single massive buffer with all animation states for all the characters at once). Animation itself is then done via GPU only. Check out VAT (vertex animation textures) technique or, for even fancier approach, check out how rendering is done in Alan Wake 2.
@KazeN64
@KazeN64 2 месяца назад
Yeah absolutely!! I implemented VAT myself before. I believe by default out of the box, UE5 animated characters on the CPU though, which is that much more expensive. And if you went with matrix animations like this (imagine only supplying a handful of quaternions and offsets and then it computes a matrix stack applied to all individual body parts), i'm sure it'd be even slightly cheaper than VATs. Both easily beat the CPU animations in most cases though I think
@lex_darlog_fun
@lex_darlog_fun 2 месяца назад
@@KazeN64 VATs themselves can contain rotation quaternions per-joint (not per-vertex), while vertices contain onle their corresponding joint IDs. That's how VAT export is by default implemented in modern Houdini. And you can atlas multiple VATs together (or put them into texture array) - thus, getting an entire animation set in a single texture, which would let you draw all the characters with this animation set (and possibly, even slightly different models) in a single draw call. But, of course, that Houdini's general-purpose tool isn't tailored for BG charcaters specifically. For those, as always, you'll need to make a custom VAT exporter yourself. But my point is, for large crowds of BG characters, I don't think the technique shown in the video is "much cheaper than modern animation techniques". Since VAT is, technically, one of those. It's definitely cheaper than a *default* animation technique used in any engine (not nonly UE5, Unity too). So laggy characters in modern games isn't a testimony against modern animation techniques, it's a testimony against low-effort development.
@KazeN64
@KazeN64 2 месяца назад
Makes sense, so a lot of games already use something very similar here, it's simply not the default. Still wish more games did it the more performant way
@SpottedHares
@SpottedHares 2 месяца назад
Maybe the last transform matrix could be used from some kind of horror level? Some kind of monster that is undulating and pulsing constantly?
@idkwhatimdoingproductions8824
@idkwhatimdoingproductions8824 2 месяца назад
Wow kaze you really upped the editting, it was never bad but this is great!
@catmacopter8545
@catmacopter8545 2 месяца назад
your editing is really really good!!!
@CharlyConNostalgia
@CharlyConNostalgia 2 месяца назад
This feel like the equivalent to the SNES sprite distortions. The effects look good! (I mean graphically, I imagine that technically it is more complex than that)
@cheezitupp
@cheezitupp 2 месяца назад
I’m not a game dev, I’m a computer scientist- we hit on all of this stuff in my very first and only computer graphics class that I took out of interest. I would be very scared if game devs that went to college somehow didn’t know this stuff.
@Bestmann3n
@Bestmann3n 2 месяца назад
indeed... I don't think it's possible to be a game dev and not know about matrices and basic linear algebra.
@General12th
@General12th 2 месяца назад
A lot of game devs A) don't have a college degree in computer science and B) use the standard Unity settings without giving graphics a second thought. Does this mean they're not real game developers? No.
@Bestmann3n
@Bestmann3n 2 месяца назад
​@@General12th a) if you try to do gamedev then you'll run in to this stuff in no time. Doesn't matter if you have a degree or not. So for this reason alone, I cannot believe that there are gamedevs(on the programming side) out there who are unaware of what matrices are and what they are used for. Unless you count anyone who installs unity on their computer as a gamedev. TBF, in a world where people who write prompts for AI's think they are making art nothing like that surprises me anymore. b) matrices are all over the place: transforms, coordinate systems, animation. It's not a graphics thing.
@blarghblargh
@blarghblargh 2 месяца назад
@@Bestmann3n I'm a pro game dev. Not all pro game devs are that good at these things, and often get away with calling functions that do most of the work for them. A lot of game programming is bookkeeping of game rules and GUI logic, and not geometry or linear algebra. It really depends on what kinds of games you're making, and what your specific programming role is in the company. The more a "generalist" the person is, the more they'll probably just fudge the math until they get roughly the result they want, without necessarily having a strong grasp on what they did. Quite common in indie games, where they have to wear all the hats. But yeah, it's fairly common to know these things, especially if you were around before the time that Unity/etc were ubiquitous.
@NanomachineExE
@NanomachineExE Месяц назад
Unfortunately the game dev industry is propped up by a ton of fraud and fake knowledge sloshing around in degree programs. There's a ton of untalented and uninspired game devs wasting space. Engineers vs people who read a textbook and were able to reproduce information they hardly understood for a multiple choice exam that gave retakes if they failed
@SapphireCrook
@SapphireCrook 2 месяца назад
I did a minor once where I had to make my own little DirectX render thing and now I understand Matrices a little more. But a lot of the rest was familiar. Wowie!
@flameofthephoenix8395
@flameofthephoenix8395 2 месяца назад
0:48 Certainly! I used to just find the angle and distance a point was at then add to the angle and use sine and cosine to replot the point... Rotation matrices are an invaluable tool!
@Skeffles
@Skeffles Месяц назад
Great video! These matrices always confused me but your explanation helped me understand so much more.
@OctagonalSquare
@OctagonalSquare 2 месяца назад
I used them in a game for a game jam I took part in on my second channel. Projected a flat world onto a “sphere” (it was actually a parabolic shape but I’ve since turned it into a real sphere). Worked really well!
@romialLekeulem
@romialLekeulem 2 месяца назад
Can't wait to try out the new first course!
@SCMabridged
@SCMabridged 2 месяца назад
The production values on your videos have exploded exponentially and yet you've managed to keep them concise, informative, and effortlessly entertaining without succumbing to all the obnoxious filler crap that normally ruins channels once they find their rhythm. Keep up the great work!
@artless3438
@artless3438 2 месяца назад
I'm learning applied linear algebra for games through an online textbook! The power of matrices are amazing and I'm glad you're highlighting their utility in this video :)
@Hamza-qs7ez
@Hamza-qs7ez 2 месяца назад
Nice Which textbook?
@Fluffieluke
@Fluffieluke 2 месяца назад
Kaze is the type of guy to reprogram an entire game's engine just to reduce a bit of lag that's barely noticeable. and I love it
@e-mananimates2274
@e-mananimates2274 2 месяца назад
I'm amazed by how much research and developments you invested into this console! In fact, it reminds me of how much I invest into my animation rig with all the discoveries I made.
@xeostube
@xeostube 2 месяца назад
This is extremely well done summary of matrix math as used in 3D graphics given a target audience of people who knew this once upon a time and forgot it. If it's your first time seeing a matrix... well understand this would usually be 1-2 lectures (ie a full week) of a college level course, so of course it's hard to follow when condensed into 10 minutes or less. Plus that college class would typically assume a linear algebra pre-req, tho to be fair very little of that linear algebra class is relevant. I mean, eigenvectors, etc...
@PedroInTheBathroom
@PedroInTheBathroom 2 месяца назад
make a circus level with the distorting mirrors- perfect use of that last collumn in the matrix!
@Monkeymario.
@Monkeymario. Месяц назад
1:00 There is no way to verify that is a gif, but it probably is not a gif considering that I don't see any dithering, but I could br wrong.
@goeiecool9999
@goeiecool9999 2 месяца назад
That "mario is tripping" effect is very similar to minecraft's nausea/nether portal effect
@RiverReeves23
@RiverReeves23 2 месяца назад
Great vid man, you're really refining your skills as a RU-vidr. Game's looking great and the render matrix effects are a really nice touch.
@Heavenira
@Heavenira 2 месяца назад
i do like your own editing Kaze :) this editor is nice though
@Birb64
@Birb64 2 месяца назад
I learned how to do matrix math not even a week before you posted this, but this helped clear up my question of if matrices were used in rendering.
@rayman2902
@rayman2902 2 месяца назад
Honestly, considering how you said that the opening area is now very different in one of your previous videos I think making a demo showing the more up-to-date game a little bit would be really cool!
@stefanolassandro886
@stefanolassandro886 2 месяца назад
Great video! And congratulations for making it to twelve levels :D
@casualSeth
@casualSeth 2 месяца назад
Yes- please release a second demo! Ive played the first one countless times.
@JadenFox9
@JadenFox9 2 месяца назад
been years since I heard about this and man, I forgot how impressive and smooth they can be
@Monkeymario.
@Monkeymario. Месяц назад
1:16 The camera. Distortions and rotstions. Matrices are the stuff that hep rotate stuff.
@samuelthecamel
@samuelthecamel 2 месяца назад
This video has an entire free linear algebra lecture inside it
@TheUnknownsShow
@TheUnknownsShow 2 месяца назад
I bet that flame at the end would look cooler if you applied those funky transformations you said you didn't have a good use for.
@andrewshobbybasement
@andrewshobbybasement 2 месяца назад
Matrix transformations in games actually predates proper 3D rendered graphics. The SNES's Mode 7 graphics mode would use matrix transformations to scale and rotate a 2D plane, and then a psudo-3D perspective could be created by using direct memory access to create a projective transformation while drawing the plane to the screen.
@ArneChristianRosenfeldt
@ArneChristianRosenfeldt 2 месяца назад
So there is no Matrix in the perspective case (F-zero). Instead you cast rays for both sides of the screen over the floor. You take the scalar 1/y and multiply it with a vector. Then for each scan line you take the delta u and v (or s and t (naming convention?)) and let the hardware add them as it renders left to right.
@msld_sound
@msld_sound 2 месяца назад
I was always curious about how the Ocarina of Time cutscenes (especially inside Ganondorf’s tower) accomplished focal length effects, and now I know: it was projection matrix manipulation! So cool!
@pixboi
@pixboi Месяц назад
They way I like to think about matrices => A car is going north, a man sees the car going left, the driver in the car seat is going forward. Matrices are just "perspectives" that can be converted into and unto each other at will.
@Alevice
@Alevice 2 месяца назад
I loved the sunglasses yoshi reference
@SrMao
@SrMao Месяц назад
Thanks for the linear algebra class! 8:47 programmers on game engines use shaders to make this effects. some of this effects are already implement.
@ConcavePgons
@ConcavePgons 2 месяца назад
Kaze is teaching matrices better than how my professors in Calculus ever could.
@kpopmojo
@kpopmojo 2 месяца назад
I love this channel so much. Thank you for all of your hard work & I hope that you have a great weekend. I can't wait to experience your Mario game for the first time. I'm more excited about that coming out than any future game release that I can think of right now
@mrsteyk1
@mrsteyk1 2 месяца назад
On modern hardware you can also try and leverage vertex animations baked into a texture and sample it with filtering for large crowds of unimportant entities. One mobile game does that for stadium crowd, and some PC games might be doing that for birds. Just don’t forget to add .5 to get the correct unsampled texel.
@fakesmile172
@fakesmile172 2 месяца назад
I failed Linear Algebra I twice...though I didn't have too much trouble with matrices, it's the other stuff I had trouble with.
@uliveulearnandregret
@uliveulearnandregret 2 месяца назад
Kaze Emanuar 4:26 RU-vid's VR View exists, but the video itself has to be recorded in 3d in some way, Meta quest is a 3d output device but there is no 3d input device for recording, unless the use of dll and plugins are used for a game or application
@NobodyYouKnow01
@NobodyYouKnow01 2 месяца назад
That fuzzy bro... I remember playing Last Impact and falling through the map at least twice.
@Neuromancerism
@Neuromancerism Месяц назад
There actually ARE 3 dimensional output devices. They are some weird thick screens where indeed you see something different if you move relative to it, of course it is crazy expensive both in price but of course you also need to compute like 30 images for every single frame so computation is insane.
@crouton-mt
@crouton-mt 2 месяца назад
The ship swaying was really cool
@nathanielfernandes5597
@nathanielfernandes5597 2 месяца назад
babe wake up, new kaze video just dropped
@realvaporcry
@realvaporcry 2 месяца назад
Kaze should launch his own game soon. It would be great to see him experimenting beyond the SMB world.
@Ridnarhtim
@Ridnarhtim 2 месяца назад
First Kaze video I actually understood.
@YOEL_44
@YOEL_44 Месяц назад
I wouldn't want, not even background peds, to be modeled/animated this way. Having those sharp edges between the objects would make modern effects like ambient occlusion, make those peds look like the Michelin Bibendum. Maybe for LOD models could still be used, but I don't know if it would be worth generating alternative animations for the different model types, instead of just jumping frames from the main animation like it's common to see now.
@atirutwattanamongkol8806
@atirutwattanamongkol8806 Месяц назад
9:52 sounds a lot like what Source Engine games do (the Citadel early in HL2, faraway landscapes, etc.). The way they do it is to have a special miniature map and render it in the background at increased scale.
Далее
The Problems with Walls in Super Mario 64
8:02
Просмотров 233 тыс.
Giving Personality to Procedural Animations using Math
15:30
Team Spiderman True Or False Mask,nono #Shorts
00:37
Voxel Ray Tracing
5:16
Просмотров 264 тыс.
Knockoff Plumber
2:01
Просмотров 2,6 тыс.
I built my own 16-Bit CPU in Excel
15:45
Просмотров 1,5 млн
I Created a Game Engine Just to Optimise This
4:50
Просмотров 1,1 млн
Low Poly is OVERRATED
9:48
Просмотров 388 тыс.
Dear Game Developers, Stop Messing This Up!
22:19
Просмотров 722 тыс.
The Truth about the Fast Inverse Square Root on the N64
10:01
Mario 64's Physics are not perfect
22:00
Просмотров 280 тыс.
Team Spiderman True Or False Mask,nono #Shorts
00:37