Search Unity

HDRP camera help

Discussion in 'FPS.Sample Game' started by konsic, Nov 13, 2019.

  1. konsic

    konsic

    Joined:
    Oct 19, 2015
    Posts:
    995
    I don't know how to create first person hands and gun HDRP.

    I loaded fps sample to learn how to get depth pass for gun and holding hand.
    But, I can't see how to do it. Scripts on the player don't work and I don't know how does camera work.
    Please, can someone explain to me how does this camera pass in HDRP work in fps sample?

    s4.JPG
     
    Last edited: Nov 13, 2019
  2. AggressiveMastery

    AggressiveMastery

    Joined:
    Nov 19, 2018
    Posts:
    206
    I think they posted a video on youtube that talks about the first person and the hands (prolly where I know this from.)

    I believe we use 1 camera, and the hands/gun are drawn within that camera as a normal model. ... .... but the render has a tick for "FOV" that makes it render above the rest of the items and excludes collision.

    So the FPS Sample does not use TWO cameras like other games do, where you have a scene camera, and a hands/wep camera. Instead the renderer that renders the hands and gun, has a new value "FIRST PERSON FOV" that scales/warps the model from the camera to provide the same effects without the dual camera performance hit.

    Run the client in the editor, and go back to the scene view and look at the player, and you will see their hands exist within the world for that single player camera, and not linked to another layer ect.

    Good Luck out there!
    Micah
     
    konsic likes this.
  3. konsic

    konsic

    Joined:
    Oct 19, 2015
    Posts:
    995
    I can't get client to work.
    Could you post screen in your project of what FIRST PERSON FOV is and how is linked to the gun and holding hand?
     
  4. karstenv

    karstenv

    Joined:
    Jan 12, 2014
    Posts:
    81
    The FOV setting on the first person and arms models are not rendering them on top of everything else.
    The way it works is that the first person arms and weapon are scaled down to 0.3 on all 3 axis.
    Then you add a separate material to them and tick the FOV setting.

    What this does is rendering these ate a lower FOV (40 as standard) the the rest of the game making them look as big as normal, even if they are scaled down.

    This is way they can get away with using a single camera.

    But you can do it however you want as this is not a mandatory method for the FPS sample. It's just how they did it.
     
    AggressiveMastery likes this.
  5. konsic

    konsic

    Joined:
    Oct 19, 2015
    Posts:
    995
    Thank you!
    Where can I get FOV setting for the material ? I can't see First person shader perspective asset.

    s5.JPG

    Is it possible to make in HDRP like they did for lwrp ?
     
    AggressiveMastery likes this.
  6. karstenv

    karstenv

    Joined:
    Jan 12, 2014
    Posts:
    81
    You need to use the correct shader to find the FPS Mode (FOV setting)...
     

    Attached Files:

    AggressiveMastery likes this.
  7. emilylena

    emilylena

    Joined:
    Jan 18, 2018
    Posts:
    10
    @karstenv did they remove that FOV tick? Because in the latest HDRP version I cannot find that tick when creating a HDRP/Lit material (it seems to look the same for everything else though)
     
  8. karstenv

    karstenv

    Joined:
    Jan 12, 2014
    Posts:
    81
    I havent used it for a while so im not sure if it got removed. perhaps you can switch to debug mode in the inspector and that will expose all parameters. Maybe they just hid contra removed it?
     
  9. Ryan-Hayle

    Ryan-Hayle

    Joined:
    Feb 16, 2014
    Posts:
    142
    What is the reason for the weapons to be scaled to 0.3? Is this intentional or is it just because the models are big?
     
  10. karstenv

    karstenv

    Joined:
    Jan 12, 2014
    Posts:
    81
    The reason is that by scaling it down by 0.3 you get it back to the original size as the smaller FOV makes it bigger.