"You actually shoot from your eyes, the gun is purely cosmetic." So basically, we are all superman in an fps shooter game.
@fulsame1
3 жыл бұрын
This isnt as common anymore.
@9another632
3 жыл бұрын
And The Original doesnt shoot from the center[technically]
@SherrifOfNottingham
3 жыл бұрын
This is less common with games like DayZ and Arma (same engine) where the "mil-sim" aspect of the game kind of required a bit more consistency of where the bullet was coming from. However, as you will notice, there's downsides to both a "in world" view model and bullets coming out of the actual muzzle. 1.) We don't hold our guns perfectly in our vision. The idea of a "view model" was instilled into gaming with it not being super realistic, mechanically it allows us to see what gun we're using but in reality if you ever actually play paintball/airsoft (or actually engage in combat) with a go pro on your head giving your "FPPOV" you'll notice that at most you'll see the gun when you aim down sight, but the rest of the time the gun is flailing around outside a normal camera FOV. So having the gun be a part of the real world model means you'll see less of it, and the view can be sickening to try and follow, especially for more action hero characters (Arma characters are well trained enough to not make heroic and action hero like wild movements). If you want to get a normal FPS game perspective of real life shooting, you would effectively need to have a camera on your chest. 2.) Depth Perception This is a major reason why games, like Arma in this example, utilize a crosshair despite it being debated on it being an unrealistic UI element or with the idea of it being cheaty. The reality is if you've ever held a gun (paintball or airsoft applies) you'll know that intuitively the general area you're pointing due to having TWO eyes and making use of your natural depth perception. With the Arma rifle being both in world and firing from the actual muzzle, gaging where the bullet is going to go is a little bit easier, but nowhere near as good as if you were holding the gun with both your eyes, and while this effect is actually worsened in separate view models, the bigger issue is the bullet comes out of the gun. Which means commonly people will peak out over cover, be unable to read the fact that their gun is actually below the cover you're shooting over and you just plant a few point blank rounds into whatever you were hiding behind. Now imagine having a fake view model and having your bullets come out of the theoretical third person gun model that you can't even see. 3.) Heads up This is the main reason most games end up abandoning "world models" or 3rd person view models, the idea is that we're going to make a character and we're going to plant the camera on the characters head, and make the first and third person models the same thing. The first glaring issue is the fact that you can see your own head. Most games that tend this way actually remove your own head from rendering to function better, it's the same model but the head is just invisible to you, so you don't see weird floating polygons that is actually just your nose or hair/helmet. But this also leads to really janky looking movement. Naturally as you walk your head is actually swaggering left to right and up and down and even leaning forward and back with every step, but your entire body is telecasting your intentions to the motion centers in your brain so you can automatically calibrate your human viewport to be smoothed out and not cause motion sickness. But when looking at the 2D viewport of a game, this peripheral information doesn't get translated and your brain just sees a shaky blurry mess. While it's getting more common to see games tackle this idea, understand that a majority of games steer clear of these mechanics for good reason. That's why games like Apex, Overwatch, and Valorant all went with laser vision.
@testhekid
3 жыл бұрын
apex battleroyale is basically superman ffa
@ezequieldidjurgis9430
3 жыл бұрын
in a few games the gun rreally works, example:Phantom forces (a roblox game) here the models are preetty well made, the gun shoots where it is supposed to shoot, instead of your eye shooting.
@Wodsobe
3 жыл бұрын
For the TF2 viewmodel fov thing, Valve just knows how to do a lot of sneaky stuff
@Xx_time2die_xX
3 жыл бұрын
And yet they can't count to 3
@Wodsobe
3 жыл бұрын
@@Xx_time2die_xX got'em
@garbaj
3 жыл бұрын
Sneaky gaben and his sneaky tricks!
@MekaniQ
3 жыл бұрын
@@Wodsobe haha!
@DoxyYT
3 жыл бұрын
but they still dont know how to do a good anti cheat :|
@Guilmon35249vr
3 жыл бұрын
TF2 and other Source games, as far as I know, are capable of using one camera to render a scene multiple times and superimpose the rendered scenes together. Garry's Mod uses it to handle 3D2D objects- it temporarily moves the camera, draws the object, then moves the camera back and draws the rest of the world.
@jco_sfm
3 жыл бұрын
yeah all source guns render the viewmodel separately
@lucariken2065
3 жыл бұрын
You can also spawn the things that are used for the view model in G-mod. For example the demoman arms and his gun.
@-YELDAH
3 жыл бұрын
@Nevermore congrats on saying that exact sentence for the 4680247th time they have a life too y'know
@RoyaleNoir
3 жыл бұрын
Spent *wayy* too long studying the CViewRender class and I can confirm it does do a separate pass on the same renderbuffer
@Miksolo
3 жыл бұрын
I remember seeing something in one of Shounic's videos about how all the viewmodels in TF2 are actually separate, enlarged models of the characters' arms and weapons that appear in front of their head, that are simply invisible when viewed in third person or by other players unless some cheaty stuff is enabled
@fireaza
3 жыл бұрын
Unlike a traditional shooter, in VR, the bullets actually come out of the gun model instead of your face. This is real neat, since motion controls allow you to freely miniplate the position and orientation of the gun in 3D space. This means that, without the programmers needing to program in the specific function for it, the player can play the game more like Gears of War if they want, blind-firing and all that. This horribly breaks barebones VR ports, which aren't expecting the player to be able to do this. Especially if they didn't bother to add collision to your hands, which means you can just straight-up ghost through walls and interact with things you shouldn't be able to do. Like being able to get the Cryolator in Fallout 4 before you even leave the vault, simply by snatching it out of the locker without picking the lock.
@pretzelbomb6105
3 жыл бұрын
That’s why I always get a bit annoyed when people talk about VR like it’s just another console, when it changes every facet of play. A great example is 40k Battlesister. Simple things like being able to hold larger weapons with two hands, being able to hold onto the front without holding the back, parrying with your sword actually working, manually removing and inserting magazines, bludgeoning heretics with non-melee weapons, etc. Stuff like that is only experienced in VR. Sure, I can run out of ammo and click the right stick to melee a guy on Xbox. But that is entirely different from my meltagun running out and instinctively turning it around to bash a cultist’s head in.
@williamwhitehouse8741
3 жыл бұрын
To be fair you could do that in vanilla for as well just by telling dogmeat to fetch it
@fireaza
3 жыл бұрын
@@williamwhitehouse8741 Seriously? Ah, good old buggy Bethesda! Though another cheat you can do in the VR version is taking a shortcut to the end of dungeons by reaching through those doors that are placed near the dungeon entrance (the ones that are intended to help the player quickly exit the dungeon after they've reached the end) and unlocking them from the opposite side.
@quinnmarchese6313
3 жыл бұрын
fun fact, a lot of old FPSs did the same thing. to piggyback on Fallout, Fallout 3 uses that method, the bullet comes from the gun, hence why you may shoot at something, but have the bullet hit the wall or piece of cover directly in front of the gun. New Vegas, switched to the old bullet leaving the front of your face to combat this annoyance, and im sure for other reasons.
@graphite7898
3 жыл бұрын
@@fireaza If you are talking about Skyrim, I heavily suggest getting HIGGS (I believe it is what it's called) among other mods like a full body. It makes the game infinitely better in VR because you actually have a digital both that can interact with things (Like balancing cheese wheels on my triceps) and see what you wear. As for HIGGS, it allows you to actually grab things, for realsies, like actually grab corpses by the ankles and drag them. Amazing stuff. Fixes the glitch too since you are no longer some bodiless Skyrim ghost that levitates things slowly and can phase through walls, which is neat.
@Part.No.1xbil.Prod.Tp.MXMVIII
3 жыл бұрын
In TF2 each character has two models: a full character mesh and their view model. both are rendered in game as 3d objects just like the characters, projectiles, and terrain, but the view model is only visible from the first-person perspective, and it renders over everything else but the HUD. I used to turn-off the view model and render the character mesh in first person because it freed-up my POV and could also help me get a feel for where my hitboxes were at.
@getshrekt6933
3 жыл бұрын
it was also used as a feature for the vr mode that was in the game a few years ago
@vidiottheowl2825
3 жыл бұрын
that's a really neat trick. how do you do it?
@getshrekt6933
3 жыл бұрын
@@vidiottheowl2825 wdym
@zeniththetoaster9712
3 жыл бұрын
@@vidiottheowl2825 I'm used to command for a while but I've got to go check to see what it was. I will get back to you
@zeniththetoaster9712
3 жыл бұрын
@@vidiottheowl2825 set cl_first_person_uses_world_model to 1 in the console, it Can be used on any sever and is 0 by default.
@BlueHarrier
3 жыл бұрын
2:30 I was going to throw a theory on the matter, but turns out that it has been already covered, so here's another clarification. If you remove the z reading or writing, it would affect the polygons of the weapon itself rendering over each others in reversed calling order, so to achieve this effect, it's probably clearing the depth buffer of the scenary before rendering the weapon without disabling the depth reading or writing. Another clarifiaction in 2:50 is that only raytraced bullets are shot from your eyes, however proyectile type bullets (like Lucio's example) are actually coming from the weapon, but using a raytrace from the eye's perspective to calculate the direction of bullet so it hits where you're aiming to. This is better explained in Shounic's video about the rocket launcher, I recommend watching it out.
@Thornskade
3 жыл бұрын
Overwatch doesn't do this like TF2. Although it looks like the projectiles are coming from your weapon, they do actually come from your eyes. So it basically shows a fake projectile path to the player who's firing the weapon.
@RoyaleNoir
3 жыл бұрын
What valve does is scale the depth range of the renderer to 0-0.1, so if you had level geometry close enough it clips through your camera, it would also clip through the viewmodel
@blinkachu5275
Жыл бұрын
@@Thornskade That's wrong, Overwatch only uses eyes for hitscan, projectiles are 100% coming from the gun itself. It's why if you're standing in front of a wall and shoot as Pharah for instance, the impact is where the gun's tip is.
@Thornskade
Жыл бұрын
@@blinkachu5275 That was 100% not the case when I played it.
@PeacecrabVal
3 жыл бұрын
Basically in order to draw a mesh on the screen its vertices are multiplied by 3 matrices. One to move it to where it is in the world, one to then move that location relative to your camera, and then one to transform that relative position into a position on your screen. That third matrix is called the projection matrix and it's what simulates depth perception by for instance making objects smaller the further they are, and it's calculated according to a desired FOV. So, rendering a viewmodel with a different FOV on one camera is as simple as calculating a projection matrix for a specific FOV and sending that to the weapon model instead of the regular projection matrix the camera will use with its FOV.
@qreeves
3 жыл бұрын
Smart and beautiful. This comment is underrated, I wouldn't have wasted time writing my own if this was further up the list.
@NeovanGoth
2 жыл бұрын
Perfect answer!
@Waffle4569
2 жыл бұрын
Exactly this. We think of every object in the scene having to receive the same camera matrix, but absolutely nothing stops you from changing the camera for each object.
@AlexTuduran
2 жыл бұрын
Yep.
@Rome101yoav
2 жыл бұрын
I love your reply because it's really smart but I hate that game design has so much linear algebra in it because I'm really not.
@WhiteDragon103
3 жыл бұрын
To be honest, I really do appreciate it when FPS games make an effort to make the gun physically real and not in a separate layer; it avoids collision, bullets come from the gun's tip instead of your face etc. StarCitizen did a lot of neat things with this.
@AlexProGear
3 жыл бұрын
I think it's more about the game design rather than implementation difficulty. Imagine scenario where you're hiding from your enemies behind boxes, stand up and shoot into the box because your weapon is too low. That would be really frustrating! Devs could implement animation for character to raise hands, which would kind of solves the issue, but how high does the character need to raise his hands? And what if the enemy under crosshair is also behind some cover? Now that I think about it, maybe it IS about implementation difficulty... Too much effort for no practical use? Projectile weapons, on the other hand, tend to shoot from the weapon tip, like the rocket launcher from TF2. And yes, that means that when you're behind some cover it's easy to shoot on the right side but hard on the left - you have to peak further to not shoot into the wall, since default settings imply right-handed player model. Although, there is a special rocket launcher called Original, which is in the middle of the screen like weapons in *original* Doom games :D
@diegopugaquintanilla4344
3 жыл бұрын
@@AlexProGear yeah, like it's neat when it's implemented but it can really hinder a game if it was not designed for it, for example, CSGO would be literally unplayable if bullets came out of your gun
@WhiteDragon103
3 жыл бұрын
@@AlexProGear An alternative could be to use a camera-centric shooting mechanic, where bullets come from your face, but the character adjusts where his gun is held to satisfy (as best it can) the constraint that a light of sight must be established between the gun's tip and the visible point under the crosshair. This would cause the gun to move around the wall or ledge, and would look a bit like the gun is blind firing around a corner, switching handedness when appropriate. It would all be cosmetic and not affect the gameplay but would create the look of authenticity. It'd also communicate effectively to other players that - because their gun is visible and pointed at you - they are able to shoot you. Could also add another constraint to prevent the gun from obscuring your line of sight. I think it'd be pretty sweet if a game implemented a system like this, where the character moves his weapon dynamically and adaptively to his cover like some sort of movie! Sure, it'd be hard to implement, but it is important to move the art form forward
@Acidicheartburn
3 жыл бұрын
@@AlexProGear You need to play Insurgency: Sandstorm and see how they handle it.
@Immafraid
3 жыл бұрын
Far Cry has always been great at this.
@vpswede98
3 жыл бұрын
2:47 "Does this mean i can shoot through a wall" Arma 3, I believe they use one camera, but the gun does not interact with certain walls as it should, if there is a thin sheet of metal you're able to stick the barrel of your gun through and shoot without having the penetration damage penalties. Same goes for floors of buildings and most other thin walls.
@starchaser2053
3 жыл бұрын
Escape from tarkov actually calculates the bullet direction from the barrel of the gun. Not sure if you can shoot through walls like Arma but its cool to think about
@Mandude4200
3 жыл бұрын
I love how this illusion completely is ruined when it comes to mirrors, as in you can see the mirrored model clipping through the mirror even though you aren’t, I remember discovering this when playing hitman III, even though you don’t look like you’re clipping through the mirror Your mirrored self definitely is
@lm9029
2 жыл бұрын
The illusion also kinda breaks when you compare to thirdperson. Usually the viewmodels make it look like you hold a gun in front of your face, while the character model usually holds it around the waist.
@polar1991
3 жыл бұрын
Yeah I literally implemented all of these 6 months ago. I do use only one camera though. I use a special material on my gun and arms though.
@AlexEatDonut
3 жыл бұрын
For the TF2 viewmodels, there is basically a giant viewmodel rendred in front of your character. No one else sees it but you. They are actually shown in this video if you want to see how it would look like in thirdperson. kzitem.info/news/bejne/o3epk6SecJ6ipHY Because they are rendered in 3D changing the viewmodel fov just moves the viewmodel away from the player.
@EmApex
3 жыл бұрын
This isn't quite right, it causes warping on the viewmodel indicating that an FOV change is actually taking place. A better example for this is in CSGO (same engine as TF2) where you can change the viewmodel X, Y, and Z position as well as the FOV - the FOV isn't just moving the viewmodel, it is actually altering the FOV of it. I have no idea how that would work myself though, I'm sure someone else can explain it
@heliusuniverse7460
3 жыл бұрын
@@EmApex it uses a vertex shader to distort the viewmodel depending on its fov
@EmApex
3 жыл бұрын
@@heliusuniverse7460 ah, thanks!
@randomcatdude
3 жыл бұрын
@@heliusuniverse7460 likely doesn't even use a special vertex shader. Most likely, they just simply pass in a different perspective matrix when the viewmodel is rendered. It's that simple.
@qreeves
3 жыл бұрын
@@EmApex We use something called view and projection matrices, which is just fancy 3d renderer speak for changing the math that interprets it on the fly. It's all still done in the same pass, but we can change how certain things render in that space by changing the math that applies to it.
@polar1991
3 жыл бұрын
Games like call of duty and over watch Also scale the screen differently. When you make the screen wider it snaps the gun to that side of the screen.
@kwan8247
3 жыл бұрын
Woah first time I saw your videos I was with the mindset that this is a small time youtuber, now you’ve blown up quite a bit. Keep up the good work!
@garbaj
3 жыл бұрын
thanks! the growth in the past few months has been incredible
@Tinkerer_Red
3 жыл бұрын
TF2 Can make use of a vec4's quaternions to distort the rendered object to appear as if the fov is being changed, where in reality it is being stretched/skewed through the 4th dimension.
@wombatowo
3 жыл бұрын
I like your funny words, magic man
@slimeyar
3 жыл бұрын
@@wombatowo at least it is not some make up word lol
@temporaryname4121
3 жыл бұрын
classic valve
@RoyaleNoir
3 жыл бұрын
Source does it by changing the perspective matrix to have an fov of 54, no funky quaternions involved
@DasAntiNaziBroetchen
3 жыл бұрын
I have no idea why you're mentioning quaternions. Quaternions are for rotations, not distortions. "A vec4's quaternions" wtf does that even mean?
@frostsoul4199
3 жыл бұрын
there's a game i've been playing recently that actually does FOV differently than most called Stalker Anomaly, where instead of your gun being rendered like in most other games, the weapon is instead considered a part of the HUD. and there's a second slider in the game that changes how close or how far it is from your face called the HUD FOV slider.
@colly6022
3 жыл бұрын
TF2 probably subtracts the main camera's projection matrix from a project matrix of whatever FOV the gun is supposed to render as, and then multiplies the vertices of the gun by the differential projection matrix. Originally I assumed TF2 just applies the intended FOV matrix to the mesh instead during rendering, but I'm pretty sure that would be hard to pull off without weird stretched reflections.
@RoyaleNoir
3 жыл бұрын
It's just swapping out the projection matrix / clearing the depth buffer between draw calls. Source's rendering system is still very much designed for fixed-function hardware where operations like that would be costly
@colly6022
3 жыл бұрын
@@RoyaleNoir oh huh, so i was more correct with my initial guess
@waaave564
3 жыл бұрын
i believe that in tf2, the game renders 2 separate models: world model, and viewmodel. your viewmodel looks much more different then your world model. they don't use two separate cameras or layers.
@daveface69
3 жыл бұрын
In Goldsource/Source-speak, viewmodel is the first person model, world model is the third person mesh. It doesn't relate to how the first person view model is rendered.
@garbaj
3 жыл бұрын
Yes, I’m aware. But how are you able to change the fov of the view model separately without a second camera?
@notalostnumber8660
3 жыл бұрын
@@daveface69 Fun fact, you can use console commands to use your world model in first person. It's most likely going to clip your head into your camera, but it sort of works and shows how others actually see you
@USSMariner
3 жыл бұрын
@@notalostnumber8660 In TF2, the implemented this to try to accommodate future VR support, but it also makes it easier to aim certain weapons like the Huntsman, as your perspective now accurately sees where the arrow is coming from in relation to your position, making arc estimates better.
@Orincaby
3 жыл бұрын
@@notalostnumber8660 oh shit don't tell the csgo players or they'll get OW banned
@Flonednb
3 жыл бұрын
Speaking of the TF2 FOV case: there are no such things as cameras in computer graphics. In order to draw something "from a camera view" we build a view matrix that will translate every object (specifically every vertex) from world space (your usual coordinate system) to view space and we do that in the vertex shader for each vertex. To handle FOVs we use a projection matrix. I'm not a professional graphics programmer (just a beginner) so I might be incorrect, but in order to have 2 FOVs (one for the world and one is for the gun/hands) you just have 2 projection matrices. First, draw world stuff, then disable depth test and draw gun/hands with the other projection matrix (that includes a different FOV). So, only one "camera", just different projection matrices. If we would again speak about the cameras then we might say that TF2 is using 2 different cameras (each having a different projection matrix). In my small engine, which I'm developing for educational purposes I only have 1 camera, you can't have multiple cameras, but you can always use another projection matrix in the vertex shader to handle this kind of stuff, so there you go: only one camera but different FOVs. :)
@garbaj
3 жыл бұрын
ah, that makes sense. I figured there was probably some semantics involved with the whole 1 camera vs 2 camera thing. Thanks for the insight!
@favkisnexerade
3 жыл бұрын
No such thing as matrix in computer graphics, its just 16 floats stored sequentially in RAM. What we do to create matrix is sending a uniform to GPU through PCI.
@sznio
3 жыл бұрын
2:24 I think you have to go beyond thinking with high-level abstractions like cameras. I'm not an shader whiz (never written one in my life), but this is how I think it could work 1. Render the world as usual 2. Swap the projection shader for one with a different FOV 3. Flush z-buffer 4. Render the gun with otherwise same procedures except the swapped shader.
@AlluringPegasu13
3 жыл бұрын
3:10 now how will i play games bruh
@theskiesahead795
3 жыл бұрын
I remember the days I would fight Saxton Hale as a demoman with 130 fov. I had grown use to have 1 meter long gapes between my arms and my body.
@alexandergronvall4036
3 жыл бұрын
2:40 My man really won a match of apex with a MOZAMBIQUE?
@garbaj
3 жыл бұрын
You better believe I did! ;)
@Orincaby
3 жыл бұрын
i cant even win with max shields and a maxed r-301
@StoreMilk
3 жыл бұрын
2:16 tf2 allows the arms to stretch in the 2nd camera because the view model is an actual model that other players can't see so when that view models fov is increased it stretches the model
@Evanz111
2 жыл бұрын
Dude, all of your videos consistently appear at the top of my recommended and I’m not even subbed (I’ll fix that now) - your SEO must be crazy impressive, and congratulations on the success! They’re always a delight to watch.
@yh_hat_trick491
3 жыл бұрын
The problem is that you're thinking of Cameras as actual objects when in reality they just describe how to transform the scene in the shader code. It's alot of complicated math but the camera holds a few transformation matrices that describe how to place objects in the world, their lense FOV, etc. At the end of the day it has to transform it from that world space into what I believe is clip space (although I may be mistaking it for NDC, Normalized Device Coordinates). Which is essentially what graphics API's like openGL work in. Your actual screen coordinates are represented from -1.0 to positive 1.0 on all 3 axis. This is what is actually put on screen.
@sourestcake
3 жыл бұрын
Yeah, clip space is correct. It's where things end up after the projection matrix and perspective division. I've only used OpenGL and Vulkan, so i don't know if DirectX has a different term for it.
@yh_hat_trick491
3 жыл бұрын
@@sourestcake nah it's the same concept there.
@maruf16khan
3 жыл бұрын
Hey Garbaj, don't forget me when you get famous 😭
@GamingStepByStep
3 жыл бұрын
Ah, I always wondered why my eyes hurt after a lot of gun gaming
@unfa00
3 жыл бұрын
Wouldn't a wall drop a shadow on the gun if you sticked it inside even if the model is drawn on top of all level geometry?
@HappyBeezerStudios
2 жыл бұрын
yes, the source engine has a separate viewmodel FOV. Which means that both TF2 and Apex Legends use it. TF2 allows to change the viewmodel fov, Apex doesn't.
@icarusgaming6269
3 жыл бұрын
Rendering the viewmodel separately is terrible for FOV customizers because it makes it impossible to change the FOV of everything at once. With the notable exception of Team Fortress 2, the viewmodel will always appear too big relative to everything else. The way first person games render their cameras warps *everything,* so there's not much point in trying to prevent it with certain objects Some games, like Modern Warfare (2019), have right eye dominant viewmodels, so the round comes from your right eye instead
@donutstudios6353
3 жыл бұрын
im making an fps rn that has a gun that clips through the walls, and my bullets do shoot out of my gun, not my eyes, but to prevent it from going through walls, i made the bullet generate at the very back of the gun.
@Ethereal6541
2 жыл бұрын
just dont do viewmodel fovs like tf2 and you should be fine with shooting through walls
@DRMJ22
3 жыл бұрын
Hey I know this is a month or so late but here’s everything I know about the tf2 cameras, tf2 has a lot of cameras, you see unlike other games tf2 guns aren’t cosmetic, you can do things like corner shooting, if you’re at a corner and you’re close enough to the wall of the corner you’ll see your gun go past that corner and you’ll be able to shoot throw that wall, that’s because your gun shoots a little bit from the right of your screen, of course if you use flipped gun view models then your gun will shoot a little bit from the left, however that only to non pyro and heavy guns and it also doesn’t apply to the “the original”. As far as I am aware there are more than two cameras, one of them is ofc the main player camera, the second camera wells it’s not only a camera but also an object in the game and it’s responsible for your gun ( it’s really hard for me to explain it ), the third camera is sorta combined with the first camera you see. The first camera is responsible for what your looking at while the third camera is responsible for what’s coming at you. You see this is required for the tf2 predictability software, you see tf2 has something that tries to predict your next movement ( apparently this makes the game smother, makes it require less space, and also easier for your pc and servers to handle ). In order for the software to do that it’ll need its own visual and audial capturing devices and you also use those devices. There’s also a camera that captures the things are approaching you and another for the things you’ll be approaching, I know a lot of cameras, but you see it’s required in tf2 because well spawn teammate outline give you a temporary camera. The only reason why I know soo many cameras exist is because I was told that by my friend who tried to make a wall hacking mod for projectiles, yes apparently even projectiles have their own camera but you don’t use that one, if you ask me that’s just a lot cameras , they’re using the same thing that was used in the matrix movies to capture bullet time, it’s a lot of cameras, what worse is that there’s even more, there’s the teammate spectate camera, and the map camera, so yeahhhhh A LOT OF CAMERAS
@Qwetzxl
3 жыл бұрын
Eyyyyy i clicked n exactly 4K views its so fracking clean Edit: caught at 4K ;)
@fab9207
3 жыл бұрын
"ignoring z depth" and "render priority" are pretty different lol
@coffee0093
3 жыл бұрын
I heard the special trick in team fortress 2 is there is an invisible pair of arms with the gun that float around the game world along with the player models, but they're only seen by the specific player or spectators
@bdgaminggr1697
2 жыл бұрын
If the gun is rendered in a different layer ex. Layer0 how does the rest of the scnene that exists in lets say Layer1 cast shadows on the gun thats on Layer0
@ABaumstumpf
3 жыл бұрын
For the first-person view to render independently from the normal
@unfa00
3 жыл бұрын
Wow, congrats on your hit! :)
@annaw.1951
3 жыл бұрын
You can render the gun model on top of everything without using a 2nd camera by clearing the Z buffer after rendering the scene, but before rendering the view model. Likewise, you can manipulate the FOV of the scene and the view model independently by clearing the Z buffer and then swapping out the view matrix. In my own projects, I use the same trick to render the skybox: it's actually a 1x1x1 cube around the camera, but I clear the depth buffer after rendering it, and so the rest of the scene simply gets drawn on top of it. This allows me to use the same layers for the skybox and view models, and in turn saves on graphics memory and only requires a single pass on the post-processing shaders. This also makes it much easier to keep the lighting seamless, as you've mentioned. You can drive this even further by doing multiple geometry rendering passes with different near and far Z clipping planes, clearing the Z buffer between each pass, to get a crazy high depth resolution. I'd be willing to bet that games that need very far render distances, such as flight simulators, employ this trick to render the world far away while still maintaining good detail up close. Of course, to do this sort of thing, you need direct access to the graphics library you're using (OpenGL in my case). If you're using a ready-made game engine like Unity, your options may be more limited.
@falxie_
3 жыл бұрын
I really like how Tarkov handles the gun clipping issue, I'd love to a technical explanation of how they do that
@beardphantom
2 жыл бұрын
You don’t necessarily need a secondary camera to render specific objects in a specific way. For example in Unity’s URP you can insert render object commands at any point in the render pipeline and override the camera settings for that object. Under the hood it’s just modifying the projection matrix for those objects. Before SRP the way to do this was command buffers. When you have a custom render pipeline or custom engine you can render anything however you’d like. Game cameras in general are nothing more conceptually than convenience objects used to set up a specific rendering state/projection matrices. You can always do that manually in other ways.
@TheTopMostDog
3 жыл бұрын
FWIW, ARMA fires the bullet from the chamber of the gun, or so I read. Actually, on that topic, how come in games like Battlefield 5, I can see over an object, and yet the bullets I fire hit the rock or windowsill below me? Do they also fire the bullets from the gun, but the gun is clipping into that object, and I can't see it because it's rendered on a separate layer? It is genuinely infuriating at times, especially when the game contains an peek mechanic which sometimes still allows this to happen.
@abk3042
2 жыл бұрын
I know GTAV isn't really an fps game but one weird case of the gun clipping and firing through walls exists in that game. For example, you can use guns with large barrels, mostly snipers, and aim while standing close to a thin surface. The front of the gun will normally clip through the surface and it even allows for the player to fire through the surface. Any ideas on that?
@MilesFox92
3 жыл бұрын
2:45 in GTA V and Online you can actually shoot through walls with long weapons (Sniper is the best) if you sprint into the wall and shoot at the right time. I think with Snipers you could also just stand right next to wall and be able to shoot through
@SharkFin.pppppppppppp
2 жыл бұрын
Coming from a Garry's mod player, the view model is a model projected in front of the camera, and they are spawnable within gmod actually. So when they want to stretch the viewmodel "fov", they just stretch the actual mesh instead to give the same effect.
@dampfwatze
3 жыл бұрын
Obviously, you aim and shoot, where you are looking and for that schooting from between your eyes, but I am curious, how they make it, that the visuals, like bullet path are coming from the gun model? Does anyone know that?
@thehumbleonion5280
3 жыл бұрын
you got big fat arms in tf2. like the model you see is huge
@Duriel181
2 жыл бұрын
You can do this with a single camera, by feeding the view models vertex shader it's own camera transform matrix with a different FOV.
@charlieforster5144
3 жыл бұрын
Ik this Is roblox, but I know a couple games on it where the bullet does actually come from the gun, because the cross hair doesn’t match up with where the bullet lands in close range and always lands where the gun it pointing, which is down and right
@erl3ndur124
3 жыл бұрын
You should try totally accurate battlegrounds it's a wonky physics based br where the guns are physicall objects that move on collison
@bluesides8323
2 жыл бұрын
Your video does have a lot cool information but how is any of this sneaky or the game lying to You? Just please stop clickbaiting.
@Kaizentry
2 жыл бұрын
I literally got called a hacker just because "I shot him through the wall!" and I'm like "It's just the head camera."
@KingOfMelos
3 жыл бұрын
Bullets coming out from the top of your character rather than the gun itself is why headglitching is so effective in a lot of fps games... Right?
@stig6339
Жыл бұрын
for tf 2 same approach was used for portal 2 viewmodel fov is controlled via shaders i have same thing done in unreal engine 4 when weapon has fixed fov different from the camera
@rimmertf
3 жыл бұрын
How do other people see you shooting out of your eyes when its coming out of a gun. Just curious? how would that function. ( here a free kinda related comment )
@BlooGoose
3 жыл бұрын
After i saw this video, i never see guns in video games as i used to...now the only thought in my head is how the heck do bullets come from my eye??
@redwastaken3363
3 жыл бұрын
About Apex, legends like gibby actually move at the same speed as everyone else but the effect applied to FOV while running and his animations are different enough to feel much slower. I think its interesting how they worked around movement breaking immersion without actually changing gameplay and I thought you might, too.
@garbaj
3 жыл бұрын
I hate how slow Gibby's animations feel. I've died way too many times because I couldn't tell if I was walking or running
@CapitandodleR
3 жыл бұрын
This whole channel really blew up in popularity these couple of weeks haha Always nice to see more gamedev videos like these.
@aung4506
3 жыл бұрын
Meanwhile TABS, just stick camera to the head!
@killrmgamer3402
3 жыл бұрын
Can you please make a video on how to make a local multiplayer mobile 3d in godot🙏🙏🙏.
@thenekokatze1141
3 жыл бұрын
Well there are game where the gun actually fires instead of your eyes, like in escape from tarkov where the bullet goes to the direction the barrel is facing
@dotcomgamingd5564
3 жыл бұрын
The warping of the weapon when the FOV is increased did actually occur in earlier games, such as QUAKE or DOOM 3
@lolzaziqoo6847
2 жыл бұрын
The way tabg works i quite intresting, the guns have collision with the walls and other stuff
@derpythean-comdoge8608
3 жыл бұрын
VR players: is this some kind of flat screen joke that I’m too immersed to understand?
@IXxKINGxXI
3 жыл бұрын
Yeah I liked that one, This one is why I subscribed.
@pi41ak18
3 жыл бұрын
This man is smart.
@Orincaby
3 жыл бұрын
this is literally on the unity wiki
@aeghf4711
2 жыл бұрын
First video comments: *Bean* This video: 1:51 *Bean w/ hands*
@Name_Pendingg
2 жыл бұрын
for the weapon fov you just increase the fov of the camera viewing the gun
@graealex
2 жыл бұрын
2:25 The problem is that there really isn't a camera. It's just a bunch of transformations, usually three matrices (world, view, projection) and you can easily switch them between objects. There is nothing preventing you from switching FOV (and/or clipping distance) at any point in time, even with a single "camera".
@randomcatdude
2 жыл бұрын
^^^^ thank you so much cameras in game engines are nothing but abstractions that generate 4x4 matrices that the vertex shaders use
@raajnivas6735
3 жыл бұрын
Can you explain how decals like bullet holes are made
@IanSharlowidalot
2 жыл бұрын
While I don't actually know, I would speculate that Valve is simply using a different projection matrix on the view model; it wouldn't require another camera, or at least a seperate render target. I suppose one could argue that the projection matrix is the camera? Meh. I suppose it could be applying a matrix seperately from the standard matricies, but it's the same idea. I assume this has an answer already somewhere, surely?
@randomcatdude
2 жыл бұрын
yes, this is essentially how it works. 'cameras' in game engines are mostly just abstractions for the projection and view matrices. although of course they're always more complex than that, having lots of other junk tacked on... makes this setup way more clunky in most engines than it has to be.
@Cold_Media
3 жыл бұрын
The worst sneaky trick FPS games use is skill-based match making, make it a separate "Ranked" playlist and leave casual play alone.
@KlausWulfenbach
3 жыл бұрын
I hate it when devs forget that a huge number of their customers play games to relax rather than compete. I've played FPS games since Wolfenstein 3D, and I've never played competitive.
@garbaj
3 жыл бұрын
I agree with you more than I disagree with you ;)
@scaryninjagamerboy
3 жыл бұрын
Oh that's cool
@dispenser996
3 жыл бұрын
I remember you made a video on switching weapons in Godot, and in your gun tutorials, you made the guns part of the player. I was wondering if you could make a video on making the gun its own object and firing a raycast that is part of the gun instead of the player's head. This would be good, because it would be easier to switch weapons. I didn't know how to ask this, so can you please make a tutorial on how to do it? (I don't mean to sound rude.)
@flaymes
3 жыл бұрын
11 views 22 comments. nice
@gamesgo6724
2 жыл бұрын
Damn i wish i could play apex at stable 60 fps. Gfn is a problem cuz it only gives you 30 minutes
@gamesgo6724
2 жыл бұрын
If i only had atleast gtx 1050 ti
@username12144
3 жыл бұрын
Cool, so in most shooter games we have laser eyes.
@manfred2375
3 жыл бұрын
The Viewmodel in Team Fortress 2 is right in front of the camera. When you switch the Fov of the Viewmodel it only gets further away from the camera. That also explains why you see the Viewmodel of other teammates. The real FOV can be changed seperatly from the Viewmodel FOV. Hope that helps.
@coregod109
3 жыл бұрын
In Source games like tf2 and csgo you can have a config for your viewmodel lots of players have custom commands set up to get it just the way they like its not modifying the fov its actually shifting and moving the models and to keep things from clipping the same trick is used where the viewmodel has the highest priority The freedom this gives players is ultimately the best option cause you can run 120 FOV and bring back the normal viewmodel with the right config so it looks like the standard or run 70 FOV with you gun a mile out in front of you
@KaletheQuick
3 жыл бұрын
With the two camera FOVs you can adjust the gun one so your gun looks nicer. I remember back in the days of Counter Strike modding people would make their guns scale up towards the front so they would look nicer. It's more noticeable on longer guns. Just another thing to tweak to dial your game in :)
@syborg64
3 жыл бұрын
wwhhhaaatttt Um I'm not an engine dev, I could be wrong. But having worked with the source engine and in particular made viewmodels, They aren't on a seperate layer ? They're just really tiny, such that they are never further than the player collision. You can EASILY prove this through noclip: stick your head in a wall and eventually the wall will clip the gun. Fov tricks can be achieved by scaling and translating the viewmodel according to pinhole camera distortion. Do credit me if you make an other one.
@garbaj
3 жыл бұрын
This is not true. This video shows that the tf2 viewmodels are huge and absolutely can clip into walls kzitem.info/news/bejne/o3epk6SecJ6ipHY&ab_channel=shounic
@syborg64
3 жыл бұрын
@@garbaj First of all, that video is not "proof" since the rendering is altered. it might be large in files, but then it's scaled down at render time. kzitem.info/news/bejne/laSQs2umkXSdjZw I have definite proof that Portal works as described. TF2 not currently installed but go ahead and test it for yourself.
@xegrand7548
3 жыл бұрын
Who's early ?
@DecrareOld
3 жыл бұрын
oh wow, you gained alot of subs
@johndoeuf9852
3 жыл бұрын
what's the game at 1:55 pls???
@Cbt707
3 жыл бұрын
In the other video what does it look like from another players pov
@garbaj
3 жыл бұрын
you'll see their gun clip into the wall unless the game takes measures to prevent it
@GothAlice
3 жыл бұрын
There's another approach for dual-FOV rendering: render certain visible polygons using different variables when calculating the camera "frustrum". 😄 Lines 142-154 of 3d.c in my own, hideously dated engine from 1997-which supported placeable spy cameras. (Ha! Beat CoD to that one! 💃) Multiplied into the matrix are sin() and cos() of: fov * 0.5 * 0.02454369261 Negative FOVs are a trip. (Bonus points for a magical constant.)
@spacer-lx5pq
3 жыл бұрын
Musica do saiko kkkkkk
@InvaderMEEN
3 жыл бұрын
One thing I also noticed is that a fair number of games have certain parts of the sights be another layer on top of the gun viewmodel. This is especially prevalent in games with EOTech sights (commonly referred to as holo sights). I remember one time Apex Legends' servers were so borked that when I would ADS, the viewmodel would move appropriately but the actual reticles, and even _parts of the iron sights_ wouldn't render, making it absurdly difficult to aim.
@Fezezen
Жыл бұрын
I suppose you could have a separate shader to render the gun, and supply it the same info as the main camera, but also give it some sort of secondary perspective matrix which multiplies with the camera's normal perspective matrix to get a "corrected" perspective. But I don't know if the math there works out.
@BigMikeClockwork
3 жыл бұрын
What about modern warfare 2019? It has two layer, I think. But the gun warps when the fov changes, so maybe it changes the fov in both layers?
@Artician
3 жыл бұрын
As a Fun Fact: Medic's Syringe Gun is the only gun in TF2 that actually fires the Visual Bullets from the View Models' gun, compared to Weapons like the Rocket Launcher, which only fires (technically renders) the Visual Rockets from the position that the View Models' gun is normally located at. Shounic also made a video on that if you want to know more.
@KalebSDay
2 жыл бұрын
You should make a video talking about the importance of horz and vertical hud adjustments for Ultra Wide Monitor support. Being able to see the key info in the center of the screen is essential, don't know how many newer games such as Apex and Fortnite don't support this, while Modern Warfare, Battlefield 4(--onwards) has both a Horz and Vert slider to fix this(in BF4 you can go to the user settings ini file and change the horz posistion of the hud even more that the in game slider allows if you need). Halo MCC has it to a degree by having a fixed "center" UI option to support UW, but it does the trick well enough. Luckily the next installment in the Halo series has a lot of adjustable UW support features from their recent video. Definitely should become industry standard.
@CathodeRayKobold
3 жыл бұрын
In source engine games like Team Fortress 2, the viewmodel is projected onto a plane directly in front of the camera. You can see this by noclipping very closely into some map geometry--the viewmodel plane will clip through the wall's geometry slightly before the main camera plane does.
@calebd3947
3 жыл бұрын
Speaking of TF2, there is a console command called 'cl_first_person_uses_world_model' which makes you view your world model in first person, obviously.
@catinmystomach
2 жыл бұрын
You are not Garbaj, you are Golden. I don't have much time for gaming, but I subscribed one channel giving publicity content rather than 'let's play'. Since the best members of the crew left and started their own channels the main one went down with the quality and I started looking for an alternative. And I got onto one videos of yours and started watching your videos sometimes. You do similar things: analysis, reflections and thoughts about it, and I decided to ditch that corporate lets-make-money channel in the sake of yours. I am working on making my own game as well and I find your comments are helpful. Thank you bro
@AlexTuduran
2 жыл бұрын
There's this thing called a vertex shader that is basically a function running on the gpu that's responsible of transforming each vertex of the model being rendered from model's local space to world space, to clip space etc. Between these transforms there's a transform called the projection transform and it's responsible for projecting a vertex (3d) on a 2d plane (your screen). To achieve that, the vertex is basically multiplied with a projection matrix that is build based on your frustum's properties (near / far field, fov). To render the object with the same camera, but with a different fov, all you have to do is making sure that your weapon's materials use shaders that implement custom vertex shaders that use a different projection matrix - one that is built on a different fov frustum. I suspect that's the "sneaky" that Valve is doing. Regardless, you can render two objects at different fovs if you take care of the projection matrix for each independently.
@RoyaleNoir
3 жыл бұрын
Best way I can describe it is that the game renders the world first, then changes the "camera" to have the viewmodel fov, and makes the viewmodels depth have a range 0-0.1, so that only *really* close stuff will clip through, before rendering the view model last. Keep in mind much of this code was written for hl2 in around 2001, for hardware that did not have programmable shaders. I'd link the code responsible in the public SDK, but links are generally blocked in comments.
@panmig
2 жыл бұрын
Could you explain how escape from tarkov makes its gunsmithing work? You can strip an ak so it just barely works, but how do you render that? Even the dynamics change every time you change the gun, like in real life. HOW?
@qreeves
3 жыл бұрын
As the developer of a FPS game, I'll shed some light here. What's going on most of the time isn't that there are two separate cameras or layers or "universes". There's usually only one render pass where most of this stuff is happening, but what happens is that prior to rendering the "avatar", we change the view and/or projection matrices. Changing the matrix and the render options for the model allows us to set a fixed FOV and change the Z-depth ordering compared to everything else. It's still actually there in the world along with everything else. In the game I develop, I actually have a penchant for "physicality", so everything is a projectile that comes from the gun muzzle. To make this work correctly, we project from the eyes down the muzzle to check if the space is obstructed.
Пікірлер: 887