I Have No Idea What's Going On Here

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 ต.ค. 2024

ความคิดเห็น • 1.2K

  • @vagabond479
    @vagabond479 2 ปีที่แล้ว +1437

    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 ปีที่แล้ว +63

      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 ปีที่แล้ว +6

      But.. what if another player sees ur gun being scaled down ?

    • @seto007
      @seto007 2 ปีที่แล้ว +77

      @@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 ปีที่แล้ว +26

      @@BossKillRatio First person gun mesh and third person gun mesh are two different meshes.

    • @Khyrid
      @Khyrid 2 ปีที่แล้ว +21

      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 ปีที่แล้ว +3726

    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 ปีที่แล้ว +214

      Good catch!

    • @groundedgaming
      @groundedgaming 2 ปีที่แล้ว +178

      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 ปีที่แล้ว +58

      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 ปีที่แล้ว +798

      I hadn't noticed that, good eye!

    • @Dvance
      @Dvance 2 ปีที่แล้ว +55

      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 ปีที่แล้ว +708

    Never really thought about the depth of the scope, good point.

  • @ceasnov
    @ceasnov 2 ปีที่แล้ว +836

    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 ปีที่แล้ว +31

      its called flipped normals btw :)

    • @slugintub
      @slugintub 2 ปีที่แล้ว +23

      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 ปีที่แล้ว +17

      @@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 ปีที่แล้ว +5

      @@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 ปีที่แล้ว +3

      @@ceasnov oh alright then I think you have the best explanation

  • @Warriorcat49
    @Warriorcat49 2 ปีที่แล้ว +541

    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 ปีที่แล้ว +53

      true though 1x optics generally don't have tubes that long to notice them shrinking due to perspective much

    • @themilkman8554
      @themilkman8554 2 ปีที่แล้ว +42

      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 ปีที่แล้ว +7

      ive used a tube red dot before, videogames are over the top. It looks just like apex legends

    • @VORTENIAN
      @VORTENIAN 2 ปีที่แล้ว +12

      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 ปีที่แล้ว +1

      @@themilkman8554 I've never seen a game that uses binocular vision so...

  • @rancoroustomberry3398
    @rancoroustomberry3398 2 ปีที่แล้ว +857

    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 ปีที่แล้ว +15

      If you needed to use two cameras anyway games wouldnt warn you when switching to pic in pic mode

    • @alexusman
      @alexusman 2 ปีที่แล้ว +185

      @@marly1017 no, rendering objects twice and rendering objects separately are completely different things.

    • @Frogge
      @Frogge 2 ปีที่แล้ว +62

      @@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 ปีที่แล้ว +31

      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 ปีที่แล้ว +6

      @@marly1017 what Froge said. PiP is slow because it renders the entire scene twice. This method renders nothing twice.

  • @ROBOHOLIC1
    @ROBOHOLIC1 2 ปีที่แล้ว +3184

    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 ปีที่แล้ว +36

      same here, glad i’m not the only one

    • @unvergebeneid
      @unvergebeneid 2 ปีที่แล้ว +93

      Doesn't really have anything to do with coding but it's still very technical.

    • @reney9290
      @reney9290 2 ปีที่แล้ว +8

      Kinda similar for me with Ahoy

    • @tangomango2353
      @tangomango2353 2 ปีที่แล้ว

      Same bro

    • @tanybrachid
      @tanybrachid 2 ปีที่แล้ว +45

      None of this was directly related to coding tho...?

  • @nabilurreshad5599
    @nabilurreshad5599 2 ปีที่แล้ว +161

    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 ปีที่แล้ว +2

      came looking for this comment. I was about to comment the same

    • @scrums4748
      @scrums4748 2 ปีที่แล้ว

      @@mrtaufner yeah me too

  • @VRWarLab
    @VRWarLab 2 ปีที่แล้ว +744

    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 ปีที่แล้ว +41

      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 ปีที่แล้ว +2

      Smort

    • @smittyghostey1955
      @smittyghostey1955 2 ปีที่แล้ว

      Cones

    • @chanceappel6736
      @chanceappel6736 2 ปีที่แล้ว

      This is exactly what I was gonna say lol

    • @MidnightSt
      @MidnightSt 2 ปีที่แล้ว +8

      it's ORTHOgraphic, not cartographic =D
      but yeah

  • @gnolex86
    @gnolex86 2 ปีที่แล้ว +272

    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 ปีที่แล้ว +18

      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

  • @Kerosian1
    @Kerosian1 2 ปีที่แล้ว +52

    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 ปีที่แล้ว +3

      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)

  • @denvera1g1
    @denvera1g1 2 ปีที่แล้ว +114

    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 ปีที่แล้ว +16

      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.

  • @bioburden
    @bioburden 2 ปีที่แล้ว +102

    The answer: stencil shaders. They can be used to mask certain parts of the weapon & scope when ADS. Greetings from Ireland 🇮🇪

    • @lubbdaa
      @lubbdaa 2 ปีที่แล้ว +4

      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 ปีที่แล้ว +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?

  • @luukderuijter1332
    @luukderuijter1332 2 ปีที่แล้ว +143

    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 ปีที่แล้ว +5

      This is what I thought too. Great minds think alike ^w^

    • @theonly5001
      @theonly5001 2 ปีที่แล้ว +4

      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.

  • @felineentity
    @felineentity 2 ปีที่แล้ว +35

    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 ปีที่แล้ว +67

    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 ปีที่แล้ว +3

      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 ปีที่แล้ว +1

      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 ปีที่แล้ว +106

    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 ปีที่แล้ว +1

      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 ปีที่แล้ว +20

    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 ปีที่แล้ว +14

    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.

  • @mattomanx77
    @mattomanx77 2 ปีที่แล้ว +5

    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.

  • @hedgeearthridge6807
    @hedgeearthridge6807 2 ปีที่แล้ว +5

    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.)

  • @vnegar4045
    @vnegar4045 2 ปีที่แล้ว +6

    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.

  • @ollyollie
    @ollyollie 2 ปีที่แล้ว +3

    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.

  • @Snakelet
    @Snakelet 2 ปีที่แล้ว +3

    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.

  • @ryzelz
    @ryzelz 2 ปีที่แล้ว +9

    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.

  • @spacecat1194
    @spacecat1194 2 ปีที่แล้ว +12

    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 ปีที่แล้ว +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 ปีที่แล้ว +1

      @@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 ปีที่แล้ว +2

      @@capofantasma97 then I'm not sure it was just a guess

  • @marscaleb
    @marscaleb 2 ปีที่แล้ว +6

    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.

  • @Joel-pl6lh
    @Joel-pl6lh 2 ปีที่แล้ว +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).

  • @malokegames
    @malokegames 2 ปีที่แล้ว +4

    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.

  • @quenter1392
    @quenter1392 2 ปีที่แล้ว +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.

  • @Zagge
    @Zagge 2 ปีที่แล้ว +8

    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 ปีที่แล้ว +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!

  • @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.

  • @Ibuildstuff832
    @Ibuildstuff832 2 ปีที่แล้ว +6

    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 ปีที่แล้ว +1

      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

  • @mrbojangles4155
    @mrbojangles4155 2 ปีที่แล้ว +1

    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 ปีที่แล้ว +1

      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.

  • @thetankist1969
    @thetankist1969 2 ปีที่แล้ว +5

    maybe the inside of the tube is cone shaped.

  • @jart83
    @jart83 2 ปีที่แล้ว +1

    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.

  • @codepeas
    @codepeas 2 ปีที่แล้ว +3

    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 ปีที่แล้ว +1

    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 ปีที่แล้ว +4

    As someone who's been a shooter for 2/3 of his life, I can say videogame optics drive me insane on the regular

  • @ouagagamer3798
    @ouagagamer3798 2 ปีที่แล้ว +1

    They may just not render the inner wall of the scope so your vision just goes through it

  • @PsychoPath89
    @PsychoPath89 2 ปีที่แล้ว +3

    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

  • @TheCCBoi
    @TheCCBoi 2 ปีที่แล้ว +1

    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!

  • @darth_dan8886
    @darth_dan8886 2 ปีที่แล้ว +4

    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)

  • @Thoroughly_Wet
    @Thoroughly_Wet 2 ปีที่แล้ว +1

    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

  • @ASBDGaming
    @ASBDGaming 2 ปีที่แล้ว +4

    Lmao

    • @z𠄢
      @z𠄢 2 ปีที่แล้ว +2

      Agreed

  • @noklle2844
    @noklle2844 2 ปีที่แล้ว +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 ปีที่แล้ว +3

    bydgoszcz

  • @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.

  • @mzmknight
    @mzmknight 2 ปีที่แล้ว +6

    I have no idea how I'm 1st

    • @ributoshithedragon9647
      @ributoshithedragon9647 2 ปีที่แล้ว +1

      what makes no sense is that I’m second

    • @mzmknight
      @mzmknight 2 ปีที่แล้ว +2

      @@ributoshithedragon9647 lol 🤣

  • @GenesisAria
    @GenesisAria 2 ปีที่แล้ว +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)._

  • @emperorsascharoni9577
    @emperorsascharoni9577 2 ปีที่แล้ว +1

    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 ปีที่แล้ว +1

      @@theXeNoNxX I dont know. Based on the map it might be pubg. Havent played for a while though.

  • @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.

  • @lostriches4372
    @lostriches4372 2 ปีที่แล้ว +1

    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.

  • @ricciillmatic5352
    @ricciillmatic5352 2 ปีที่แล้ว +1

    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

  • @GuruEvi
    @GuruEvi 2 ปีที่แล้ว +1

    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.

  • @milkybiskit9215
    @milkybiskit9215 2 ปีที่แล้ว +1

    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

  • @lewis424
    @lewis424 2 ปีที่แล้ว +1

    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.

  • @matvampir0_
    @matvampir0_ 2 ปีที่แล้ว +1

    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.

  • @DaGuppy
    @DaGuppy 2 ปีที่แล้ว +1

    I think they widen the front of the scope so its like a funnel and thats why you only see a bit of it

  • @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.

  • @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

  • @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.

  • @MadJack38
    @MadJack38 2 ปีที่แล้ว +1

    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.

  • @devtomar8906
    @devtomar8906 2 ปีที่แล้ว +2

    I think they are putting the camera way back and then zooming in. I tried doing this in blender using a single camera and the results do seem to indicate that being the case, but I don't know the nuance of how it might look with a background or how it might work in a game. Do try this though, if you read my comment.
    They also might be doing that just for the scope.

  • @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.

  • @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.

  • @polar1991
    @polar1991 2 ปีที่แล้ว +1

    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.

  • @gabrieldecarvalho8189
    @gabrieldecarvalho8189 2 ปีที่แล้ว +1

    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.

  • @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.

  • @matti3561
    @matti3561 2 ปีที่แล้ว +2

    absolute banger apex clip at 4:04

  • @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.

  • @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

  • @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.

  • @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.

  • @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!

  • @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.

  • @3sgamestudio
    @3sgamestudio 2 ปีที่แล้ว

    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.

  • @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.

  • @CompleteAnimation
    @CompleteAnimation 2 ปีที่แล้ว +1

    What I want is someone to experiment with a ray-traced scope. It's actually simulating lenses to give the sight picture.

    • @desu38
      @desu38 2 ปีที่แล้ว

      Sounds like that could work pretty well in VR.

  • @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.

  • @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.

  • @KCrouch-t2o
    @KCrouch-t2o 2 ปีที่แล้ว +1

    it could be rendered as if it's focused at infinity

  • @dankelpuff8381
    @dankelpuff8381 2 ปีที่แล้ว +1

    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.

  • @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.

  • @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.

  • @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.

  • @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).

  • @boahneelassmal
    @boahneelassmal 2 ปีที่แล้ว

    check 4:01 frame by frame. this suggests they either switch to not rendering the inside of the scope during the transition or they unhide a plane which the project the main camera onto...

  • @mikejustcant8240
    @mikejustcant8240 2 ปีที่แล้ว +1

    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.

  • @KaffiRawr
    @KaffiRawr 2 ปีที่แล้ว

    There is 3 ways to do it that keeps the inside of the tube still visible, like in Apex or R6.
    1) The FOV gets narrower when aiming, lessening the effect of seeing the other end of the scope that much smaller. This is the case in Apex.
    2) The other end of the scopes internal tube is slightly wider inside of the far side. Not that common, though.
    3) The inside of the scope is partially hidden. R6 does this and the FOV trick.

  • @nikolasjklein
    @nikolasjklein 2 ปีที่แล้ว

    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! :)

  • @snugg1escat676
    @snugg1escat676 2 ปีที่แล้ว +1

    Even with all the research you do there are still some questions you may struggle to answer.
    That's why all the work you put into this channel is amazing. Your helping everyone else learn by giving them an easy source of useful information.
    This way the next "you" who comes along looking for answers has another place to find what they seek.

  • @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.

  • @DOT107
    @DOT107 2 ปีที่แล้ว

    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.

  • @ВашеДоверие
    @ВашеДоверие 2 ปีที่แล้ว

    Idk if it is the answer, but when you are modelling in blender - you also have to keep track of the vectors of the vertices that the mesh consists of. Basically, these vectors set the direction of the poligon, meaning that when it is looked upon from the correct angle (Looking in a direction opposite to the one that vectors are facing) - texture is displayed, but when you are looking from the other angle (Looking in a the same direction the vectors are facing) - texture is not displayed, and the mesh becomes transparent. That could be the answer to how the scopes work in the last example you provided.

    • @Mart-E12
      @Mart-E12 2 ปีที่แล้ว

      By default fbx models exported from blender show one side of polygons transparent, you can check double-sided mesh while exporting to change this.

  • @cauhxmilloy7670
    @cauhxmilloy7670 2 ปีที่แล้ว

    I'm sure there's many ways to try and implement this, but one way would be: 1) render the gun in a second pass, 2) add a small circular mesh (could even be a quad with a circular texture) to the sight that you want to clear out, 3) use the depth buffer to block out the region from the mesh in (2) to not render the gun.
    This would allow you to open up the sights and not affect other rendered objects in the scene. It would also be fast, since it's all done in a shader using the depth buffer. Also the mesh/texture from (2) is animatable so it can grow and shrink as you bring the gun up and down, making the effect very smooth.

  • @elduck3281
    @elduck3281 2 ปีที่แล้ว

    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.

  • @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.

  • @Mart-E12
    @Mart-E12 2 ปีที่แล้ว +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.