@@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
@@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.
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.
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
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
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.
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.
@@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.
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.
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.
@@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.
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.
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
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.
@@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
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 you need more than just matrices for animal crossing because matrices only do linear transformations, whereas making a curved world is not linear
@@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?
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! 🙌🤗
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 RUclips short trying to hold my attention.
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
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!)
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.
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?
@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.
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.
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 !!
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.
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.
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.
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.
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.)
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
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!
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!
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.
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.
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.
"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?
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! 😂
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!
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.
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!
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
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.
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
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
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!
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!
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!
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!
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 :)
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...
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!
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.
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)
6:34 I believe its that it preserves the area of each individual face, not specifically the volume: being that any/all shear transformations will preserve volume. (will not be surprised if im thinking about this wrong but)
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)
Would love to hear more about how you implemented the special matrix effects in the n64 render pipeline. That could give more good directions for approaching similar effects in modern engines. I loved the explainer on the nested matrix operations, from object to world to view to screen. It feels very clear and open.
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.
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
7:28 one thing you can do with that column is make an orthographic perspective matrix, great if you want to make a top-down isometric view. though it would certainly be trippy to apply that to a single model instead of a projection matrix
i wish more engines would make it easy to mess with the projection matrix. i have an idea for doing an "earthbound room" style effect by making the camera orthogonal projection on the up-down axis but perspective on the left-right axis.
the skybox technique you're using really reminds me of making 3D skyboxes in source (which i assume does more or less the same thing behind the scenes for the final render as you are)
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!
i used to mess with all this stuff on mkds and ar codes back in the day. this was neat to see how this all works n depth. i dont think there will ever be a game better than this once its finished.
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.
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
@@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.
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
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.
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.
@@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.
@@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.
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
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.
Did I just witness Super Mario Galaxy 64 ?
YEAH!!!! that would be a really cool de-make to make! just imagine x3
make this happen
Posible
Wishful thinking.. 😂
@@Moonchild1607 super mario 64 in ursina? :D
Bro’s teaching Linear Algebra to help game devs
Freal 10 years later I finally actually understand what I had just brute force memorized to pass an exam.
He literally has a degree in mathematics
@@shuckaroooI suck at math so I guess game dev was not meant to be for me.
@@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
@@kaibaman9651 You don't really need much more than basic trigonometry unless you want to make your game fully from scratch
In 20 years Kaze is gonna end up porting cyberpunk to the n64 and it’s gonna run at 60fps
The one time the N64 being 64bit is useful, file sizes.
You would kill the ram-bus streaming every texture and model though
@@mjcox242Isn't the N64 theoretical cartridge size limit 1GB per bank?
Pretty much it could even match a DVD with some bank switching
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.
@@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.
@@mjcox242 nah, Kaze would still manage to make the rambus go vroom vroom
Bruh this is the video you show to new freshman CS/ECE students to get them jazzed about math.
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.
Yep, I wouldn't have gone for a CS degree if not for Mario romhacks
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
@@tenku44 same here brother
I am a CSE / DSAI student 😂
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
Yeah like Minecraft leaves skewing in the 'wind', it looks great and it's so ridiculously cheap
Vertex animation was one of the keys to how Crash Bandicoot was created.
It is limited but vertex animation textures can be the solution if bandwith problem is somehow solved
N64 has been doing t&l (vertex shaders) in software since it was released, that's literally how it always worked.
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.
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.
@@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.
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.
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.
@@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.
can't wait to hear a lecture about things i can barely comprehend
Barely is the fun part!
if you take a class in university called Calculus III they explain this there
@@tacokonekoi want to learn this for free :(
I learned all about this in my computer graphics class
@@elokthewizard Access to all knowledge should be free, it would make the world a much better place.
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.
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
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.
Thank you for taking the time to write this
Thank you for writing this out.
I wish RUclips allowed us to bookmark comments! Screenshot to the rescue for now.
Damn... being 6 minutes late to Render Matrices! I NEED TO know about them!!!
if you are a dev, you better!!
I briefly had to deal with these in first year uni math. That was 7 years ago, maybe I oughta brush up…
@@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
@@KazeN64 scaling matricies are Notting more Than vec x vec = vec.
(Smal optimization)
@@enricofischer1330if you’re already applying transformations, having it included in your Mat4 saves the vector multiplication.
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
I could see something like that or even Animal Crossing's "Rolling log" world
it's not "theoretically", it's literally what they used
@@tbtb66 you need more than just matrices for animal crossing because matrices only do linear transformations, whereas making a curved world is not linear
@@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?
generally they call that an orthographic projection, where things don't shrink as they get further away.
7:19 is this an editing mistake? Missing GIFs?
oh god
yes that's an editing mistake lmao
@@KazeN64 Damn. It's reupload time.
the rest of the video more than makes up for it. really good editing throughout
The internet conditioned me into thinking this was some kind of weird joke I didn’t quite understand, so I never questioned it, lol.
@@ThePC007 I never questioned it because I don't pay any attention to the visual part of the video...
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! 🙌🤗
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 RUclips short trying to hold my attention.
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
Idk man it was fine by me. I have no idea what anyone else is betchin about
@@technocolossus me when other opinions exist:
(ironically i've not paid much attention to the SFX, so i'm indifferent)
I think the images at 7:13 are broken
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!)
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.
Time to pretend like we understand what the magic optimization man is talking about.
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?
@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.
@@eth-p this explanation is very clear to me, thanks
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.
(This one was actually pretty easily understandable, at least for me)
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 !
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 !!
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.
Cool, one could use orthographic projection e.g. to make levels with fixed isometric camera angles.
@@cube2fox The Mario N64 mod Monroe Park over on RHDC does this, achieving a sort of Monument Valley aesthetic. It's pretty wild.
@@cube2foxor you could just use simple 3x3 Matrix and no division at all (in the firmware).
@@ArneChristianRosenfeldt Would lose translations as those depend on the constant 1 being multiplied with the coordinates and added in.
@@davidmcgill1000 on GBA it is significantly cheaper to subtract the camera position before the Matrix stuff.
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.
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.
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.
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.
My friend you may enjoy learning about the benefits of dual quaternion for 3D rendering.
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.)
DUAL quaternions, you say... I'm going to have to look this up.
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
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!
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!
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.
Why is the video in 24 FPS lol
Good video, just weird that the video is in 24 FPS when it's unnecessary.
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!
@@KazeN64 Good to hear 👀
The editing of this video is very nice. Great video!
Wow, this editing was top notch!! And I could even kind of follow along with the math lol
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.
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.
"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?
Just rewatching the M64 optimisation series and the editing on this latest video looks so professional!
Thank you for sharing your passion and knowledge online. You're a great teacher and a valuable asset to this community!
4:55 Wtf? This visualization is clean as hell
Was not expecting Kaze to teach matrix algebra. It’s the foundation of all modern computing and graphics.
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! 😂
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!
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.
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!
Kaze really learned our matrices with this one
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
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.
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
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
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!
so you basically developed a source-styled 3d skybox on the n64.
god damn, what a sight
Uh no, it's been common practice since home 3D was a thing. He literally showed that.
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!
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!
i really like this new editing style you went for, it makes it more unique and appealing! nice job brutha!
The production quality on this video is awesome! Some really cool edits
wake up babe new mario 64 optimization just dropped
they didn't really mention anything about optimizing the game, just the fact that you can already do it?
@@NOT_A_ROBOT I think it was more in the sense of "this is a more optimal way to do fancy graphical effects" tbh
@@NOT_A_ROBOT it's what his videos typically talk about
Thank you so much for the visualization, that makes this stuff make WAY more sense than my textbooks ever did.
Maybe the last transform matrix could be used from some kind of horror level? Some kind of monster that is undulating and pulsing constantly?
I've struggled with matrices for ages despite doing loads of shader programming and this is probably the most helpful overview I've seen
Great video! These matrices always confused me but your explanation helped me understand so much more.
Wow kaze you really upped the editting, it was never bad but this is great!
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!
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 :)
Nice
Which textbook?
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.
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...
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!
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.
Can't wait to try out the new first course!
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)
i do like your own editing Kaze :) this editor is nice though
Great vid man, you're really refining your skills as a RUclipsr. Game's looking great and the render matrix effects are a really nice touch.
Great video! And congratulations for making it to twelve levels :D
I've been studying this at university but just now I can see how important it really is, thanks
"Ok, glad that’s explained"
I too enjoy a good pannenkoek reference
Yes- please release a second demo! Ive played the first one countless times.
your editing is really really good!!!
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.
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
make a circus level with the distorting mirrors- perfect use of that last collumn in the matrix!
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.
6:34 I believe its that it preserves the area of each individual face, not specifically the volume: being that any/all shear transformations will preserve volume. (will not be surprised if im thinking about this wrong but)
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)
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.
Would love to hear more about how you implemented the special matrix effects in the n64 render pipeline. That could give more good directions for approaching similar effects in modern engines. I loved the explainer on the nested matrix operations, from object to world to view to screen. It feels very clear and open.
The editing is even better
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.
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
7:28 one thing you can do with that column is make an orthographic perspective matrix, great if you want to make a top-down isometric view.
though it would certainly be trippy to apply that to a single model instead of a projection matrix
i wish more engines would make it easy to mess with the projection matrix. i have an idea for doing an "earthbound room" style effect by making the camera orthogonal projection on the up-down axis but perspective on the left-right axis.
been years since I heard about this and man, I forgot how impressive and smooth they can be
Just don't announce the release date so nintendo doesn't nuke it one day before.
the skybox technique you're using really reminds me of making 3D skyboxes in source (which i assume does more or less the same thing behind the scenes for the final render as you are)
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!
That "mario is tripping" effect is very similar to minecraft's nausea/nether portal effect
Kaze is teaching matrices better than how my professors in Calculus ever could.
i used to mess with all this stuff on mkds and ar codes back in the day. this was neat to see how this all works n depth. i dont think there will ever be a game better than this once its finished.
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.
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
@@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.
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
This man has been COOKING, great editing and content
Kaze should launch his own game soon. It would be great to see him experimenting beyond the SMB world.
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.
indeed... I don't think it's possible to be a game dev and not know about matrices and basic linear algebra.
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.
@@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.
@@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.
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
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.
Astounding works ! Your video was a nice way to refresh my memory in linear algebra ^_^
babe wake up, new kaze video just dropped
You forgot to explain how matrix multiplication is done or what this applies to outside of the n64
every kaze video gets better every time he uploads!! Awesome video bro
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.