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.
@okesik2 жыл бұрын
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.
@BirshanRamzyCaraccio2 жыл бұрын
But.. what if another player sees ur gun being scaled down ?
@seto0072 жыл бұрын
@@BirshanRamzyCaraccio 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.
@vagabond4792 жыл бұрын
@@BirshanRamzyCaraccio First person gun mesh and third person gun mesh are two different meshes.
@Khyrid2 жыл бұрын
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.
@arkadyaaa2 жыл бұрын
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).
@donovanlay98352 жыл бұрын
Good catch!
@groundedgaming2 жыл бұрын
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_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.
@garbaj2 жыл бұрын
I hadn't noticed that, good eye!
@Dvance2 жыл бұрын
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.
@cgron342 жыл бұрын
Never really thought about the depth of the scope, good point.
@ceasnov2 жыл бұрын
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
@hoax53472 жыл бұрын
its called flipped normals btw :)
@slugintub2 жыл бұрын
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
@HateHater22052 жыл бұрын
@@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
@ceasnov2 жыл бұрын
@@HateHater2205 this. also the scope overlay could be made invisible when not seen so you don't get into as many problems
@HateHater22052 жыл бұрын
@@ceasnov oh alright then I think you have the best explanation
@Warriorcat492 жыл бұрын
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.
@dominikbury22 жыл бұрын
true though 1x optics generally don't have tubes that long to notice them shrinking due to perspective much
@themilkman85542 жыл бұрын
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.
@superslimex74162 жыл бұрын
ive used a tube red dot before, videogames are over the top. It looks just like apex legends
@VORTENIAN2 жыл бұрын
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-Steve2 жыл бұрын
@@themilkman8554 I've never seen a game that uses binocular vision so...
@ROBOHOLIC12 жыл бұрын
I am completely inept in coding. So all this info just goes over my head. I just watch because I like hearing your voice.
@ryanlikesally2 жыл бұрын
same here, glad i’m not the only one
@unvergebeneid2 жыл бұрын
Doesn't really have anything to do with coding but it's still very technical.
@reney92902 жыл бұрын
Kinda similar for me with Ahoy
@tangomango23532 жыл бұрын
Same bro
@tanybrachid2 жыл бұрын
None of this was directly related to coding tho...?
@rancoroustomberry33982 жыл бұрын
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 !
@marly10172 жыл бұрын
If you needed to use two cameras anyway games wouldnt warn you when switching to pic in pic mode
@alexusman2 жыл бұрын
@@marly1017 no, rendering objects twice and rendering objects separately are completely different things.
@Frogge2 жыл бұрын
@@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
@unvergebeneid2 жыл бұрын
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... 🤔
@unvergebeneid2 жыл бұрын
@@marly1017 what Froge said. PiP is slow because it renders the entire scene twice. This method renders nothing twice.
@VRWarLab2 жыл бұрын
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)
@xanderkyron2 жыл бұрын
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.
@drsamuelhaydensecretgaming67492 жыл бұрын
Smort
@smittyghostey19552 жыл бұрын
Cones
@chanceappel67362 жыл бұрын
This is exactly what I was gonna say lol
@MidnightSt2 жыл бұрын
it's ORTHOgraphic, not cartographic =D but yeah
@nabilurreshad55992 жыл бұрын
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
@mrtaufner2 жыл бұрын
came looking for this comment. I was about to comment the same
@scrums47482 жыл бұрын
@@mrtaufner yeah me too
@gnolex862 жыл бұрын
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.
@traackmaniac2 жыл бұрын
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.
@GamePhysics2 жыл бұрын
This effect is pretty easy to do using a render texture in Unity as well.
@DajesOfficial2 жыл бұрын
So this is basically described in the video PIP method
@luukderuijter13322 жыл бұрын
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.
@lilyofluck3712 жыл бұрын
This is what I thought too. Great minds think alike ^w^
@theonly50012 жыл бұрын
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.
@luukderuijter13322 жыл бұрын
@@theonly5001 huh, never thought about normal vectors. Pretty obvious actually
@vibaj162 жыл бұрын
@@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
@theonly50012 жыл бұрын
@@vibaj16 that is certainly a option. However you can do this option as well.
@denvera1g12 жыл бұрын
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
@Phoen1x8832 жыл бұрын
Ironic for him to have put this clip over him saying "What am I missing?"
@LuLeBe2 жыл бұрын
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.
@felineentity2 жыл бұрын
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.
@Kerosian12 жыл бұрын
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)
@chrisakaschulbus49032 жыл бұрын
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)
@bioburden2 жыл бұрын
The answer: stencil shaders. They can be used to mask certain parts of the weapon & scope when ADS. Greetings from Ireland 🇮🇪
@lubbdaa2 жыл бұрын
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.
@bioburden2 жыл бұрын
@@lubbdaa True, but for performance reasons, I certainly wouldn't recommend using the render texture approach on mobile devices.
@mastershooter642 жыл бұрын
Top of the morning to ya!
@bioburden2 жыл бұрын
@@mastershooter64 We don't say that here 😂
@mastershooter642 жыл бұрын
@@bioburden _damnnn youuu jacksepticeye!!!_ lol is it really that uncommon in ireland? was it more common in the past?
@mollikye69282 жыл бұрын
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.
@mollikye69282 жыл бұрын
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.
@mollikye69282 жыл бұрын
@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.
@ayoubtouaty82552 жыл бұрын
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 🧱??
@-aid40842 жыл бұрын
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.
@greatmagicianwungus62262 жыл бұрын
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.
@Thoroughly_Wet2 жыл бұрын
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
@vnegar40452 жыл бұрын
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.
@ouagagamer37982 жыл бұрын
They may just not render the inner wall of the scope so your vision just goes through it
@nolife74832 жыл бұрын
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_Hit2 жыл бұрын
When you wrote older Call of Duty I imagined you meant Call of Duty 4 or something, not games from 5 years ago
@Matt_History2 жыл бұрын
@@Critical_Hit modern warfare teamstered is CoD4... But yeah I feel you
@jart832 жыл бұрын
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.
@spacecat11942 жыл бұрын
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
@andersonrobotics56082 жыл бұрын
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
@spacecat11942 жыл бұрын
@@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
@spacecat11942 жыл бұрын
@@capofantasma97 then I'm not sure it was just a guess
@mrbojangles41552 жыл бұрын
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.
@mrbojangles41552 жыл бұрын
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.
@thebackupguy54142 жыл бұрын
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.
@DaGuppy2 жыл бұрын
I think they widen the front of the scope so its like a funnel and thats why you only see a bit of it
@ryzelz2 жыл бұрын
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.
@KCrouch-t2o2 жыл бұрын
it could be rendered as if it's focused at infinity
@ollyollie2 жыл бұрын
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.
@justjulianmusic2 жыл бұрын
So this is why my game drops down 20 frames when I aim down magnified optics in tarkov
@thetankist19692 жыл бұрын
maybe the inside of the tube is cone shaped.
@TheCCBoi2 жыл бұрын
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!
@Snakelet2 жыл бұрын
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.
@your_average_enthusiast2 жыл бұрын
What makes no sense is the height over bore on that AUG
@malokegames2 жыл бұрын
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!!
@malokegames2 жыл бұрын
@@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".
@malokegames2 жыл бұрын
@@Bluelightzero I replied before you edited it, but I still don't get you point though...
@malokegames2 жыл бұрын
@@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.
@SinShadowed2 жыл бұрын
Could be that the end of the scope is widened so instead of a cylinder, the shape takes more of a cone on the scope. I have no idea how any of this works but its what comes to mind to me
@hedgeearthridge68072 жыл бұрын
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.)
@dankelpuff83812 жыл бұрын
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.
@Zagge2 жыл бұрын
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.
@purnabratakar71762 жыл бұрын
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.
@Zagge2 жыл бұрын
@@purnabratakar7176 Cool to hear that you've actually put this in to practice! Thanks for your insight!
@ersia872 жыл бұрын
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!
@mattomanx772 жыл бұрын
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.
@shocknaw2 жыл бұрын
Apex just stops rendering the front of the scope and pretty much halves it
@marscaleb2 жыл бұрын
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.
@ChristianCarlburg2 жыл бұрын
This is the answer
@HoneyNutBeerios2 жыл бұрын
The picture-in-picture idea explains Halo's sniper rifle scope very well as a side effect!
@Hillykarma2 жыл бұрын
As someone who's been a shooter for 2/3 of his life, I can say videogame optics drive me insane on the regular
@Joel-pl6lh2 жыл бұрын
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).
@Ibuildstuff8322 жыл бұрын
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.
@SolaFideSolusChristus2662 жыл бұрын
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
@Ibuildstuff8322 жыл бұрын
@@SolaFideSolusChristus266 The scope elements could be in-scene sprites instead of UI elements with yet another layer on top for light-simulations
@SolaFideSolusChristus2662 жыл бұрын
@@Ibuildstuff832 True
@devforfun56182 жыл бұрын
you can make the material one sided, the inside of the tube will be transparent but the outside will still be rendered
@codepeas2 жыл бұрын
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.
@Xaymar2 жыл бұрын
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.
@PsychoPath892 жыл бұрын
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
@nazzlan2 жыл бұрын
the cam rendering the gun and the cam rendering the environment have a different fov, that both lerp to a higher value as you ads, the short scope length plus low fov on the gun creates this effect.
@darth_dan88862 жыл бұрын
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)
@quenter13922 жыл бұрын
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.
@ASBDGaming2 жыл бұрын
Lmao
@z𠄢2 жыл бұрын
Agreed
@Hamentsios102 жыл бұрын
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
@konkranis2 жыл бұрын
bydgoszcz
@ruszki25012 жыл бұрын
+1
@barj2 жыл бұрын
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.
@DoorknobPlus2 жыл бұрын
bargy
@mzmknight2 жыл бұрын
I have no idea how I'm 1st
@ributoshithedragon96472 жыл бұрын
what makes no sense is that I’m second
@mzmknight2 жыл бұрын
@@ributoshithedragon9647 lol 🤣
@Great.Milenko2 жыл бұрын
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.
@Arlios2 жыл бұрын
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.
@ethanmiddleton2 жыл бұрын
A really simple way of achieving this look is to have the inside of the tube more of a inverse cone, then an actual tube.
@batman36982 жыл бұрын
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.
@polar19912 жыл бұрын
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.
@CompleteAnimation2 жыл бұрын
What I want is someone to experiment with a ray-traced scope. It's actually simulating lenses to give the sight picture.
@desu382 жыл бұрын
Sounds like that could work pretty well in VR.
@JonathanKrysse2 жыл бұрын
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
@ricciillmatic53522 жыл бұрын
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
@3sgamestudio2 жыл бұрын
Dev here. It's a rendering technique and is done on the shader itself. the hands and the gun have a separate FOV render than the screen but are not rendered entirely separately. Yes, it generates shadow artefacts in FPP but is barely noticeable and for most unnoticeable at all. It means that when you aim - the screen FOV changes, but what happens is the gun FOV changes DRAMATICALLY. Low FOV has less of the perspective "tube" effect due to the angle of view. This way with gun FOV you have full control over how much screen space the sight will take, and it allows you to keep a slight change of FOV for the main camera giving you still a parallel vision.
@travelOblivion2 жыл бұрын
They might have a another camera that's renders over the scope and is pushed forward to pass the actual site
@andre.drezus9 ай бұрын
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.
@Glyph67682 жыл бұрын
In Insurgency: Sandstorm the front of the scope is cut off while in ads, you can sometimes see it on the security red dot if you have a minor performance drop/stutter while exiting ads.
@DOT1072 жыл бұрын
In Insurgency, they go transparent. Its more noticable when using guns without flipdown front site as they'll only render in a pool of blood.
@nikolasjklein2 жыл бұрын
Game dev here! A lot of games zoom in everything, like the entire screen, but basically overlay a scope texture which is black all around and only leaves open what the scope would see. A lot of games like CSGO and Fortnite use this. Other games use a PiP solution, but render out a view of the scope mesh including a normal map and use this as part of the "scope" assembly. The normal map is there so that the scope texture does not appear flat, but can to some extent react to lighting. The most elaborate solution is a 3d model of the scope, with the camera attached to the end of the scope (with a very high zoom level on it) and a render target stuck at the end of the scope. If anyone has any more in-depth questions, feel free to ask them in the replies! :)
@darcksnow592 жыл бұрын
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.
@edzact_ly2 жыл бұрын
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.
@Zeus23oo2 жыл бұрын
maybe pip but just to make scope dimension more shorter, maybe just litle zoom
@Avernalism2 жыл бұрын
The front of the scope is an active object, and everything beyond the reticle and front of the sight is rendered invisible. The perspective makes it possible to believe the scope is unchanged on top of the gun
@elduck32812 жыл бұрын
Elegant solution: outer circle just should be bigger. Like in weird optical illusions, where far placed greater object appears to be same size, as smaller object nearby.
@CrtngSomethings2 жыл бұрын
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.
@JupiterMaroon2 жыл бұрын
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.
@muffemod2 жыл бұрын
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.
@ZiGABlaze2 жыл бұрын
So happy you are gaining traction. Found you 4 or 5 months ago & I love the stuff you put out. Can't wait to try your game someday!
@slugintub2 жыл бұрын
Maybe there are 2 planes in the scope, one at the start, and one at the end. The game renders the view from the second plane, and projects it onto the first plane.
@gamerman72762 жыл бұрын
It just doesn't draw that part of the scope, simple as. You can think of it like picture in picture where one picture has a gun in it and the other doesn't.
@TheBrazilRules2 жыл бұрын
The first thing that came to mind was that they had back face culling active and the inside of the scope is not fully modeled
@lewis4242 жыл бұрын
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.
@MicJej2 жыл бұрын
Feels like backface culling everything aside from a small section on the inner diameter of the scope would be a quick way to achieve the right effect there.
@GrasshopperKelly2 жыл бұрын
It's because the "camera" or the point of vision looking through the rendered scope, is so far back and zoomed so far in, that the scope's walls are almost parallel to the line of sight.
@Kasiadzi12 жыл бұрын
OMG that height the scope on that aug is so high over the bore, good they shoot from their eyes.
@cddevelopment3632 жыл бұрын
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.
@tbotalpha81332 жыл бұрын
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.
@emperorsascharoni95772 жыл бұрын
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.
@theXeNoNxX2 жыл бұрын
what game is the one u tagged?
@emperorsascharoni95772 жыл бұрын
@@theXeNoNxX I dont know. Based on the map it might be pubg. Havent played for a while though.
@koz__39232 жыл бұрын
My theory for apex legends style zooming is this: when you put ur eye closer to a metal tube, there are is more obstructions other than the openings, but if you push it away from you and still look intk it, the obstructions shrink, so i think that apex does this same think except just zooms it in
@lostriches2 жыл бұрын
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.
@Poldovico2 жыл бұрын
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.
@fourthhorseman45312 жыл бұрын
I love how the BDC reticle on that rifle scope in Apex is literally backwards, with the wider line at the bottom and the narrower line at the top. Well done, devs.
@RyoZixon2 жыл бұрын
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.
@AzureRoseMarshal2 жыл бұрын
i think Unturned has picture in picture for scopes, even when it's held in your hand and not aimed, the picture in the scope will be wherever the scope is pointed at
@Ramash4402 жыл бұрын
"Hope you learned something" I didn't, I left the video with more questions than when I came in! That's not a bad thing but now I won't be able to think of anything else for the next few hours. Damn you Garbaj!
@PowerGamerSC2 жыл бұрын
i think i there's two cameras in the game, the "world camera" and the "gun camera", when ADS, there's a plane that projects the world camera into the gun sight, or maybe some kind of interpolation between the two cameras
@lethaldumpster26992 жыл бұрын
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.