Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

NEW | First Person View 3 - FPS Render for Default Render/HDRP/URP | No Clipping + Independent FoV

Discussion in 'Assets and Asset Store' started by eskovas, Sep 23, 2015.

  1. SamuelRoos

    SamuelRoos

    Joined:
    Dec 16, 2015
    Posts:
    9
    How am I able to make the Unity's built-in Particle Additive shader (and other particle shaders) to work with FPV?

    I followed the manual and it told that to implement other shaders with FPV, the following process is similar for all shaders;

    We add the “#pragma multi_compile __ FIRSTPERSONVIEW” and “#pragma multi_compile __ FPV_Light” to the CGINCLUDE section of the shader.
    We then add the tag “RenderType”=”FPV” to the tags section of the SubShader.

    This didn't work for me, though particles with the Alpha Blended shader which is included in FVP do work.

     
  2. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,373
    I just tested picking up the Particle Additive Shader from Unity's Built-in shaders, making those changes, putting the shader inside the folder with the custom UnityShaderVariables and re-compiling. It's working fine on my end.

    Note that for shaders with softparticles on, you will need to do some tuning to that value because of the custom projections FPV uses to achieve the effect, so you'll need to increase the "Soft Particles Factor" (maybe even above the default limit) in those shaders (if you want soft particles).
    Even then, you might not be able to see those particles if you are very close to a wall, because the softparticles just blends them in due to the very low distance to the wall. If that's a problem, try changing to a shader that does not have softparticles on, and make sure it doesn't intersect your FPV objects. Should result in a similar effect and not blend with world objects

    Also, be sure to put the shader inside the folder with the custom UnityShaderVariables and hit re-compile.
     
    Last edited: Dec 31, 2018
    SamuelRoos likes this.
  3. xkinginthecastlecastlex

    xkinginthecastlecastlex

    Joined:
    Nov 7, 2018
    Posts:
    93
    Hi there,
    First Person View 2 is exactly what I am looking for, however I am using Unity 2018.3 and it looks like the current ver. 2.1.2 supports only 2018.1 ?

    Is there an update planned for Unity 2018.3?
     
  4. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,373
    Hello everyone.

    I'm pleased to announce that i'm working on a new First Person View 3 HDRP version.
    It will be easier to setup and use, and won't have issues with the HDRP temporal post process effects like TAA.

    It's based on the solution of the FPS Sample (shader based), but with some modifications and easy workflow just like FPV2.
    Here's a quick video i posted on my Twitter, where the FOV of the weapon changes when aiming:

    https://twitter.com/Tiago11F/status/1166116286851616769
     
    Weendie-Games likes this.
  5. BeRtRoLlT

    BeRtRoLlT

    Joined:
    Nov 8, 2017
    Posts:
    3
    Hey,

    I'm happy to hear about the new FPV version being in development.

    Right now I am using FPV version 2 and shadows on FPV objects are stretched and sometimes flickering.
    I suppose this is because of the limitations that the current system has.
    How will shadows work on FPV objects with version 3?

    Also, as it is a HDRP version, will it require using the High Definition Render Pipeline in the project?
     
  6. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,373
    FPV supports later versions than the ones mentioned in the asset store, since i provide the details on how to do it in the documentation. I usually update the asset with newer versions of the required assets, but anyone can update them to later versions using the same logic. It just requires extra manual work.

    I'll try to add later Unity version in the future.

    The stretch shadows happen because the depth of the objects are also affected and they get very small, which is why the shadows appear like that. I've tried many times to fix that but it's very tricky and never got very good results.

    For FPV3, i will be supporting both HDRP and LWRP, with support for custom shaders (those have to be manually setup but i'll make the process easy).
    Same shadow stretch issue will most likely happen with this version, but i'll add some options where you can better tweak this depth to have a more balanced renderer without too much clipping with the environment.
    Same solution can't be done with the default renderer afaik due to some limitations/restrictions with Unity's motion vectors. (i guess if you wouldn't want to use screen space effects with motion vectors this would probably work though)
     
  7. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,373
    well, i guess a FPV3 solution for LWRP/HDRP might no longer be needed with this new video Unity made :)
     
    Weendie-Games likes this.
  8. lod3

    lod3

    Joined:
    Mar 21, 2012
    Posts:
    671
    @eskovas

    Considering picking this up. Do you still have the UFPS integration instructions?
     
  9. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,373
    Hi,
    The asset never had instructions for UFPS integration. The current instructions should work fine, as others were able to integrate into UFPS.
    A couple of notes to take into account:
    - This asset only supports the default renderer (not lwrp or hdrp)
    - the current version of the asset has included standard shader versions until version 2018.2, but the pdf included explains everything on how to set up on any version, so it will have a little setup work.

    -------

    I also decided that i will update the asset, with a new solution (shader based), mainly for LWRP and HDRP, but will also have support for the default renderer. Should work much better than the current one, without the need to change any cgincludes or anything like that.
    Will require some setup, but nothing complicated.
    It'll also mostly use the same files with some modifications, so you won't have to change much if you're already using FPV.
     
    Lars-Steenhoff likes this.
  10. xkinginthecastlecastlex

    xkinginthecastlecastlex

    Joined:
    Nov 7, 2018
    Posts:
    93
    @eskovas Hi, I bought your First Person View 2 asset recently. I am using Unity 2018.4 and noticed occlusion culling doesn´t work as soon as First Person View 2 is setup.
    I would appreciate if you have any idea how to solve this...

    Many thanks in advance
     
  11. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,373
    Talked about the issue in the post above in PMs, and the issue was most likely related to being set up incorrectly.

    ------------

    I also just submitted a small update to FPV 2.1. Here's the change list:
    - Added FPV shaders/CGIncludes for Unity 2018.4 and 2019.3
    - Simplified example scripts.
    - Improved Manual with missing sections on how FPV works.

    So now FPV includes examples for the following Unity versions:
    - 5.6.4; 2017.1.0; 2017.2.0; 2017.3.1; 2018.1.0; 2018.4.15; 2019.3.0.
    The manual includes all the necessary steps to setup FPV for any other Unity version not included in this package.

    ------------

    On another news regarding FPV3, happy to say that i've been able to add support for URP and HDRP, and i'm currently working on making the new solution work using the default renderer.
    I'll share more info and screens when close to complete.
     
    Weendie-Games and Vincent454 like this.
  12. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,373
    Vincent454 likes this.
  13. runelink

    runelink

    Joined:
    Jun 2, 2014
    Posts:
    4
    @eskovas hey,

    We're in the process of updating our project from unity 2017 and I'm thinking of choosing 2019.2 since this is hopefully more stable than 2019.3. There seems to be no example included for this so I was wondering if you would recommend using the 2019.3 example in unity 2019.2 or if you would recommend using 2019.3 for fpv or in general.
    Thanks
     
  14. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,373
    First Person View 3 has been submitted for review!
    Price of the asset will be increasing to 20$. Anyone that has bought the asset in the last 60 days of the date of release of the new version will get it for free, and anyone who has bought FPV2 in the past will be able to get FPV3 for 50% off!

    I'm finishing up a small video showcasing First Person View 3


    First Person View 3 offers a solution for first person render in Unity, where first person objects won’t clip through the environment, have a separate field of view and receive shadows from the environment.

    FPV3 now supports the Default Renderer for Unity versions 2018.4 and up, and also supports HDRP and URP for Unity versions 2019.3 and up.

    New in First Person View 3!
    - Support for HDRP and URP for Unity 2019.3+ using ShaderGraph,
    - Much simpler and easier setup for the Default Renderer,
    - Ability to easily fade in/out of First Person View, useful when interacting with the environment,
    - Finer control over changing shadow casting mode in and out of FPV.

    HDRP/URP Advantages:
    - Super easy setup using ShaderGraph
    - Doesn't require any code/GCInc changes
    - Doesn't require re-setup for newer Unity versions
    - Less limitations on Post Processing effects

    -- Notes --
    - Please note that this is not a first person controller.
    - Content from screenshots and videos are from my game, No Heroes, and are not included with First Person View 3.

    Default Renderer Limitations:
    - Partially supports temporal effects. In FPV3, Motion Vectors are essentially "disabled" but still active. TAA for example will still partially work, but temporal motion blur will not.
    - Light and Shadows calculations are stretched for first person objects.
    - Not a limitation, but when updating to a newer Unity version, you'll need to setup FPV again for that version of Unity. All steps are provided in the manual. HDRP/URP don't require this re-setup for newer versions.

    HDRP/URP Limitations:
    - Light and Shadows calculations are stretched for first person objects.
    - Due to an Unity issue, Skinned Mesh Motion Vectors don't play well with vertex scaling, so FPV3 needs to disable the Motion Vectors for skinned meshes. Most temporal effects will still work, with the exception of temporal motion blur.

    ----------

    The manual includes all the necessary steps to setup FPV for all renderers and future Unity versions.

    Every script is well documented to make it easier to learn and understand how these solutions were made.




     
    GCatz, Weendie-Games and Vincent454 like this.
  15. Ryan-Hayle

    Ryan-Hayle

    Joined:
    Feb 16, 2014
    Posts:
    142
    Do you have to scale weapon objects when using this shader?
     
  16. GCatz

    GCatz

    Joined:
    Jul 31, 2012
    Posts:
    282
    interesting, how good does it transition between 3rd to 1rst ?
     
  17. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,373
    For HDRP and URP, the custom node/sub graph does vertex scaling automatically in the shader.

    You can instantly turn off/on first person view in FPV, or you can fade the effect to have a smooth transition between On/Off by just calling a simple static function.
    In the video in the next post i show a few examples where i use this fade feature to vault over objects and pickup weapons, so that nothing looks weird when interacting. This can be used for a number of things, like animating first person animations with interacting with the environment.
     
  18. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,373
    Here's the official demonstration and comparison video of First Person View 3, using No Heroes as an example.
    This demonstration is done in HDRP.
     
    K4rha, Vincent454 and paulojsam like this.
  19. Ryan-Hayle

    Ryan-Hayle

    Joined:
    Feb 16, 2014
    Posts:
    142
    What is the frame per second when using this asset?
     
  20. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,373
    For Default Renderer, there's basically no performance impact.
    For HDRP/URP there is some extra work in the shader for vertex modifications, but it is negligible, since it's all done in the GPU.
    All in all, you most likely won't see performance degradation.
     
  21. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,373


    Because it took a long time to be approved, i increased the grace days for anyone that bought FPV2 close to it being deprecated. If you purchased First Person View 2 since March 1st, then you can get First Person View 3 for free :)

    For everyone else that bought First Person View 2, you can get the new version 50% Off.

    For some reason it's displaying the ratings from the previous version, even though this is a new package. Making the upgrade option must have carried over the ratings, which i wasn't counting on o_O
    Anyone know how not to include reviews from the deprecated package?
     
    Last edited: May 26, 2020
    K4rha likes this.
  22. xkingjohnx

    xkingjohnx

    Joined:
    Feb 22, 2016
    Posts:
    67
    hi there,
    any news regarding the compatibility of First Person View 3 with mmfpse ?
     
  23. jackcrosa

    jackcrosa

    Joined:
    Oct 16, 2012
    Posts:
    22
    Hello , does this work with UFPS HDRP ? Thanks !
     
  24. K4rha

    K4rha

    Joined:
    Aug 7, 2014
    Posts:
    30
    There is no integration for it, but it's actually easier to set it up with UFPS 2 than it was with FPV 2 and UFPS 1.
    You basically just need to check how the example scene of fpv3 works and copy all the settings to your UFPS 2 camera setup. Minor changes to your First Person Arms layers need to be done as well.
    If you need a more detailed guide, just pm me.
     
    Last edited: Nov 14, 2020
  25. konsordo

    konsordo

    Joined:
    Jun 25, 2013
    Posts:
    11
    Hello! I have bought your asset FPV3. Everything is working fine. However, I found a bug. When I am using your shader on the mesh that paced on the near to the center of unity global coordinates 0,0,0, then everything works fine, but when I moved the mesh with your shader on a big distance from the center (in my case 1400,440,320), then I get a tremor shake effect. How can I fix this problem?
     
  26. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,373
    This is related to floating point precision limitations. Also happens with other objects without FPV if you look closely. Might be more noticeable with FPV due to the shader vertex modifications at that distance from center.
    There's really no way around the floating point precision limitation besides doing world origin shift for those kinds of distances, which is usually a must for large worlds.

    Sorry but i don't think there's nothing i could do to FPV itself to remove the shaking at those distances. You'll have to do the origin shift yourself or grab some asset that does that. Don't think Unity supports it out of the box.
     
  27. konsordo

    konsordo

    Joined:
    Jun 25, 2013
    Posts:
    11

    Sounds bad. However, anyways to make the center calculations from the specific point on the scene? For example, we can use the player position as a center point instead of the Unity Center 0,0,0
     
  28. ansjuan

    ansjuan

    Joined:
    May 15, 2018
    Posts:
    15
    Hello! I recently purchased FPV3 and I am able to make it work within my project, but I have an issue which I do not know how to solve. Everytime I close unity and open it again, I get the following fatal error: "Fatal Error! Failed to load Editor resource file." I have to delete and reimport the project everytime (1 hour). I am sure that it is due to this asset because I made a back up just before installing it. I am using the built-in rendering pipe and unity 2019.4 LTS
     
  29. Eulrich3d

    Eulrich3d

    Joined:
    Jun 22, 2019
    Posts:
    1
    Hi @eskovas ,
    I want to buy this package. But before that, I want to ask you about the following situation.
    According to the latest HDRP updates, how satisfactory will it be to activate the Temporal anti-aliasing (TAA)?
    In other words, after activating TAA, Is there a ghosting trail (or something like that) when motion the gun models (skinned mesh)?
    I will buy this package if TAA activation is satisfactory result.
     
    Last edited: Mar 28, 2021
  30. Nykster

    Nykster

    Joined:
    Jan 16, 2015
    Posts:
    8
    Hello,
    We are having the exact same problem on our project at the moment. Were you able to find a fix for this?

    @eskovas Do you know about this issue?

    Thanks for your help!
     
  31. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,373
    Hello,
    Not really, as i'm not able to reproduce this issue. Try cleaning up FPV from the project and import FPV from scratch. Never got anyone else with these issues before the two of you, so must be something very rare.
    Let me know if you still have issues.
     
  32. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,373
    TAA in HDRP will work fine. There will be some minor artifacts on skinned meshes due to motion vectors having to be disabled for those, as i mention in the description of the asset, but it still mostly works.
    You can check the video where i demonstrate FPV being used in HDRP with normal meshes and skinned meshes, and you can verify if the quality is good for your case.
     
  33. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    733
    Hey eskovas, I'm trying to integrate your amazing asset and everything works perfectly ... just one question ... is there a way to avoid clipping even for a light?
    In my case I would like to add a fire torch but the light as expected goes through the wall.
    Do you think it is something possible to do with your asset?
    Thanks.

    EDIT: I'm using Default Renderer.

    Torch.jpg
     
    Last edited: May 31, 2021
  34. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,373
    Hello,
    Thank you very much! :)

    That's because the meshes are modified at shader level, so any other objects will still have the non FPV location/direction. To account for this, you can use the same functionality used to spawn projectiles based on the fov to position lights, or any other object. Check the Fire() function in FPV_Shader_Example_Weapon.cs. In particular the function FPV.FPVToWorld, which can give you the correct location and direction based on the FPV that's applied to the meshes.

    This should get the effect you want.
     
  35. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    733
    Thanks for your reply.
    i did a quick test but i can't see the expected behavior.
    I tried to change the position of the red sphere to match a position inside the weapon by passing that point to FPVToWorld and then applying the result as the position of the red sphere.

    FPV.jpg

    I expected that the red ball would be placed over the distorted weapon in the main camera but instead it is not too far from the "real " position (yellow icon) of the weapon.
     
    Last edited: Jun 3, 2021
  36. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,373
    Correct. The function is not taking the depth into account when converting the coordinates. I just submitted a small update that will fix this issue.
    Should be available soon.
     
    sjm-tech likes this.
  37. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    733
    Thank you! I can't wait! :)
     
  38. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,373
    Update should be available. Let me know how it works
     
    sjm-tech likes this.
  39. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    733
    Hey eskovas, thanks for the update!

    FPV1.jpg FPV2.jpg
    I'm trying to find the best use of the new update and by fakeing some lights and shadows I got a good solution ;).
    The difficult parts:
    - the converted position needs an offset.
    - the light moved to the converted position does not properly illuminate the body/hand/torch
    - the shadow looks strange and distorted (known behaviour on default rp)

    EDIT: added sample scene (without fake lights)
    minimal issues:
    - strange projected shadows
    - no torch light on arms/weapons
    - highlight (from torch) on walls not so realistic.
     

    Attached Files:

    Last edited: Jun 10, 2021
    Vincent454 likes this.
  40. fadizant

    fadizant

    Joined:
    Dec 17, 2016
    Posts:
    9
    Hi @eskovas,

    I really like First Person View 3 but I want to test it first so could you please provide us with an executable file to see it?
     
  41. balthazardanger

    balthazardanger

    Joined:
    Jul 22, 2015
    Posts:
    2
    Good afternoon @eskovas,
    I am unable to get it working with HDRP. I bought / imported your FPV3 and I am currently using the MarsFPSKit to build my BR in. I couldn't get the shaders to setup correctly (it's missing pretty much anything that was listed in the docs) so I tried the simple solution one and still nothing. I added in the scripts to both Main Camera and added in the secondary one like it shows in the docs, yet nothing. Was wondering if I could get some help in getting this to work. Thank you!

    edit: docs are out of date and I am unable to add the shaders to the node
     
    Last edited: Mar 22, 2022
  42. balthazardanger

    balthazardanger

    Joined:
    Jul 22, 2015
    Posts:
    2
    Nvm, nothing works still. FPV3 is no bueno.
     
    Last edited: Mar 22, 2022
    giraffe1 likes this.