I Have No Idea What's Going On Here

  Рет қаралды 475,721

Garbaj

Garbaj

Күн бұрын

Пікірлер: 1 200
@vagabond479
@vagabond479 2 жыл бұрын
Former Insurgency Sandstorm dev here who did a bit of optic work, how we solved the problems of optics perspective when not using PiP, was similar to how you suggested it worked, except instead of not rendering certain portions of the optic, we just scale down the forward axis so it's "flat". We also smoothly interpolated it so it didn't go flat immediately.
@okesik
@okesik 2 жыл бұрын
Yo ! You are everywhere, man :3 Just to add on this: This was how non-magnified optics were done (most notable on Aimpoint M4) in Sandstorm. For magnified optics, a stencil mask was used (done by Robin M back in the day), still have PTSD from testing all the glove cosmetic mats that had to be flagged each time lol. And a bonus point: These methods could not be combined so flippable magnified sights suffer from perspective driven rendering when the magnifier was flipped off to a side.
@BossKillRatio
@BossKillRatio 2 жыл бұрын
But.. what if another player sees ur gun being scaled down ?
@seto007
@seto007 2 жыл бұрын
@@BossKillRatio in the vast majority of games the first person weapon view is completely different from the third person renderings of seperate players. Pretty much the only game I can think of that's not like this is Tarkov, and I'm pretty sure Garbaj even made a video specifically talking about how this was the case in Insurgency.
@vagabond479
@vagabond479 2 жыл бұрын
@@BossKillRatio First person gun mesh and third person gun mesh are two different meshes.
@Khyrid
@Khyrid 2 жыл бұрын
I also noticed that you guys made the AI frequently instantly kill me specifically as opposed to other players. I suppose this was due to how well I did in coop in the first game, you guys wanted to ensure I didn't over dominate in coop.
@arkadyaaa
@arkadyaaa 2 жыл бұрын
For r6 siege atleast, if you go frame by frame you would notice the inside of the scope going transparent when transitioning to ADS. Around the frames of 1:04 and 1:05, you can see the full depth at the first frames when scoping in. Then when the screen zooms, the rest of the scope becomes transparent except the sides facing the character(with the 2 extrusion still being opaque and can be seen through the scope).
@donovanlay9835
@donovanlay9835 2 жыл бұрын
Good catch!
@groundedgaming
@groundedgaming 2 жыл бұрын
Yes! You can see the sides of the scope, but halfway, they just vanish! They definitely stop rendering the sides of the scope for the unobstructed view down the tube. Very observant!
@queueue_
@queueue_ 2 жыл бұрын
That was my first thought too, and would probably be the first thing I'd try when tasked with implementing this. It's very cool that you can see it in action here.
@garbaj
@garbaj 2 жыл бұрын
I hadn't noticed that, good eye!
@Dvance
@Dvance 2 жыл бұрын
I saw that too when I was going frame-by-frame at that timestamp, but when he showed the Apex ADS, there was no trickery that could be seen (as blatant as R6) in the scope. So I'm not sure about his question. Maybe it does the same thing, but cleaner? Not sure.
@cgron34
@cgron34 2 жыл бұрын
Never really thought about the depth of the scope, good point.
@ceasnov
@ceasnov 2 жыл бұрын
The inner walls could be transparent. Blender planes do this thing sometimes and they could use that along with a picture to simulate the appearance of the inner scope margins
@hoax5347
@hoax5347 2 жыл бұрын
its called flipped normals btw :)
@slugintub
@slugintub 2 жыл бұрын
No; if that were the case, the entire inner wall would be invisible. And in the games you can see the shortened inner walls. Do you know what you're sayin. or maybe you didn't word it correctly
@HateHater2205
@HateHater2205 2 жыл бұрын
@@slugintub I think he means the visible inner walls are an overlay not the actual scope but then it’s 3D and I think replacing the scope within a 3D overlay would result in some issues I’m just not very knowledgeable here so I don’t know
@ceasnov
@ceasnov 2 жыл бұрын
@@HateHater2205 this. also the scope overlay could be made invisible when not seen so you don't get into as many problems
@HateHater2205
@HateHater2205 2 жыл бұрын
@@ceasnov oh alright then I think you have the best explanation
@Warriorcat49
@Warriorcat49 2 жыл бұрын
Something to keep in mind is that only magnified optics should work this way. In non-magnified optics such as a red dot or holographic sight, you *should* be able to see the inside walls of the tube, because that's all it is. A tube with flat glass panes on either side.
@dominikbury2
@dominikbury2 2 жыл бұрын
true though 1x optics generally don't have tubes that long to notice them shrinking due to perspective much
@themilkman8554
@themilkman8554 2 жыл бұрын
When you use red dots and holos properly (With both eyes open) you don't actually see the sight housing or "tube." Games only show the optic housing for balancing reasons.
@superslimex7416
@superslimex7416 2 жыл бұрын
ive used a tube red dot before, videogames are over the top. It looks just like apex legends
@VORTENIAN
@VORTENIAN 2 жыл бұрын
And if the tube is long on a red dot it will still use 2 identical lenses inverted to eachother bending the light around the inside of the tube makeing it invisable to you and keeping the image the same size.
@Just-Steve
@Just-Steve 2 жыл бұрын
@@themilkman8554 I've never seen a game that uses binocular vision so...
@rancoroustomberry3398
@rancoroustomberry3398 2 жыл бұрын
Hey Garbaj ! This has been a mystery for me for quite a long time too, but recently I was able to reproduce this effect by using an almost orthographic camera for the weapon. Basically everything but the weapon is rendered on one camera, and the weapon/arms etc. are rendered on a different camera, which, when aiming down sights, interpolates its projection to a near-orthographic one. It's like an ~90% interpolation between perspective and orthographic, because fully orthographic didn't look good imo. Idk if that's what all these games are doing, but it definitely works for me. Anyways, nice video as always, cheers !
@marly1017
@marly1017 2 жыл бұрын
If you needed to use two cameras anyway games wouldnt warn you when switching to pic in pic mode
@alexusman
@alexusman 2 жыл бұрын
@@marly1017 no, rendering objects twice and rendering objects separately are completely different things.
@Frogge
@Frogge 2 жыл бұрын
@@marly1017 cameras and picture in picture are different, rendering on two cameras doesnt mean you have to render the entire scene twice, because each camera has different parts of the image on it
@unvergebeneid
@unvergebeneid 2 жыл бұрын
This very much sounds like the answer. Rendering the weapon in a different camera is done for other reasons as well, even though I don't quite remember what it was... 🤔
@unvergebeneid
@unvergebeneid 2 жыл бұрын
@@marly1017 what Froge said. PiP is slow because it renders the entire scene twice. This method renders nothing twice.
@ROBOHOLIC1
@ROBOHOLIC1 2 жыл бұрын
I am completely inept in coding. So all this info just goes over my head. I just watch because I like hearing your voice.
@ryanlikesally
@ryanlikesally 2 жыл бұрын
same here, glad i’m not the only one
@unvergebeneid
@unvergebeneid 2 жыл бұрын
Doesn't really have anything to do with coding but it's still very technical.
@reney9290
@reney9290 2 жыл бұрын
Kinda similar for me with Ahoy
@tangomango2353
@tangomango2353 2 жыл бұрын
Same bro
@tanybrachid
@tanybrachid 2 жыл бұрын
None of this was directly related to coding tho...?
@nabilurreshad5599
@nabilurreshad5599 2 жыл бұрын
I've worked on a few games where we've actually used a similar concept to get better looking magnified scopes. The concept is basically having two models for the scope; one that is the entire thing and one that is essentially cut in half in different places. The latter model is swapped in at a moment when player's can barely notice it and as the front half of it doesn't exist anymore it gives the effect of the far side being the same size as the closer side. In your clips I believe this is seen in R6S & PUBG, while I'm fairly certain that SQUAD also uses a similar concept; when ADS-ing you can see a moment where the scope sort of "flickers". They also employ a simulated "eye relief" look, where there seems to be a dark ring that moves around in the scope to simulate you looking outside the magnified lens. One thing to note however is that I don't think AL uses this system because you can clearly see the inner side of the scope. What I suspect is that since AL renders the gun on a different layer they might actually have the gun having a significantly lower FOV than your main render layer, making the difference in the openings seem less significant. As going lower and lower FOV gives you a "half-orthographic" view I would assume that's their method. Finally, I should mention I'm only a 3D artist and not a coder. While I am learning coding in university and I do understand coding concepts, I don't know the code that goes behind this. This is just my best educated guess based on different games that I've worked on. I hope that this explanation gives you a basic understanding at least of how this all works, and I'd be happy to answer any more questions you might have :D
@mrtaufner
@mrtaufner 2 жыл бұрын
came looking for this comment. I was about to comment the same
@scrums4748
@scrums4748 2 жыл бұрын
@@mrtaufner yeah me too
@gnolex86
@gnolex86 2 жыл бұрын
This might be surprisingly simple, you could just use the 3D scene rendered into a texture and re-render it on your first-person gun models. In Godot, you can access rendered screen with SCREEN_TEXTURE texture and SCREEN_UV texture coordinates in fragment shaders. You can write a custom shader that samples that texture and put that shader on the front lens so it appears as if you're looking though the scope. You can scale SCREEN_UV appropriately so that it samples from a smaller area and that way you get magnification, albeit with with blur. I suppose there are ways to fix the blur, for example by supersampling, but I have yet to experiment on that.
@traackmaniac
@traackmaniac 2 жыл бұрын
This is pretty much exactly what we did, albeit in Unity. We also make use of the stencil buffer to render a plane with a crosshair on it behind the scope to create a parallax effect for the crosshair when looking through the scope.
@GamePhysics
@GamePhysics 2 жыл бұрын
This effect is pretty easy to do using a render texture in Unity as well.
@DajesOfficial
@DajesOfficial 2 жыл бұрын
So this is basically described in the video PIP method
@luukderuijter1332
@luukderuijter1332 2 жыл бұрын
On the solution with making the tube shorter, no, you would never notice (if done correctly). I think it's actually a pretty good idea. Something else that could be the case has something to do with draw priority (if that's the correct word???). For example, if you clip inside a wall, you can see through the other side, that's because most games check if a polygon is facing you, and if it is, it is rendered, and if it isn't, it isn't, same with wether a polygon is obscured or not. This saves resources and is honestly not that expensive to implement. A gimmick you can introduce with this procedure is that certain objects can look bigger (or smaller if you'd really like) on the inside. When you look through the scope, a different scope model can be rendered that would realistically not fit as an inside of a scope, but due to forced perspective, you wouldn't be able to tell the difference. The inside scope could be slanted where the forward lens is bigger than the lens closest to your face, in such a way that it appears you are looking parallel to the walls of the tube.
@lilyofluck371
@lilyofluck371 2 жыл бұрын
This is what I thought too. Great minds think alike ^w^
@theonly5001
@theonly5001 2 жыл бұрын
These are called "Normals" as they are defined by the vectors vertically on the face of the polygons. Witch are called Normal Vector. And they define orientation and direction of the plane. And thus they are rather easy to implement. It is just a check wether or not you are more than 180° out of direction of the vector and thus look opposing to it. Then it will be rendered. This leads to 2 different scope models, where the only difference is the inner part of the scope. On one a cone with the tip on the camera. On the other a more or less straight Tube.
@luukderuijter1332
@luukderuijter1332 2 жыл бұрын
@@theonly5001 huh, never thought about normal vectors. Pretty obvious actually
@vibaj16
@vibaj16 2 жыл бұрын
@@theonly5001 I think it just hides the inner walls of the scope when you use it (go frame by frame from 1:04 to see the moment the game makes hides those faces). As for the slight perspective of the walls, maybe it only makes the walls transparent except for a sliver at the front
@theonly5001
@theonly5001 2 жыл бұрын
@@vibaj16 that is certainly a option. However you can do this option as well.
@bioburden
@bioburden 2 жыл бұрын
The answer: stencil shaders. They can be used to mask certain parts of the weapon & scope when ADS. Greetings from Ireland 🇮🇪
@lubbdaa
@lubbdaa 2 жыл бұрын
I was already wondering why nobody else mentioned it. Though, not the only possible answer, as a separate, smaller FOV for rendering only the gun also works sorta.
@bioburden
@bioburden 2 жыл бұрын
@@lubbdaa True, but for performance reasons, I certainly wouldn't recommend using the render texture approach on mobile devices.
@mastershooter64
@mastershooter64 2 жыл бұрын
Top of the morning to ya!
@bioburden
@bioburden 2 жыл бұрын
@@mastershooter64 We don't say that here 😂
@mastershooter64
@mastershooter64 2 жыл бұрын
@@bioburden _damnnn youuu jacksepticeye!!!_ lol is it really that uncommon in ireland? was it more common in the past?
@VRWarLab
@VRWarLab 2 жыл бұрын
Game dev here. -Some games just have 2 cameras, one of them renders the game, and the other renders the weapons of the user, so when you aim down sights, the camera that renders the weapons and arms of the character changes to cartographic while the other stays normal. I think you had visited before the 2 camera thing (not picture in picture but separated render for player body and environment) and talked about how the two could have a different FOV. -Others are using lerp between two meshes. When you start aiming, the front of the scope opens and becomes wider so that it has a conic shape instead of a cylindrical one (or whatever the scope's shape is) -Some games have chosen to throw in your face a flat sprite representing the whole gun with attachments and everything and zoom in without picture in picture (picture in picture/camera and render texture being the best possible way of making a scope)
@xanderkyron
@xanderkyron 2 жыл бұрын
There's another very common trick that is used to do picture in picture without performance hit, which is a neat shader that literally magnifies the image behind the lens without rendering another camera. It makes the image look worse as the zoom level increases, but for scopes up to like 4x zoom, the performance outweighs that for things like VR games.
@drsamuelhaydensecretgaming6749
@drsamuelhaydensecretgaming6749 2 жыл бұрын
Smort
@smittyghostey1955
@smittyghostey1955 2 жыл бұрын
Cones
@chanceappel6736
@chanceappel6736 2 жыл бұрын
This is exactly what I was gonna say lol
@MidnightSt
@MidnightSt 2 жыл бұрын
it's ORTHOgraphic, not cartographic =D but yeah
@denvera1g1
@denvera1g1 2 жыл бұрын
4:01 look at the transition from scoped to no scope, it looks like the inside material of the scope becomes transparent on the inside because as it transitions from the narrow to wide, you start to see the inside, of the outside wall of the scope. There is one frame where it looks like part of the tube has transitioned from transparent to opaque
@Phoen1x883
@Phoen1x883 2 жыл бұрын
Ironic for him to have put this clip over him saying "What am I missing?"
@LuLeBe
@LuLeBe 2 жыл бұрын
Yeah I think even the outside walls become mostly invisible when looked at from inside in this instance. So you can only see the scope from the outside, while it's transparent when looked at from inside.
@Kerosian1
@Kerosian1 2 жыл бұрын
A weird but very cool effect to see is semi-transperancy on scopes. When you use an optic in real life you have two eyes, and only one of those is recieving a zoomed in perspective. With both eyes open, you effectively can swap your focus between them, which has the effect of making your scope (the perimeter of it, not the zoomed image) essentially transparent. Stalker anomaly does a decent job of replicating this (as well as you can on a 2d screen)
@chrisakaschulbus4903
@chrisakaschulbus4903 2 жыл бұрын
I love how in VR this i basically just the nature of having two eyes. I didn't even know that some flat games have this (or a version similar to the effect)
@felineentity
@felineentity 2 жыл бұрын
My immediate thought was given that the weapon generally has it's own camera responsible for rendering it (so it doesn't clip through walls etc.), that all it does is widening the fov of that weapon cam, making it nearly orthographic. That's it. You don't actually need camera on the scope either, just take the image the main camera sees (since it can't see the weapon) and blow it up in the middle.
@mollikye6928
@mollikye6928 2 жыл бұрын
One of the best ways to achieve the effect is with a Stencil Mask. When you have your FP visuals rendered on their own layer, it's very easy to add a stencil mask in the scope to block anything on your FP layer from being rendered there. An added benefit to doing it this way instead of just hiding the back half of the scope mesh, is you also won't see anything through the scope that you shouldn't be able to see, such as the front of your gun, or your characters hands if the optic is really huge on screen. You'll only see the world through the scope. Plus, it means you don't have to build your meshes in a way that they can be partially toggled on / off.
@mollikye6928
@mollikye6928 2 жыл бұрын
I should add that with a stencil you can also do the opposite and make it so your scope reticle & effects are only visible through the lens of the scope. So you block your first person meshes from being seen through the lens, and allow your reticle to be seen through the lens simultaneously.
@mollikye6928
@mollikye6928 2 жыл бұрын
@Jordan Rodrigues culling the back faces doesn’t work for this. Scopes often have things on them like dials, as well as having a wider far end. Simply culling the back faces wouldn’t prevent you from seeing a bunch of the front faces further down the scope. Not to mention you would see the weapon itself through the scope. Using a stencil ensures you don’t see anything through the scope that you shouldn’t see, and doesn’t require manually toggling meshes on and off which creates visual pops.
@ayoubtouaty8255
@ayoubtouaty8255 2 жыл бұрын
Just a question.can i use stencil layers to separate the weapon mesh from the world and make it render above the world so i can avoid weapon clipping into the wall 🧱??
@-aid4084
@-aid4084 2 жыл бұрын
I feel like a scoped image should just render those pixels that are going to be visible scoped. But I believe the gun scopes are simply thinner at the close part that you poke you're character eye through, than the far end. So it isn't a tube, but rather a cone with 2 holes, smaller end closer to the camera.
@greatmagicianwungus6226
@greatmagicianwungus6226 2 жыл бұрын
It might be something closer to it rendering at area a bit bigger than the scope. If you only render an area the same size as the field of view the scope provides (pretty tiny), then unless your machine is super fast, you will get pop-in if you were to move too quickly. Speaking of pop-in, if your scope only renders the small field of view seen, how would you go about rendering a big model caught in the scope? Consider something like a large statue - if you scope it on it's head, you would have to render the whole model anyway. I think for these reasons it is quite complicated (and less practical) to design such a precise system for rending picture-in-picture scopes.
@nolife7483
@nolife7483 2 жыл бұрын
Some games, like Apex Legends use a separate model that swaps out when aiming. Older Call of Duty titles like infinite warfare and modern warfare remastered do this with magnified optics. Insurgency sandstorm uses a cull layer on the optic lens that removes the insides of magnified scopes when using the "Normal" scope setting.
@Critical_Hit
@Critical_Hit 2 жыл бұрын
When you wrote older Call of Duty I imagined you meant Call of Duty 4 or something, not games from 5 years ago
@Matt_History
@Matt_History 2 жыл бұрын
@@Critical_Hit modern warfare teamstered is CoD4... But yeah I feel you
@thebackupguy5414
@thebackupguy5414 2 жыл бұрын
In some older games like Call Of Duty: 4, the game completely took out everything apart from the area you can see with the scope, or they blurred it out which can be a very easy way of overcoming the problem.
@vnegar4045
@vnegar4045 2 жыл бұрын
I don't usually watch too many graphical-technical things like this, but it does interest me. Maybe its your cadence but i've watched two and genuinely enjoy and learn from this because it is clear that you are coming at it the same way we are: figuring it out as you go along and explaining to us the ins and outs so the layman and interested person could understand in depth. Subscribed.
@hedgeearthridge6807
@hedgeearthridge6807 2 жыл бұрын
I do know in my real closed-emitter 1x20mm red dot sights, like my Sig Romeo 5 and Bushnell TRS-25, you don't really see the inner walls of the sight. It's too short to really cause that effect, plus it helps to mount the sight as far forward on the AR's receiver as you can, so you get less vision obstruction. You mostly just see the back end of the sight's body. With games, you can totally just ignore it. For longer-tubed optics like an LPVO, it's a magnified sight that's just set to 1x zoom. So even though there's no magnification, you still don't see the inside of the tube. (The Trijicon MRO is a piece of garbage because of this effect going wrong, it screws with the focus of your eyes and it's actually slightly zoomed in, which distorts the image and looks wonky.)
@Snakelet
@Snakelet 2 жыл бұрын
Scope squashing up as it zooms in works really well. That's how we do it in the game we are making. Certain elements of the scope squash and flatten during the ADS. It is a bit of work, but is fairly convincing and works nicely. Benefit of using this technique is performance impact is minimal and you still get all the lighting and texture details showing on the scope body, even if it is squashed up.
@mattomanx77
@mattomanx77 2 жыл бұрын
4:01 - Increment the frames slowly as he's scoping in- you can _see_ the rendering turn off for the parts of the scope not facing the back.
@ryzelz
@ryzelz 2 жыл бұрын
Its really interesting how you make videos. Other game dev videos would just explain how they did it, whilst you explain the options and problems which gives me value even to the audiance even though you didn't kinda used it.
@ollyollie
@ollyollie 2 жыл бұрын
I'm a game dev with FPS experience (though we didn't use this approach). You could do it with two cameras. A Hip Camera which renders with perspective, and an ADS Camera renders only the optic in orthographic.
@jart83
@jart83 2 жыл бұрын
With the Vortex AMG UH-1 holographic sight, you don't get that tube effect. They accomplish this by making the objective lense larger than the optical lense. This makes the sight feel like a 2D plane instead of looking thru a tube.
@spacecat1194
@spacecat1194 2 жыл бұрын
It could be that Inside the scope it's shaped like an opening cone, as if you cut the bottom off an ice-cream cone and looked through it
@andersonrobotics5608
@andersonrobotics5608 2 жыл бұрын
This is only effective to an extent because at one point it starts affecting how the outside of the scope looks as well because you have to keep making it wider for longer scopes
@spacecat1194
@spacecat1194 2 жыл бұрын
@@andersonrobotics5608 well it could be that the front of the model de renders for the user and the cone may be alot steeper and not just a gradual expansion
@spacecat1194
@spacecat1194 2 жыл бұрын
@@capofantasma97 then I'm not sure it was just a guess
@marscaleb
@marscaleb 2 жыл бұрын
Usually the first person objects are being rendered separately from the rest of the screen. If they were not, then when you walk into a wall you'd see your weapon clip through the wall. So try walking into a wall, if the gun doesn't pass through the geometry, then the weapon is being rendered separately. With them being rendered separately, it is a small task to have the main camera change the FOV to zoom in while the gun's renderer instead warps to flatten out the image. also, if you are rendering the first person weapon separately it becomes easier to perform perspective and placement tricks so that a gun can be pointed a different way than you are actually aiming.
@ChristianCarlburg
@ChristianCarlburg 2 жыл бұрын
This is the answer
@Zagge
@Zagge 2 жыл бұрын
I think what's going on in Apex Legends is that the weapon viewmodel and the rest of the picture are rendered on separate cameras and the viewport camera is rendered on top of the other image. The two images and their field of view can be thus manipulated separately. When you aim down sights, the gameplay camera view is zoomed in a bit (FoV is made smaller) for the zoom effect and the scope effect is achieved by manipulating the fov of the viewport camera. It is zoomed in separately in order to get this flatter effect - kind of like changing the camera from perspective projection mode to isometric, but not quite. The point being that the more zoomed in the camera is, less perspective distortion is shown and thus the inside of the scope is not rendered. Honestly, I don't have any actual knowledge on this particular case and I have yet to test this theory in game engine, but this is what it looks like to me, it should be achievable technically without performance overhead and as far as I undestand, should result in something that we see here.
@purnabratakar7176
@purnabratakar7176 2 жыл бұрын
this is the most accurate solution for this problem, i use the same technique in my fps shooter game in Unity. this method is quite flexible and provides many options in terms of customizing the ADS View of the guns.
@Zagge
@Zagge 2 жыл бұрын
@@purnabratakar7176 Cool to hear that you've actually put this in to practice! Thanks for your insight!
@mrbojangles4155
@mrbojangles4155 2 жыл бұрын
The other BIG screw-up is that when using a red dot, you keep both eyes open and focus on the target (unlike when using iron sights). This effectively removes the entire red dot sight from your vision. Much like partially covering one eye with three fingers, your other eye fills in the blocked area. Red dot sights should appear as a faint, yet mostly transparent outline of the sight.
@mrbojangles4155
@mrbojangles4155 2 жыл бұрын
This is IRL. So one easy(?) fix would be to simply make the sight geometry transparent, and if anyone questions it you would know if they’ve ever shot a real gun before, and tell them to git gud scrub.
@malokegames
@malokegames 2 жыл бұрын
I think this is just a "side effect" of changing the camera's FOV itself... I noticed that when zooming too much the closer objects to the camera get significantly shorter, sometimes the FOV can even deform square tiles on the wall making them into rectangles, so I guess this is masking the scope's internal surface by distorting it shorter!!
@malokegames
@malokegames 2 жыл бұрын
@@Bluelightzero It doesn't change perspective lines, it just shrinks things along them in order to fit on screen, making them appear shorter. When I change camera's FOV in Unity I get this kind of "linear" distortion, it's not like the dolly zoom effect or fisheye that distorts around in circular patterns, that's why squares become rectangulars and not "circles".
@malokegames
@malokegames 2 жыл бұрын
@@Bluelightzero I replied before you edited it, but I still don't get you point though...
@malokegames
@malokegames 2 жыл бұрын
@@Bluelightzero If it was just effectively shrinking the image down, then the squares would still be squares, but they deform into a rectangle when changing the FOV. I don't know what is under the hood of these game engines, maybe we are not setting only or directly the FOV, but my point is that changing the FOV is creating some kind of distorsion that I guess is somehow hidding the internal borders of the scopes. I don't deal with it in my game because I'm using a separate camera for the scope.
@barj
@barj 2 жыл бұрын
If I'm not mistaken, apex still uses two camera's to render the gun and the environment separately to avoid clipping. If this is the case, then there's most likely a circular plane on the scope which is rendering a cut out portion of the environment camera to it (the size that the scope obscures). fun fact: this technique is also what Portals typically use to hide geometry that might fall between the second portals camera and the portal plane, Sebastian Lague covers this in his portal video. If they *don't* use two cameras, I'm clueless. I've never thought about the scope scaling thing but done right it would be unnoticeable, so you could be right there.
@DoorknobPlus
@DoorknobPlus 2 жыл бұрын
bargy
@Ibuildstuff832
@Ibuildstuff832 2 жыл бұрын
I think when you aim, the scope witches to 2 2d plaines on your screen with a hole in them that you look through. And since they're 2 2d plaines, you can simulate depth and perspective with them.
@SolaFideSolusChristus266
@SolaFideSolusChristus266 2 жыл бұрын
Yeah, thats likely. But they're affected by light! I've never seen a game or engine where UI elements can be affected by light in the scene
@Ibuildstuff832
@Ibuildstuff832 2 жыл бұрын
@@SolaFideSolusChristus266 The scope elements could be in-scene sprites instead of UI elements with yet another layer on top for light-simulations
@SolaFideSolusChristus266
@SolaFideSolusChristus266 2 жыл бұрын
@@Ibuildstuff832 True
@quenter1392
@quenter1392 2 жыл бұрын
I think they have a disk in the scope, like in the double camera system. However, it is a transparent disk. But it tells the rendering system to not render things in the gun which are behind it. I would expect that the disk is smoothly moved to the front of the sight when you de-scope, so that you get a smooth transition.
@thetankist1969
@thetankist1969 2 жыл бұрын
maybe the inside of the tube is cone shaped.
@Joel-pl6lh
@Joel-pl6lh 2 жыл бұрын
If you are far enough from the tube, you won't see the interior. I just tested it: Take a glass and put it parallel to your eyes. As it goes farther from you, it looks more like circle (at some point you don't see the interior, just the light at the end).
@codepeas
@codepeas 2 жыл бұрын
The inner moving scope parts when shooting in apex look like some kind of shader logic to me, I bet the front has a cut off shader or a cut off model and the inner part is just shader magic. It might also be possible to offset pixels to the front with shaders if I'm not mistaken.
@RyoZixon
@RyoZixon 2 жыл бұрын
For Apex specifically there is a LOD for the scopes when aimed down sight that does "delete" part of the mesh to make the scope a little clearer. Though the part that remains is more than just the back ring of the scope, helping to provide the proper "perspective". Occasionally you can see the scope in apex de-render as you aim down sights which is how I stumbled across that specific information. It's an odd way of handling it but it does work.
@Hillykarma
@Hillykarma 2 жыл бұрын
As someone who's been a shooter for 2/3 of his life, I can say videogame optics drive me insane on the regular
@Thoroughly_Wet
@Thoroughly_Wet 2 жыл бұрын
Some games they use textures that are viewable only in one direction, so from the outside you see the scope but when you zoom in the inside textures are invisible/see through
@PsychoPath89
@PsychoPath89 2 жыл бұрын
What came to my mind (but is probably not the way anyone would do it), is that the diameter of the farther end of the scope increases, so it aligns with the new vision cone. But that seems super costly maybe not to implement but to build robustly
@ouagagamer3798
@ouagagamer3798 2 жыл бұрын
They may just not render the inner wall of the scope so your vision just goes through it
@darth_dan8886
@darth_dan8886 2 жыл бұрын
I've definitely seen some games introduce "cut off" planes when looking down the scope; mesh swap isn't uncommon either. Also, this might depend heavily on the renderer, but it should be possible in at least some to draw the scope image "focused at infinity" and thus make the walls parallel from the perspective of the player (kind of make it appear very far, but not alter the scale as you would normally do with perspective)
@TheCCBoi
@TheCCBoi 2 жыл бұрын
ADS works by making the ortho-graphic bi-lateral plane field trans-nodes renderer elves bend space time and compress the tri-angeloid vector expressions to make ADS sights zoom in. It’s that simple my dude!
@ASBDGaming
@ASBDGaming 2 жыл бұрын
Lmao
@z𠄢
@z𠄢 2 жыл бұрын
Agreed
@noklle2844
@noklle2844 2 жыл бұрын
I've noticed at least that in COD:MWR, the sniper scopes render an entirely different model which consists of mainly the rear ring of the scope, with some of the receiver and the adjustment dials also included. This is easily seen by entering the firing range, reloading, exiting right as you do and then re-entering the firing range and scoping in immediately
@konkranis
@konkranis 2 жыл бұрын
bydgoszcz
@ruszki2501
@ruszki2501 2 жыл бұрын
+1
@lostriches4372
@lostriches4372 2 жыл бұрын
I've had this idea floating around my head for awhile, and it's this concept where you aim down your sight and all your surroundings all turn to black to better focus your aim essentially. You can see this machanic in CS:GO and TF2 and few other games I can't think of rights now, but this mechanic is mainly used for snipers.
@Poldovico
@Poldovico 2 жыл бұрын
That used to be the only way to do snipers on older games. Just zoom in the whole game and put a big black overlay so you could only see a circle. I remember being blown away by Crysis because I could aim down a telescopic sight and still have peripheral vision.
@mzmknight
@mzmknight 2 жыл бұрын
I have no idea how I'm 1st
@ributoshithedragon9647
@ributoshithedragon9647 2 жыл бұрын
what makes no sense is that I’m second
@mzmknight
@mzmknight 2 жыл бұрын
@@ributoshithedragon9647 lol 🤣
@HAWXLEADER
@HAWXLEADER 2 жыл бұрын
@Garbaj In Apex you can clearly see the camera changing focal length. (hence why the scope appears to shrink in length). You can see it in 2:44 where the part above the scope isn't visible (obscured) and then it suddenly transitions to becoming visible. Basically, The weapon camera zooms in and then zooms out while transitioning to a lower field of view (increasing focal length). You can search for the vertigo effect (dolly zoom). R6 simply makes the interior gone so that you can see through the backface culled outside.
@GenesisAria
@GenesisAria 2 жыл бұрын
In some cases they just would use a depth cutout mask _(depth written invisible material at the same or lower render queue/order to cut out what's behind it, this is fiddly),_ or perhaps a stencil. I've made various scopes/optics in unity for vr. I always prefer the camera method, though optimally would be to build some kind of localized supersample & upscale method (extremely advanced) so you don't have to double render everything _(well sort of, in a lot of cases optimization methods by engines like unity and unreal should be able to instance things and re-render them in the other camera in the same pass preventing significant overhead)._
@GuruEvi
@GuruEvi 2 жыл бұрын
From an optical perspective, if you look down a scope, you don’t see the walls (you only do if the lens is not mounted in the right position for you which shows up as a black spot in your image), this is why there is a lens at the front and at the back, the lenses basically optically cut out the entire barrel of the scope and put your eyes’ natural focal point down range. In ascii art, this is what light does in a proper scope: >
@darcksnow59
@darcksnow59 2 жыл бұрын
One technique used for many games ils that all the character arms and weapons are rendered on a different layer, and then, added on top of the screen, kind of like the User Interface. Doing this allow you to change the camera perspective only for the character and weapons. So you can switch to a less perspective view for the weapons and ajust the player view at the same time but with less déformation. The 2 layer thing is also really usefull when you look at a wall and don't want your weapon to go through It.
@PHO3LIX
@PHO3LIX 2 жыл бұрын
The way this is usually handled is having a separate FOV for the first person model. Either with a second camera rendering only the first person models on top of everthing else, or with a custom shader dealing with that (also helps with clipping through geometry). Then, when aiming down sights, the FOV for the first person model viewport is being changed drastically so that it (almost) appears to be orthographic.
@Grimreaper368
@Grimreaper368 2 жыл бұрын
The method you are looking for is a combination of things you noticed and another technique. You still zoom in/lower the FOV to get a better picture but to get that clear cutout image you also use a flat piece of Geo in the scope. Actually two of them with two different shaders. One to cut out the scope with a shader using Stencil buffer. The other to re-render what's behind that cutout with a scene_texture projection onto the other Geo. Then you enable/disable those mesh objects when you aim and go to hip. scene_texture Renders what's behind an object on the screen so that's why the cutout is necessary to clear the area it will render. Depending on how the renderer works and if you want to do other effects like blurring the background and keeping the scope area clear, you might have to use a separate render layer for the scopes/optics and the inner meshes as well. This is why if you look at those games when they aim in slow motion you can see when those mesh pieces get activated and deactivated. Someone pointed out the timestamps for R6: Siege clips but the game you can see this the clearest in is Warzone with the sniper scopes. Also since the scene_texture shader call is actually rendering to the same amount of pixels on your screen you can't zoom in inside the shader or else it will be pixelated. This is why you have to change the camera's FOV to get your zoom amount. This is how you can tell which method is picture in picture and which is the stencil buffer cutout/Scene_Texture method in different games.
@emperorsascharoni9577
@emperorsascharoni9577 2 жыл бұрын
3:42 Love how it shows the black part when shooting. With your simple method the scope always works different from real life where you only see well when looking from the right spot.
@theXeNoNxX
@theXeNoNxX 2 жыл бұрын
what game is the one u tagged?
@emperorsascharoni9577
@emperorsascharoni9577 2 жыл бұрын
@@theXeNoNxX I dont know. Based on the map it might be pubg. Havent played for a while though.
@lewis424
@lewis424 2 жыл бұрын
Insurgency sandstorm shrinks the model when aiming down unmagnified optics. You can see this most clearly when comparing the 1x and 2x red dot(unmagnified) where (when aiming) the unmagnified 2x red dot looks like you are looking through a toilet tube, whereas the 1x has a very nice field of view when aiming. This is due to the fact that the force perspective would not work on the 2x unmagnified optic. I'm not sure if this bug still exists but if you aim down sights with a 1x red dot and then push your rifle against a wall (so that your character points the gun upwards to avoid colliding with the wall) you can visibly see the deformed optic where the mesh has been shrunk.
@JupiterMaroon
@JupiterMaroon 2 жыл бұрын
My guess: The gun and player arms are rendered using a different camera than the first person perspective camera. When aiming, the camera rendering the gun gets a very very small FOV with the camera pulled back to compensate, while the main camera view FOV is only modified to match the scope.
@tbotalpha8133
@tbotalpha8133 2 жыл бұрын
I would make a screen partway down the scope, similar to the picture-in-picture solution. On that screen, I would apply some kind of shader that could warp or distort the geometry of the gun model behind the screen, but not anything else. Perhaps some kind of fish-eye-lens effect would work. I would include some kind of variable to change the refraction level of said shader, and tie that variable to the state the gun is in. If the player isn't using the sight, 0% refraction. If the player is using the scope, 100% refraction. Add a lerp between 0 and 100%, as the player moves the scope in front of their face, and back again. This would allow the inside of the scope to be visible when not in use, but shrink back when it is in use.
@Xaymar
@Xaymar 2 жыл бұрын
There's a number of ways to get this to work: 1. Weapon and World are rendered separately, allowing the weapon to simply read from the texture containing the world and display it on the "lens". It's basically PIP, but only the gun has the extra cost attached. 2. In Deferred rendering with separate Z, you have the lens output an infinite depth as a solid/masked object in ADS mode. As the depth is behind what was previously on screen, you now have just the world where the lens used to be. Both of these date back to around 2012, and have been in use in some ways as far back as DirectX7.
@ABaumstumpf
@ABaumstumpf 2 жыл бұрын
There are many ways of doing it, but in general, as others have pointed out, you just turn of backface-rendering when looking through the scope. That is a rather simple trick. Also for picture-in-picture there are many ways to achieve that, and it does not need to have a large impact on performance either. Dx12 with render-passes allows the GPU to efficiently render 2 slightly different perspectives at once. With a Stencil you cut out the part that the scope is occupying and render that separately. There is also the option to just render everything "normally" and just stretch the image in the scope-area (dirt cheap, but a bit blurry - might want to use some sharpening there). And then there is trickery like using VRS and rendering the entire image with lower shading-rate but higher resolution and downscaling it (sadly MultiRes is not standard yet).
@batman3698
@batman3698 2 жыл бұрын
I think a key aspect of it is that the weapon isn't drawn in the same render layer as the rest of the scene. What I think happens is the scene layer zooms in alot. Perhaps so much that the weapon itself would no longer fit on the screen. The camera is then also pulled back only in the weapons render layer to basically shrink the weapons screen size. The effect is that you get a much more ortogonal projection which makes the front and back of the scope more similar in size. Without blowing the weapon way out of proportion on the screen.
@ZenLeaf
@ZenLeaf 2 жыл бұрын
I guess it's exactly like the method you've described for the picture in picture aim mode, but using the player view as render texture instead of relying on a second camera mounted on the scope. The game has to render the pixels regardless, and those games already render guns on a separate layer so it's easy to render the screen view without the weapon layer. Then just save it to a virtual texture and slap it on the scope
@dankelpuff8381
@dankelpuff8381 2 жыл бұрын
Blender has a feature where you can force the view of a model to be orthographic. Maybe they are somehow switching the scope models rendering to orthographic.
@lethaldumpster2699
@lethaldumpster2699 2 жыл бұрын
I use shader projection in my games. Basically, using world position offset on vertices to achieve not only orthographic perspective on the gun, but to give the gun its entire own local fov. I then use pixel shader offsets to keep the guns from sticking through walls, but still exist physically infront of the players camera.
@turgaysenlet
@turgaysenlet 2 жыл бұрын
My guess is a combination of the factors you explained, plus a different perspective. The perspective of the game is based on a regular FOV, e.g. 60-100 degrees. However the perspective of the scope (actually the whole zoomed in scene in this case) has a much smaller FOV, e.g. 5-10 degrees. Since orthographic projection (no distortion) is equivalent to zero degrees FOV, a smaller degree FOV will have less perspective effects. One example for this is the very zoomed in cameras used in sports events like soccer, you can see different players at almost the same size even though they are very far from each other. Same thing is (could be) happening here. If you zoom using a different FOV angle in your camera, you would reduce your perspective effects (difference in size for objects at different distances). But as I said, probably other factors play a part here too. Probably each game tries the zoom, and plays with the scope model, clipping distances and maybe other factors if they see too much of the scope while testing things. Also you treat the scopes as perfect cylinders, why can't they slightly be cones opening up as they go? Thanks for the interesting videos, having fun watching them :)
@ricciillmatic5352
@ricciillmatic5352 2 жыл бұрын
I also came across this problem, but one way that I think should work would be to move the camera far inside the scape just so you see a piece of the scope, downside is that you won't see the actual gun or the outside unzoomed view
@Hamentsios10
@Hamentsios10 2 жыл бұрын
When you talked about your first thought being rendering out the inner side of the scope, that was exactly my same though as well. Although I have no idea what they do either lol
@milkybiskit9215
@milkybiskit9215 2 жыл бұрын
My solution to this would be having two cameras (one for everything except the gun, and the other rendering just the gun) as you said in the video on how to get rid of weapon clipping. In that way, you can lower the fov on the main camera and give the weapon camera an ortographic perspective (or you could just also lower the fov until you don't see the end of the scope). Love your vids btw :D
@powerdude_dk
@powerdude_dk 2 жыл бұрын
@Garbaj, I'm not sure, but it COULD be that the scopes circumference slightly increases outwards, to compensate for perspective. Just as real scopes has a bigger circumference in the opposite end of where you put your eye.
@matvampir0_
@matvampir0_ 2 жыл бұрын
This doesn't answer the question, but it might be interesting. In some Arma 3 mods for example (ACE for example), the PIP does it in reverse, it uses this secondary image to project it outside the scope, in less resolution, blurry and maybe a little darker (that's why the resolution is not so important in that case and performance is not sacrificed as much) and through the scope you see the original camera with more magnification.
@Arlios
@Arlios 2 жыл бұрын
There's an illusion happening and it's clever. As the player is scoping in, the texture on the inside of the view-model shrinks at a fixed rate that is synced with the player bringing the gun to their face.
@MadJack38
@MadJack38 2 жыл бұрын
I'd guess (and how I would implement it), would be to setup the weapon model FOV and the player camera FOV so they can be individually controlled. You can do this with layered rendering in Unity, world position offset in Unreal, and no idea for Godot. As you ADS, crank down the FOV on the weapon model while moving the gun far away. This flattens out the perspective so you won't see the inner side of the tube.
@Duriel181
@Duriel181 2 жыл бұрын
The Scope VIew in the supermajority of games is a second rendered view. There is no "magnification" per se, and in some games, the second camera is physically moved forwards. In any case. By replacing the first "lense" in your optics with the output from a camera at the end of the optics. You get that tight ring unaffected by perspective warping.
@gabrieldecarvalho8189
@gabrieldecarvalho8189 2 жыл бұрын
You forgot about the 3rd and cheapest way ever: CS 1.6 style, where you zoom in and put an overlay on top of you screen and stop rendering the gun... Or even the Black Mesa crowbar "sprite scope" that is not only cheap af as it looks awful. Anyway, ways that scope you showed could be done: almost orthographic camera rendering the gun; stop rendering the part of the interior of the tube and maybe add some flat surface with a paralax effect; refracting material shader (it might be possible, and maybe cheaper than Pic in Pic, depending on the engine you're using); and maybe changing the FOV of the viewmodel when you're aiming downsights. Also this is also a tricky thing: using pic in pic, you can make the scope camera with a slightly smaller FOV, so you zoom and looses some perspective feelings, getting an almost flat 2D image (like real-life scopes). Add this with some vignette and some dirty decals and call it Realism.
@polar1991
@polar1991 2 жыл бұрын
They could be using a picture in picture scope and not lowering the fov. In call of duty modern warfare what they do is use a picture in picture scope and when the scope is pulled to the side or away from the camera, the texture of the picture in picture overlays black so when the player goes out of ads or when the weapon sways it looks more realistic. They also lower both the fov of both main camera and scope camera a bit which makes the nicest effect in my opinion. They also use a parallax effect for the reticle in the middle which adds even more realism.
@ersia87
@ersia87 2 жыл бұрын
I saw you posted the solution to this in another video. Pulling the camera back and narrowing the field of view to effectively reach perspectiveless territory. Great work!
@DaGuppy
@DaGuppy 2 жыл бұрын
I think they widen the front of the scope so its like a funnel and thats why you only see a bit of it
@ivyy8221
@ivyy8221 2 жыл бұрын
Playing Insurgency Sandstorm and while espectating (waiting for respawn), I found a guy aiming a rifle with a red dot sight who went too close to a wall, so weapon made the animation as holding the rifle up and I saw the red dot sight were shortened and looked warped, so I guess at least the technique used on Insurgency Sandstorm is warping the optics (I don't use picture in picture because of the performance lose).
@CrtngSomethings
@CrtngSomethings 2 жыл бұрын
I remember that in old Call of Duty and Battlefield games, the scope for sniper rifles was literally just a PNG picture overlaying a zoomed in camera, making the entire gun transparent after the end of the ADS animation. In this case, there could be that the sides of the scope become invisible while enabling visibility to other geometry that wasn't displayed before the ADS.
@muffemod
@muffemod 2 жыл бұрын
IRL scopes are tapered so that front lens is larger than the back (viewing) lens, thus minimizing the tunnel effect. They're not uniform diameter from front to back.
@TheNickazza
@TheNickazza 2 жыл бұрын
You should check out Red Orchestra 2. Thats the first game that i can remember that had picture in picture scopes and they also have a LOT of "scope disctortion" where you see the insides of the scope when moving around fast. The guns and everything about that game is (IMO) pretty ahead of its time. One of the first multiplayer games that i can remember that keep magazines (empty, full or partially full), keeps chambered round in mind, ricochet, and had a very interesting leaning/cover system. I also remember their infantry VS Tank system being super interesting with realistic weak points and such. HIGHLY Recommend you check it out for your research. IMO its still one of the best multiplayer shooter games ever made and i still come back to it 11 years later and its definitively ahead of its time.
@lunarveggie
@lunarveggie 2 жыл бұрын
Considering that the game renders the gun and the screen/world in different layers, meaning the world behind the gun is also always rendered anyway. it could just be the game projecting the normal rendered scene onto the scope. and the little moving end of the scope could be a cut version since it wouldn't be distinguishable, so in short, and shorter looking tube of the barrel added with a mask or overlay of the normal rendered scene. alternatively, it could just spawn a copy of the other end of the scope that CAN be rendered by the normal scene renderer, so it can be a pure projection with a spawned object mimicing the end of the scope
@andre.drezus
@andre.drezus 5 ай бұрын
That’s really easy to explain; first person weapon models are almost always rendered in a separate overlay camera, specially because it solves the problem of having them digging through walls. In that context, you can freely adjust the overlay camera's field of view to be almost orthogonal regardless of the main camera's perspective, which would make anything the player is holding look shallow and depthless like they do when aiming down sights.
@dixie_rekd9601
@dixie_rekd9601 2 жыл бұрын
one way to do it is to use clipping planes for the scope, an invisible plane which will limit what parts of the scope are rendered only for that single object, if its set up right you can also hide the front end of the gun when its seen through the same plane.
@lokamigauti
@lokamigauti 2 жыл бұрын
The camera don't come closer to the scope, but magnify it. Therefore the tube became less apparent. It is clear in every game presented. You can try it taking a picture of a tube from afar and zooming it, and compare it with a picture took near the tube. Apart from that, @arkadya already pointed out the R6 thing.
@mikejustcant8240
@mikejustcant8240 2 жыл бұрын
I’m always fascinated by your content, good stuff! Also, I remember you mentioning that some fps games render the view model separately from the environment, so I think the way games like apex overcome this problem is to decrease the FOV of the view model heavily while having the view model set further in front of you. as objects are further away from the camera, they appear more orthographic.
@JizzyDipper
@JizzyDipper 2 жыл бұрын
Gun layer rendered seperately to the 3rd person player model. Camera on gun moves back significantly and over to center and most importantly narrows the FOV as much as possible
@KCrouch-t2o
@KCrouch-t2o 2 жыл бұрын
it could be rendered as if it's focused at infinity
@JonathanKrysse
@JonathanKrysse 2 жыл бұрын
in many shooter games, they make a global render who everyone sees, but they make a local render that is separated from the model and displayed only for the main player, so when looking at the HUD and everything, you are seeing a bunch of "sprays" that give the look of 3D, so when you aim they stop rendering the gun and then transitions to use a separated spray of the sight that you are using, it's a world illumination-interactive png of a fake sight
@stormolflak
@stormolflak Жыл бұрын
2:57 Since the weapon is rendering in a different layer, in that layer, when aiming, the camera could be placed very far back while having a really small fov, this way, the scope will look a lot orthograohic than being close to it with a high fov, and since it is in a different layer, this fov stretching thing doesn't affect the world environment.
@QuantumShenna
@QuantumShenna 2 жыл бұрын
One thing to note about many first person shooters is that the hands/gun are actually rendered separately from the game world, in an entirely different scene. I think what Apex is doing here is actually rendering 3 different cameras all on top of each other, one for the inside of the scope, one for the rest of the scope/gun/hands, and one for the world, and the inside of the scope, specifically, is smoothly transitioning from normal perspective to near-orthographic as you zoom in. One thing most games get wrong about PiP scopes is that the orientation of the camera coming out of the scope should depend somewhat on which direction the viewing texture is being viewed from. Basically, if you're looking at the lens of-axis, you should just see the inside of the scope, and the crosshair should only be in the direct center of the image if your main camera is directly in line with the scope. If you have VR, the best demonstration of this is comparing how Pavlov and Onward do scopes. In Pavlov, the scopes are done correctly; viewing angles into the scope are distorted but ultimately maintained. While this means the scope is more realistic, in VR it has direct gameplay implications; you can use the magnified scopes in Pavlov as Occluded Eye sights, where by firing from a magnified optic with both eyes open, you can effectively use the sight as a 1x optic. In Onward, meanwhile, the camera used to create the scope texture is always pointing directly along the axis of the scope, which means that, while it's possible to fire around corners using magnified optics, they can't be used as occluded eye sights.
@CharlesVanNoland
@CharlesVanNoland 2 жыл бұрын
At first I thought that maybe they just made the front of the tube sights the exact size for the zoom FOV so that it lines up with the far end of the sight tube. After watching some frames - they're just using a specific separate black tube model for the inside of the sight when you're not aiming w/ sights and when you do aim via sights it just stops rendering that black tube model. Being that virtually all games render with backface culling enabled this means that you won't see the outside of the sight geometry when it's positioned infront of the camera as such. The viewweap model just doesn't have any geometry for the inside of the sight - it just puts an inward-facing black tube in there for when you're not aiming so it doesn't look all messed up from the backface culling.
@orange451
@orange451 2 жыл бұрын
I solved this in a game of mine by going with the multiple scope model route. When the player zooms I swap out the scope model to one that is more visually pleasing to look through. I had a technical limitation where I could not use a secondary camera to render the gun with a different projection. Worked quite well though. Users cant tell.
@KatDiedAgain
@KatDiedAgain 2 жыл бұрын
The way I've done scopes previously uses parallax occlusion mapping and a mask to create that realistic depth inside the scope, while actually masking out any part of the viewmodel or the inside of the scope when seen through the ocular lens. Then, I just zoom the whole screen in, because that doesn't feel as sickening as having that secondary movement inside the scope. The mask sits just beyond the depth plane. From near to far, inside the scope model: Eyepiece -> parallax/depth plane that adds the reticle, eye relief shaders, and the black circle -> circular plane mask that hides any of the inside of the scope beyond this point -> the rest of the scope This, I think, is a pretty well rounded way to get stylized realism for optics in video games. For Apex, it looks like the weapon FOV is actually narrowed to much that the whole weapon appears flatter. This makes the far side of the scope tube appear to be a similar size to the front end. The weapon would have to be pushed way far away, too. That's what it looks like to me - the weapon is super far away, but the weapon camera (which renders the weapon separately on the screen) is just zoomed in super far. I work with blender and camera focal lengths a lot, so I'm pretty sure that's what we're seeing. I'm pretty hyperfixated on gunsights, it's one of my things, and this topic is totally up my alley!
@KatDiedAgain
@KatDiedAgain 2 жыл бұрын
Rainbow 6 looks like it's straight up deleting the inside of the scope when you aim, but it could just be spawning a mask inside it when you right click. I'm not sure, but I'm definitely seeing that sudden disappearance of the blackness in there.
@Tinkerer_Red
@Tinkerer_Red 2 жыл бұрын
I actually commented something similar to this on your video about weapons against walls and how tf2's weapons dont clip into walls. But it's related to the 4th vector of 3d models, it is very similar to squishing the mesh but when used in a creative way you are able to squish the mesh relative to the camera, so the object is still able to have depth, but also be orthographic. What's happening is as the gun moves from a side position to the center of focus the render vectors are being changed slowly to bleed into an orthographic view, in the case of apex legends it appears as though they are doing this just shy so it still keeps some actual depth to it so you can see the end of the scope. To be clear this is not something I am very experienced with. Although I believe if you speak with Randy, a fellow youtube game creator He would have more info on the matter as this is where i first learned about it from his videos about building a renderer for his game. Hope this helped.
@edzact_ly
@edzact_ly 2 жыл бұрын
I believe the way Apex optics work is that it just makes the backfaces invisible. It looks pretty similar to Squad's optics where it hides the insides of the optics, but the zoom is just an increased FOV instead of a picture-in-picture. Another interesting thing that long-ranged optics have on Squad is that if you use the freelook key to look to the side while ADS'ing the scope, the scope picture shifts the further you look away until you can't see through the scope anymore. It's due to the parallax effect which is what also happens in real life scopes. You have to be directly looking through the scope to see through it.
@cddevelopment363
@cddevelopment363 2 жыл бұрын
As an FPS developer, with lots of experience on this issue I can say you got it mostly right at 3:04 There are two versions of the weapon model, one for ADS and one for hipfire. The ADS version is a separate 3D model that mixes forced perspective + the back face of most of the polygons. That's why the front of the scope looks visible, there's still some polygons representing the front. They are just smaller and closer to the player's camera while ADS. I'd highly recommend looking at some of the 3D game files for Black Ops 3, which are easily accessible. They use the same method.
@Mart-E12
@Mart-E12 2 жыл бұрын
Lowering the fov also helps a lot with the scope walls being visible from inside, just like you can see how in Apex it gets lowered a lot Also orthographic projection is basically just fov at 0°
@CharlesVanNoland
@CharlesVanNoland 2 жыл бұрын
Orthographic projection is not zero degree FOV, that would mean that you're zoomed into an infinitely small point (i.e. smaller FOV = more zoom). Orthographic projection is when the "camera" stops being a tiny plane through which the scene projects into a focal point, and it instead becomes a large plane that the scene is projected onto with one uniform vector. In raytracing this would be the screen as a plane floating around the scene and rays traced straight from each point on the plane into the scene in one uniform direction - the rays are parallel. In perspective projection the rays "converge" through a point behind the projection rectangle. The difference is very distinct.
@Mart-E12
@Mart-E12 2 жыл бұрын
Let's say it's 0° fov with the camera not acting as a point but a plane. I mean yeah you're right.
@Wishbone_Games
@Wishbone_Games 2 жыл бұрын
As you have pointed out in a previous video, a lot of fps games render their arms and gun with a different camera to avoid clipping through walls. In R6 and apex, they do this, so my guess is that they make the cameras fov super low, almost orthographic, when you aim down your sights.... ive only been developing games for about 2 years, so its just an idea...
Every Successful Multiplayer Game Has This "Problem"
4:25
Garbaj
Рет қаралды 639 М.
POV: fixing SFM mistakes from 6 years ago
7:10
Hoot
Рет қаралды 974 М.
ТИПИЧНОЕ ПОВЕДЕНИЕ МАМЫ
00:21
SIDELNIKOVVV
Рет қаралды 1,4 МЛН
Un coup venu de l’espace 😂😂😂
00:19
Nicocapone
Рет қаралды 10 МЛН
Don't look down on anyone#devil  #lilith  #funny  #shorts
00:12
Devil Lilith
Рет қаралды 45 МЛН
Inside Out 2: ENVY & DISGUST STOLE JOY's DRINKS!!
00:32
AnythingAlexia
Рет қаралды 18 МЛН
The Devs Were Pretty Smart To Come Up With This
4:28
Garbaj
Рет қаралды 916 М.
Starting Out On Creating My Dream Game
7:56
Steven
Рет қаралды 601 М.
The Biggest Cheating Scandal in osu! History Just Happened
11:43
Y'all Remember Prototype? That Game Was Pretty Cool
31:41
Some Nobody
Рет қаралды 92 М.
Ubisoft Isn't Bad... It's Infuriating
22:01
Raycevick
Рет қаралды 814 М.
Why did Quake (and arena shooters) die?
26:23
Skeleblood
Рет қаралды 417 М.
I Never Would Have Thought Of This On My Own
3:01
Garbaj
Рет қаралды 486 М.
Even MORE Sneaky Tricks Most FPS Games Use
3:42
Garbaj
Рет қаралды 732 М.
Let's Talk About "Realistic" Reloads...
4:25
Garbaj
Рет қаралды 1,9 МЛН
ТИПИЧНОЕ ПОВЕДЕНИЕ МАМЫ
00:21
SIDELNIKOVVV
Рет қаралды 1,4 МЛН